From adede4a068292ac19e27e02785e25fbe89577543 Mon Sep 17 00:00:00 2001 From: kiirala Date: Fri, 25 Aug 2006 18:40:13 +0000 Subject: [PATCH] Fixed a crash in modifying filter parameters in XML editor. Fixed filters not appearing, when a file with filters is loaded. --- src/dialogs/object-properties.cpp | 4 +--- src/sp-filter-primitive.cpp | 6 ++++-- src/sp-gaussian-blur.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dialogs/object-properties.cpp b/src/dialogs/object-properties.cpp index a4dd49aeb..20efc8408 100644 --- a/src/dialogs/object-properties.cpp +++ b/src/dialogs/object-properties.cpp @@ -14,7 +14,7 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ //uncomment to display blur slider -//#define WITH_BLUR +#define WITH_BLUR #ifdef HAVE_CONFIG_H # include "config.h" @@ -416,8 +416,6 @@ sp_fillstroke_get_new_filter(SPDocument *document, gdouble stdDeviation) // get corresponding object SPFilter *f = SP_FILTER( document->getObjectByRepr(repr) ); SPGaussianBlur *b = SP_GAUSSIANBLUR( document->getObjectByRepr(b_repr) ); - //add blur primitive to SPFilter object - add_primitive(f, b); //TODO: this should be triggered in SPFilter.cpp, when a child is added, not here... g_assert(f != NULL); g_assert(SP_IS_FILTER(f)); diff --git a/src/sp-filter-primitive.cpp b/src/sp-filter-primitive.cpp index a0c09a4ce..8553b9050 100644 --- a/src/sp-filter-primitive.cpp +++ b/src/sp-filter-primitive.cpp @@ -20,7 +20,7 @@ #include "attributes.h" #include "sp-filter-primitive.h" #include "xml/repr.h" - +#include "sp-filter.h" /* FilterPrimitive base class */ @@ -88,6 +88,8 @@ sp_filter_primitive_build(SPObject *object, SPDocument *document, Inkscape::XML: ((SPObjectClass *) filter_primitive_parent_class)->build(object, document, repr); } + if (object->parent) + add_primitive((SPFilter*)object->parent, (SPFilterPrimitive*)object); } /** @@ -146,7 +148,7 @@ sp_filter_primitive_write(SPObject *object, Inkscape::XML::Node *repr, guint fla if (flags & SP_OBJECT_WRITE_EXT) { if (repr) { // is this sane? - repr->mergeFrom(SP_OBJECT_REPR(object), "id"); + //repr->mergeFrom(SP_OBJECT_REPR(object), "id"); } else { repr = SP_OBJECT_REPR(object)->duplicate(); } diff --git a/src/sp-gaussian-blur.cpp b/src/sp-gaussian-blur.cpp index 68f22c8d4..63680a10b 100644 --- a/src/sp-gaussian-blur.cpp +++ b/src/sp-gaussian-blur.cpp @@ -155,7 +155,7 @@ sp_gaussianBlur_write(SPObject *object, Inkscape::XML::Node *repr, guint flags) if (flags & SP_OBJECT_WRITE_EXT) { if (repr) { // is this sane? - repr->mergeFrom(SP_OBJECT_REPR(object), "id"); + // repr->mergeFrom(SP_OBJECT_REPR(object), "id"); } else { repr = SP_OBJECT_REPR(object)->duplicate(); } -- 2.30.2