summaryrefslogtreecommitdiffstats
path: root/src/sp-object.cpp
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2010-07-02 07:40:46 +0000
committerJon A. Cruz <jon@joncruz.org>2010-07-02 07:40:46 +0000
commit124ecce5e258ae4922638f30d117e98d09060da8 (patch)
tree48007ee89e3d49e839fe3134be02016df153d0ea /src/sp-object.cpp
parentfix Launchpad bug 593023: crash in constrained snap due to not calling setup(... (diff)
downloadinkscape-124ecce5e258ae4922638f30d117e98d09060da8.tar.gz
inkscape-124ecce5e258ae4922638f30d117e98d09060da8.zip
Leave swatches when doing a vacuum pass. Fixes bug #594445.
Fixed bugs: - https://launchpad.net/bugs/594445 (bzr r9551)
Diffstat (limited to 'src/sp-object.cpp')
-rw-r--r--src/sp-object.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 420c7b4a6..3b0056b41 100644
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -539,29 +539,31 @@ SPObject::setLabel(gchar const *label) {
/** Queues the object for orphan collection */
-void
-SPObject::requestOrphanCollection() {
+void SPObject::requestOrphanCollection() {
g_return_if_fail(document != NULL);
// do not remove style or script elements (Bug #276244)
- if (SP_IS_STYLE_ELEM(this))
- return;
- if (SP_IS_SCRIPT(this))
- return;
-
- document->queueForOrphanCollection(this);
+ if (SP_IS_STYLE_ELEM(this)) {
+ // leave it
+ } else if (SP_IS_SCRIPT(this)) {
+ // leave it
+ } else if (SP_IS_PAINT_SERVER(this) && static_cast<SPPaintServer*>(this)->isSwatch() ) {
+ // leave it
+ } else {
+ document->queueForOrphanCollection(this);
- /** \todo
- * This is a temporary hack added to make fill&stroke rebuild its
- * gradient list when the defs are vacuumed. gradient-vector.cpp
- * listens to the modified signal on defs, and now we give it that
- * signal. Mental says that this should be made automatic by
- * merging SPObjectGroup with SPObject; SPObjectGroup would issue
- * this signal automatically. Or maybe just derive SPDefs from
- * SPObjectGroup?
- */
+ /** \todo
+ * This is a temporary hack added to make fill&stroke rebuild its
+ * gradient list when the defs are vacuumed. gradient-vector.cpp
+ * listens to the modified signal on defs, and now we give it that
+ * signal. Mental says that this should be made automatic by
+ * merging SPObjectGroup with SPObject; SPObjectGroup would issue
+ * this signal automatically. Or maybe just derive SPDefs from
+ * SPObjectGroup?
+ */
- this->requestModified(SP_OBJECT_CHILD_MODIFIED_FLAG);
+ this->requestModified(SP_OBJECT_CHILD_MODIFIED_FLAG);
+ }
}
/** Sends the delete signal to all children of this object recursively */