Merge lp:~inkscape+alexander/inkscape/comments into lp:~inkscape.dev/inkscape/trunk

Proposed by jazzynico
Status: Merged
Merged at revision: 14986
Proposed branch: lp:~inkscape+alexander/inkscape/comments
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 159 lines (+60/-3) (has conflicts)
3 files modified
src/document.cpp (+45/-1)
src/document.h (+1/-1)
src/sp-object.cpp (+14/-1)
Text conflict in src/document.cpp
To merge this branch: bzr merge lp:~inkscape+alexander/inkscape/comments
Reviewer Review Type Date Requested Status
jazzynico (community) Approve
Review via email: mp+297150@code.launchpad.net
To post a comment you must log in.
Revision history for this message
jazzynico (jazzynico) wrote :

Conflicts fixed and comments merged rev. 14986.
Thanks Alexander!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/document.cpp'
2--- src/document.cpp 2016-06-08 09:16:29 +0000
3+++ src/document.cpp 2016-06-13 05:33:40 +0000
4@@ -1591,6 +1591,23 @@
5
6 /* Helpers */
7
8+<<<<<<< TREE
9+=======
10+gboolean
11+sp_document_resource_list_free(gpointer /*key*/, gpointer value, gpointer /*data*/)
12+{
13+ g_slist_free((GSList *) value);
14+ return TRUE;
15+}
16+
17+/**
18+ * Count the siblings of an object (plus the object itself).
19+ *
20+ * @param [in] obj Pointer to the object which siblings shall be counted.
21+ * @param [inout] Number of objects counted so far (in previous iterations / recursion levels)
22+ * @return Number of siblings (plus the object itself)
23+ */
24+>>>>>>> MERGE-SOURCE
25 static unsigned int count_objects_recursive(SPObject *obj, unsigned int count)
26 {
27 count++; // obj itself
28@@ -1602,11 +1619,22 @@
29 return count;
30 }
31
32+/**
33+ * Count the number of objects in a given document recursively using the count_objects_recursive helper function
34+ *
35+ * @param[in] document Pointer to the document for counting objects
36+ * @return Numer of objects in the document
37+ */
38 static unsigned int objects_in_document(SPDocument *document)
39 {
40 return count_objects_recursive(document->getRoot(), 0);
41 }
42
43+/**
44+ * Remove unused definitions etc. recursively from an object and its siblings
45+ *
46+ * @param[inout] obj Object which shall be "cleaned"
47+ */
48 static void vacuum_document_recursive(SPObject *obj)
49 {
50 if (SP_IS_DEFS(obj)) {
51@@ -1621,10 +1649,20 @@
52 }
53 }
54
55+/**
56+ * Remove unused definitions etc. recursively from an entire document.
57+ *
58+ * @return Number of removed objects
59+ */
60 unsigned int SPDocument::vacuumDocument()
61 {
62+<<<<<<< TREE
63 unsigned int start = objects_in_document(this);
64 unsigned int end;
65+=======
66+ unsigned int const start = objects_in_document(this);
67+ unsigned int end = start;
68+>>>>>>> MERGE-SOURCE
69 unsigned int newend = start;
70
71 unsigned int iterations = 0;
72@@ -1639,6 +1677,7 @@
73 newend = objects_in_document(this);
74
75 } while (iterations < 100 && newend < end);
76+ // We stop if vacuum_document_recursive doesn't remove any more objects or after 100 iterations, whichever occurs first.
77
78 return start - newend;
79 }
80@@ -1647,7 +1686,12 @@
81 return priv->seeking;
82 }
83
84-void SPDocument::setModifiedSinceSave(bool modified) {
85+/**
86+ * 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.
87+ *
88+ * @param[in] modified True if the document has been modified.
89+ */
90+void SPDocument::setModifiedSinceSave(bool const modified) {
91 this->modified_since_save = modified;
92 if (SP_ACTIVE_DESKTOP) {
93 Gtk::Window *parent = SP_ACTIVE_DESKTOP->getToplevel();
94
95=== modified file 'src/document.h'
96--- src/document.h 2016-06-01 19:13:32 +0000
97+++ src/document.h 2016-06-13 05:33:40 +0000
98@@ -198,7 +198,7 @@
99 bool isSeeking() const;
100
101 bool isModifiedSinceSave() const { return modified_since_save; }
102- void setModifiedSinceSave(bool modified = true);
103+ void setModifiedSinceSave(bool const modified = true);
104
105 private:
106 SPDocument(SPDocument const &); // no copy
107
108=== modified file 'src/sp-object.cpp'
109--- src/sp-object.cpp 2016-03-18 17:58:10 +0000
110+++ src/sp-object.cpp 2016-06-13 05:33:40 +0000
111@@ -71,13 +71,17 @@
112 SPObject::repr_order_changed
113 };
114
115-// A friend class used to set internal members on SPObject so as to not expose settors in SPObject's public API
116+/**
117+ * A friend class used to set internal members on SPObject so as to not expose settors in SPObject's public API
118+ */
119 class SPObjectImpl
120 {
121 public:
122
123 /**
124 * Null's the id member of an SPObject without attempting to free prior contents.
125+ *
126+ * @param[inout] obj Pointer to the object which's id shall be nulled.
127 */
128 static void setIdNull( SPObject* obj ) {
129 if (obj) {
130@@ -87,6 +91,9 @@
131
132 /**
133 * Sets the id member of an object, freeing any prior content.
134+ *
135+ * @param[inout] obj Pointer to the object which's id shall be set.
136+ * @param[in] id New id
137 */
138 static void setId( SPObject* obj, gchar const* id ) {
139 if (obj && (id != obj->id) ) {
140@@ -104,6 +111,9 @@
141 static gchar *sp_object_get_unique_id(SPObject *object,
142 gchar const *defid);
143
144+/**
145+ * Constructor, sets all attributes to default values.
146+ */
147 SPObject::SPObject()
148 : cloned(0), uflags(0), mflags(0), hrefcount(0), _total_hrefcount(0),
149 document(NULL), parent(NULL), children(NULL), _last_child(NULL),
150@@ -126,6 +136,9 @@
151 this->context_style = NULL;
152 }
153
154+/**
155+ * Destructor, frees the used memory and unreferences a potential successor of the object.
156+ */
157 SPObject::~SPObject() {
158 g_free(this->_label);
159 g_free(this->_default_label);