diff options
| author | kamalpreetgrewal <grewalkamal005@gmail.com> | 2016-06-15 13:44:45 +0000 |
|---|---|---|
| committer | kamalpreetgrewal <grewalkamal005@gmail.com> | 2016-06-15 13:44:45 +0000 |
| commit | a3791c80377428f14bc4729c11d1538ba14fa7c3 (patch) | |
| tree | 499cd4d98350d0aa48124f82c21c1c91a49ca770 /src/document.cpp | |
| parent | Set style and class attribute of object approprialtely when adding new style ... (diff) | |
| parent | [Bug #1300865] lcms2: crash in Fill and Stroke if linked color profile is mis... (diff) | |
| download | inkscape-a3791c80377428f14bc4729c11d1538ba14fa7c3.tar.gz inkscape-a3791c80377428f14bc4729c11d1538ba14fa7c3.zip | |
Merge changes from trunk
(bzr r14949.1.17)
Diffstat (limited to 'src/document.cpp')
| -rw-r--r-- | src/document.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/document.cpp b/src/document.cpp index d8c3f1269..902dabbc3 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -1602,11 +1602,22 @@ static unsigned int count_objects_recursive(SPObject *obj, unsigned int count) return count; } +/** + * Count the number of objects in a given document recursively using the count_objects_recursive helper function + * + * @param[in] document Pointer to the document for counting objects + * @return Numer of objects in the document + */ static unsigned int objects_in_document(SPDocument *document) { return count_objects_recursive(document->getRoot(), 0); } +/** + * Remove unused definitions etc. recursively from an object and its siblings + * + * @param[inout] obj Object which shall be "cleaned" + */ static void vacuum_document_recursive(SPObject *obj) { if (SP_IS_DEFS(obj)) { @@ -1621,6 +1632,11 @@ static void vacuum_document_recursive(SPObject *obj) } } +/** + * Remove unused definitions etc. recursively from an entire document. + * + * @return Number of removed objects + */ unsigned int SPDocument::vacuumDocument() { unsigned int start = objects_in_document(this); @@ -1639,6 +1655,7 @@ unsigned int SPDocument::vacuumDocument() newend = objects_in_document(this); } while (iterations < 100 && newend < end); + // We stop if vacuum_document_recursive doesn't remove any more objects or after 100 iterations, whichever occurs first. return start - newend; } @@ -1647,6 +1664,11 @@ bool SPDocument::isSeeking() const { return priv->seeking; } +/** + * Indicate to the user if the document has been modified since the last save by displaying a "*" in front of the name of the file in the window title. + * + * @param[in] modified True if the document has been modified. + */ void SPDocument::setModifiedSinceSave(bool modified) { this->modified_since_save = modified; if (SP_ACTIVE_DESKTOP) { |
