summaryrefslogtreecommitdiffstats
path: root/src/style.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2008-07-24 19:31:53 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2008-07-24 19:31:53 +0000
commitbd0c2647c7a6a48617cc53d9129dc11d100aab7c (patch)
treedb2bbb7122a28d630ee8524a9fda2ee397fe6aa7 /src/style.cpp
parentmake clonetiler obey the bbox prefs (diff)
downloadinkscape-bd0c2647c7a6a48617cc53d9129dc11d100aab7c.tar.gz
inkscape-bd0c2647c7a6a48617cc53d9129dc11d100aab7c.zip
fix 246944
(bzr r6413)
Diffstat (limited to 'src/style.cpp')
-rw-r--r--src/style.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/style.cpp b/src/style.cpp
index 1d4384c4c..2b24f37ed 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -2016,9 +2016,6 @@ sp_style_merge_from_dying_parent(SPStyle *const style, SPStyle const *const pare
if (!style->filter.set || style->filter.inherit)
{
- // FIXME:
- // instead of just copying over, we need to _really merge_ the two filters by combining their
- // filter primitives
sp_style_merge_ifilter(style, &parent->filter);
}
@@ -2163,6 +2160,10 @@ sp_style_merge_ipaint(SPStyle *style, SPIPaint *paint, SPIPaint const *parent)
static void
sp_style_merge_ifilter(SPStyle *style, SPIFilter const *parent)
{
+ // FIXME:
+ // instead of just copying over, we need to _really merge_ the two filters by combining their
+ // filter primitives
+
sp_style_filter_clear(style);
style->filter.set = parent->set;
style->filter.inherit = parent->inherit;
@@ -2170,6 +2171,12 @@ sp_style_merge_ifilter(SPStyle *style, SPIFilter const *parent)
if (style->filter.href && style->filter.href->getObject())
style->filter.href->detach();
+ // it may be that this style has not yet created its SPFilterReference
+ if (!style->filter.href && style->object && SP_OBJECT_DOCUMENT(style->object)) {
+ style->filter.href = new SPFilterReference(SP_OBJECT_DOCUMENT(style->object));
+ style->filter.href->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_style_filter_ref_changed), style));
+ }
+
if (style->filter.href && parent->href) {
try {
style->filter.href->attach(*parent->href->getURI());
@@ -2488,12 +2495,18 @@ sp_style_clear(SPStyle *style)
style->stroke.clear();
sp_style_filter_clear(style);
- if (style->fill.value.href)
+ if (style->fill.value.href) {
delete style->fill.value.href;
- if (style->stroke.value.href)
+ style->fill.value.href = NULL;
+ }
+ if (style->stroke.value.href) {
delete style->stroke.value.href;
- if (style->filter.href)
+ style->stroke.value.href = NULL;
+ }
+ if (style->filter.href) {
delete style->filter.href;
+ style->filter.href = NULL;
+ }
if (style->stroke_dash.dash) {
g_free(style->stroke_dash.dash);