summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0701849)
raw | patch | inline | side by side (parent: 0701849)
author | mental <mental@users.sourceforge.net> | |
Mon, 6 Mar 2006 05:08:31 +0000 (05:08 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Mon, 6 Mar 2006 05:08:31 +0000 (05:08 +0000) |
ChangeLog | patch | blob | history | |
src/document-subset.cpp | patch | blob | history | |
src/document-subset.h | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 492c77a14f19b857ef207926110cdf775d7cf9c8..15e64ddf16d167fe949c0f66c465849c3ef58c94 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2006-03-06 MenTaLguY <mental@rydia.net>
+
+ * src/document-subset.h, src/document-subset.cpp:
+ add DocumentSubset::_clear
+
2006-03-05 MenTaLguY <mental@rydia.net>
* src/document-subset.h, src/document-subset.cpp:
index f6b32c0f40ac42647a36a2ad972e0d5a31342285..ba6e416cd49a09c08157be7a6c4625c384eb165d 100644 (file)
--- a/src/document-subset.cpp
+++ b/src/document-subset.cpp
void addOne(SPObject *obj);
void remove(SPObject *obj, bool subtree);
void reorder(SPObject *obj);
+ void clear();
private:
Record &_doAdd(SPObject *obj) {
changed_signal.emit();
}
+void DocumentSubset::Relations::clear() {
+ Record &root=records[NULL];
+
+ while (!root.children.empty()) {
+ _doRemoveSubtree(root.children.front());
+ }
+
+ changed_signal.emit();
+}
+
void DocumentSubset::Relations::reorder(SPObject *obj) {
SPObject::ParentIterator parent=obj;
_relations->remove(obj, subtree);
}
+void DocumentSubset::_clear() {
+ _relations->clear();
+}
+
bool DocumentSubset::includes(SPObject *obj) const {
return _relations->get(obj);
}
diff --git a/src/document-subset.h b/src/document-subset.h
index 269b4c59b95c74de065966dae20df6c88ff0f660..e424a289c5ce048829b7b80a36d7c01f1d1611ff 100644 (file)
--- a/src/document-subset.h
+++ b/src/document-subset.h
void _addOne(SPObject *obj);
void _removeOne(SPObject *obj) { _remove(obj, false); }
void _removeSubtree(SPObject *obj) { _remove(obj, true); }
+ void _clear();
private:
DocumentSubset(DocumentSubset const &); // no copy