summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 75c3ef6)
raw | patch | inline | side by side (parent: 75c3ef6)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 3 Feb 2006 03:01:53 +0000 (03:01 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 3 Feb 2006 03:01:53 +0000 (03:01 +0000) |
src/style.cpp | patch | blob | history | |
src/style.h | patch | blob | history |
diff --git a/src/style.cpp b/src/style.cpp
index afaded2a11456304bf3b1196c9e470ed328abdf5..9dd9503614f663e7172c7e41ec63459673ee3c0c 100644 (file)
--- a/src/style.cpp
+++ b/src/style.cpp
sp_style_clear(style);
style->cloned = false;
+ style->hreffed = false;
return style;
}
@@ -2000,6 +2001,7 @@ sp_style_merge_ipaint(SPStyle *style, SPIPaint *paint, SPIPaint const *parent)
paint->value.paint.uri = parent->value.paint.uri;
if (paint->value.paint.server) {
if (style->object && !style->cloned) { // href paintserver for style of non-clones only
+ style->hreffed = true;
sp_object_href(SP_OBJECT(paint->value.paint.server), style);
}
if (style->object || style->cloned) { // connect to signals for style of real objects or clones (this excludes temp styles)
@@ -2854,6 +2856,7 @@ sp_style_read_ipaint(SPIPaint *paint, gchar const *str, SPStyle *style, SPDocume
paint->value.paint.server = SP_PAINT_SERVER(ps);
if (style->object && !style->cloned) {
sp_object_href(SP_OBJECT(paint->value.paint.server), style);
+ style->hreffed = true;
}
if (style->object || style->cloned) {
g_signal_connect(G_OBJECT(paint->value.paint.server), "release",
unsigned hunref, unsigned unset)
{
if (hunref && (paint->type == SP_PAINT_TYPE_PAINTSERVER) && paint->value.paint.server) {
- if (style->object && !style->cloned) {
+ if (style->hreffed) {
sp_object_hunref(SP_OBJECT(paint->value.paint.server), style);
}
if (style->object || style->cloned) {
diff --git a/src/style.h b/src/style.h
index 1233b795866c8d8c462a3ae768485fb4914aac5a..ba1900bde8265103285729d3dcdaa61bdc4ef5bb 100644 (file)
--- a/src/style.h
+++ b/src/style.h
/// style belongs to a cloned object, must not href anything
bool cloned;
+ /// style has hreffed its paintservers, needs to release
+ bool hreffed;
};
SPStyle *sp_style_new();