diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2018-10-05 13:31:33 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2018-10-05 13:31:33 +0000 |
| commit | f5651cf5d63c5eb3bfc0710f2ff399e3627a963c (patch) | |
| tree | a1ddf72d6393596ce0d1f0d5dfdf87dc6b0e72a0 /src | |
| parent | CI/AppVeyor: Try to avoid some redundant builds (diff) | |
| download | inkscape-f5651cf5d63c5eb3bfc0710f2ff399e3627a963c.tar.gz inkscape-f5651cf5d63c5eb3bfc0710f2ff399e3627a963c.zip | |
fix 1795942 "object to path" uses outdated state
Diffstat (limited to 'src')
| -rw-r--r-- | src/object/sp-clippath.cpp | 1 | ||||
| -rw-r--r-- | src/object/sp-hatch-path.cpp | 1 | ||||
| -rw-r--r-- | src/object/sp-hatch.cpp | 1 | ||||
| -rw-r--r-- | src/object/sp-item.cpp | 1 | ||||
| -rw-r--r-- | src/object/sp-solid-color.cpp | 1 | ||||
| -rw-r--r-- | src/style.cpp | 10 | ||||
| -rw-r--r-- | src/style.h | 5 |
7 files changed, 16 insertions, 4 deletions
diff --git a/src/object/sp-clippath.cpp b/src/object/sp-clippath.cpp index 21959af41..724c715ed 100644 --- a/src/object/sp-clippath.cpp +++ b/src/object/sp-clippath.cpp @@ -84,6 +84,7 @@ void SPClipPath::set(unsigned int key, const gchar* value) { break; default: if (SP_ATTRIBUTE_IS_CSS(key)) { + this->style->clear(key); this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } else { SPObjectGroup::set(key, value); diff --git a/src/object/sp-hatch-path.cpp b/src/object/sp-hatch-path.cpp index 8da149f75..60f186212 100644 --- a/src/object/sp-hatch-path.cpp +++ b/src/object/sp-hatch-path.cpp @@ -106,6 +106,7 @@ void SPHatchPath::set(unsigned int key, const gchar* value) default: if (SP_ATTRIBUTE_IS_CSS(key)) { + style->clear(key); requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } else { SPObject::set(key, value); diff --git a/src/object/sp-hatch.cpp b/src/object/sp-hatch.cpp index 5b6d034a9..5786fc98d 100644 --- a/src/object/sp-hatch.cpp +++ b/src/object/sp-hatch.cpp @@ -221,6 +221,7 @@ void SPHatch::set(unsigned int key, const gchar* value) default: if (SP_ATTRIBUTE_IS_CSS(key)) { + style->clear(key); requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } else { SPPaintServer::set(key, value); diff --git a/src/object/sp-item.cpp b/src/object/sp-item.cpp index d5c02709e..14dd4c5f2 100644 --- a/src/object/sp-item.cpp +++ b/src/object/sp-item.cpp @@ -518,6 +518,7 @@ void SPItem::set(unsigned int key, gchar const* value) { } default: if (SP_ATTRIBUTE_IS_CSS(key)) { + style->clear(key); object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } else { SPObject::set(key, value); diff --git a/src/object/sp-solid-color.cpp b/src/object/sp-solid-color.cpp index 1d973766e..f1d73835c 100644 --- a/src/object/sp-solid-color.cpp +++ b/src/object/sp-solid-color.cpp @@ -39,6 +39,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)) { + style->clear(key); this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } else { SPPaintServer::set(key, value); diff --git a/src/style.cpp b/src/style.cpp index a4f567354..6d86e6a96 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -499,6 +499,16 @@ SPStyle::~SPStyle() { } void +SPStyle::clear(/* SPAttributeEnum */ int id) { + SPIBase *p = _prop_helper.get(this, (SPAttributeEnum)id); + if (p) { + p->clear(); + } else { + g_warning("Unimplemented style property %d", id); + } +} + +void SPStyle::clear() { for (auto * p : _properties) { p->clear(); diff --git a/src/style.h b/src/style.h index 07dd329d6..fd45e02ea 100644 --- a/src/style.h +++ b/src/style.h @@ -29,9 +29,6 @@ // Define SPIBasePtr, a Pointer to a data member of SPStyle of type SPIBase; typedef SPIBase SPStyle::*SPIBasePtr; -// Define SPPropMap, a map linking property name to property data -// typedef std::map<std::string, SPIBasePtr> SPPropMap; - namespace Inkscape { namespace XML { class Node; @@ -47,6 +44,7 @@ public: SPStyle(SPDocument *document = nullptr, SPObject *object = nullptr);// document is ignored if valid object given ~SPStyle(); void clear(); + void clear(/* SPAttributeEnum */ int id); void read(SPObject *object, Inkscape::XML::Node *repr); void readFromObject(SPObject *object); void readFromPrefs(Glib::ustring const &path); @@ -84,7 +82,6 @@ public: private: /// Pointers to all the properties (for looping through them) std::vector<SPIBase *> _properties; - // static SPPropMap _propmap; public: |
