diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2014-12-24 10:27:30 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2014-12-24 10:27:30 +0000 |
| commit | c10ae6598c095b0273672f764f0fe0e684c94b87 (patch) | |
| tree | d837f1351dc1aa71f23eaf063b805e64cb4d336b | |
| parent | Add missing SPStyle::readFromPrefs(), remove sp_style_read_from_prefs(). (diff) | |
| download | inkscape-c10ae6598c095b0273672f764f0fe0e684c94b87.tar.gz inkscape-c10ae6598c095b0273672f764f0fe0e684c94b87.zip | |
Remove sp_style_read_from_object()
(bzr r13822.1.3)
| -rw-r--r-- | src/sp-clippath.cpp | 2 | ||||
| -rw-r--r-- | src/sp-hatch-path.cpp | 2 | ||||
| -rw-r--r-- | src/sp-hatch.cpp | 2 | ||||
| -rw-r--r-- | src/sp-item.cpp | 2 | ||||
| -rw-r--r-- | src/sp-object.cpp | 2 | ||||
| -rw-r--r-- | src/sp-solid-color.cpp | 2 | ||||
| -rw-r--r-- | src/sp-style-elem.cpp | 13 | ||||
| -rw-r--r-- | src/style.cpp | 32 |
8 files changed, 20 insertions, 37 deletions
diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp index 8e2e7d7a6..5065f25c3 100644 --- a/src/sp-clippath.cpp +++ b/src/sp-clippath.cpp @@ -103,7 +103,7 @@ void SPClipPath::set(unsigned int key, const gchar* value) { break; default: if (SP_ATTRIBUTE_IS_CSS(key)) { - sp_style_read_from_object(this->style, this); + this->style->readFromObject( this ); this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } else { SPObjectGroup::set(key, value); diff --git a/src/sp-hatch-path.cpp b/src/sp-hatch-path.cpp index 8558b67f2..bc95c246e 100644 --- a/src/sp-hatch-path.cpp +++ b/src/sp-hatch-path.cpp @@ -128,7 +128,7 @@ void SPHatchPath::set(unsigned int key, const gchar* value) default: if (SP_ATTRIBUTE_IS_CSS(key)) { - sp_style_read_from_object(style, this); + style->readFromObject( this ); requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } else { SPObject::set(key, value); diff --git a/src/sp-hatch.cpp b/src/sp-hatch.cpp index 4a8707e08..dfecb2250 100644 --- a/src/sp-hatch.cpp +++ b/src/sp-hatch.cpp @@ -238,7 +238,7 @@ void SPHatch::set(unsigned int key, const gchar* value) default: if (SP_ATTRIBUTE_IS_CSS(key)) { - sp_style_read_from_object(style, this); + style->readFromObject( this ); requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } else { SPPaintServer::set(key, value); diff --git a/src/sp-item.cpp b/src/sp-item.cpp index dbb0380ea..fbb76e971 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -555,7 +555,7 @@ void SPItem::set(unsigned int key, gchar const* value) { } default: if (SP_ATTRIBUTE_IS_CSS(key)) { - sp_style_read_from_object(object->style, object); + style->readFromObject( this ); object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } else { SPObject::set(key, value); diff --git a/src/sp-object.cpp b/src/sp-object.cpp index b0b482cf2..124471545 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -915,7 +915,7 @@ void SPObject::set(unsigned int key, gchar const* value) { object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); break; case SP_ATTR_STYLE: - sp_style_read_from_object(object->style, object); + object->style->readFromObject( object ); object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); break; default: diff --git a/src/sp-solid-color.cpp b/src/sp-solid-color.cpp index 0d6b96b62..72569d8c0 100644 --- a/src/sp-solid-color.cpp +++ b/src/sp-solid-color.cpp @@ -53,7 +53,7 @@ void SPSolidColor::build(SPDocument* doc, Inkscape::XML::Node* repr) { void SPSolidColor::set(unsigned int key, const gchar* value) { if (SP_ATTRIBUTE_IS_CSS(key)) { - sp_style_read_from_object(this->style, this); + style->readFromObject( this ); this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } else { SPPaintServer::set(key, value); diff --git a/src/sp-style-elem.cpp b/src/sp-style-elem.cpp index da17b08d9..668780272 100644 --- a/src/sp-style-elem.cpp +++ b/src/sp-style-elem.cpp @@ -319,13 +319,14 @@ void SPStyleElem::read_content() { //requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); // Style references via class= do not, and actually cannot, use autoupdating URIReferences. - // Therefore, if an object refers to a stylesheet which has not yet loaded when the object is being loaded - // (e.g. if the stylesheet is below or inside the object in XML), its class= has no effect (bug 1491639). - // Below is a partial hack that fixes this for a single case: when the <style> is a child of the object - // that uses a style from it. It just forces the parent of <style> to reread its style as soon as the stylesheet - // is fully loaded. Naturally, this won't work if the user of the stylesheet is its grandparent or precedent. + // Therefore, if an object refers to a stylesheet which has not yet loaded when the object is + // being loaded (e.g. if the stylesheet is below or inside the object in XML), its class= has + // no effect (bug 1491639). Below is a partial hack that fixes this for a single case: when + // the <style> is a child of the object that uses a style from it. It just forces the parent of + // <style> to reread its style as soon as the stylesheet is fully loaded. Naturally, this won't + // work if the user of the stylesheet is its grandparent or precedent. if ( parent ) { - sp_style_read_from_object(parent->style, parent); + parent->style->readFromObject( parent ); } } diff --git a/src/style.cpp b/src/style.cpp index f677e4a76..b91b3d774 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -576,7 +576,13 @@ SPStyle::read( SPObject *object, Inkscape::XML::Node *repr ) { } } -// Matches void sp_style_read_from_object(SPStyle *style, SPObject *object); +/** + * Read style properties from object's repr. + * + * 1. Reset existing object style + * 2. Load current effective object style + * 3. Load i attributes from immediate parent (which has to be up-to-date) + */ void SPStyle::readFromObject( SPObject *object ) { @@ -1215,30 +1221,6 @@ sp_style_unref(SPStyle *style) return style; } - - -// Called in: sp-clippath.cpp, sp-item.cpp (suspicious), sp-object.cpp, sp-style-elem.cpp -/** - * Read style properties from object's repr. - * - * 1. Reset existing object style - * 2. Load current effective object style - * 3. Load i attributes from immediate parent (which has to be up-to-date) - */ -void -sp_style_read_from_object(SPStyle *style, SPObject *object) -{ - // std::cout << "sp_style_read_from_object: " << (object->getId()?object->getId():"null") << std::endl; - g_return_if_fail(style != NULL); - g_return_if_fail(object != NULL); - g_return_if_fail(SP_IS_OBJECT(object)); - - Inkscape::XML::Node *repr = object->getRepr(); - g_return_if_fail(repr != NULL); - - style->read( object, repr ); -} - static CRSelEng * sp_repr_sel_eng() { |
