From 43f80e25517651b82754e3b05303dacff0c03a10 Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Tue, 7 Jul 2015 21:22:31 +1200 Subject: Read inkscape:color attribute on guides (bzr r14228.1.1) --- src/sp-guide.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/sp-guide.cpp') diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp index 4e1c5913d..83e723e5c 100644 --- a/src/sp-guide.cpp +++ b/src/sp-guide.cpp @@ -26,6 +26,7 @@ #include "display/sp-canvas.h" #include "display/guideline.h" #include "svg/svg.h" +#include "svg/svg-color.h" #include "svg/stringstream.h" #include "attributes.h" #include "sp-guide.h" @@ -70,6 +71,7 @@ void SPGuide::build(SPDocument *document, Inkscape::XML::Node *repr) { SPObject::build(document, repr); + this->readAttr( "inkscape:color" ); this->readAttr( "inkscape:label" ); this->readAttr( "orientation" ); this->readAttr( "position" ); @@ -95,6 +97,9 @@ void SPGuide::release() void SPGuide::set(unsigned int key, const gchar *value) { switch (key) { + case SP_ATTR_INKSCAPE_COLOR: + this->setColor(sp_svg_read_color(value, 0x0000ff00) | 0x7f); + break; case SP_ATTR_INKSCAPE_LABEL: if (this->label) g_free(this->label); -- cgit v1.2.3 From c708f6f8ef412736862def24411cb1e7a86e6b27 Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Sat, 11 Jul 2015 14:25:47 +1200 Subject: Read attribute after setting the default (bzr r14228.1.2) --- src/sp-guide.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/sp-guide.cpp') diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp index 83e723e5c..b4f4cecc0 100644 --- a/src/sp-guide.cpp +++ b/src/sp-guide.cpp @@ -71,7 +71,6 @@ void SPGuide::build(SPDocument *document, Inkscape::XML::Node *repr) { SPObject::build(document, repr); - this->readAttr( "inkscape:color" ); this->readAttr( "inkscape:label" ); this->readAttr( "orientation" ); this->readAttr( "position" ); @@ -98,7 +97,9 @@ void SPGuide::release() void SPGuide::set(unsigned int key, const gchar *value) { switch (key) { case SP_ATTR_INKSCAPE_COLOR: - this->setColor(sp_svg_read_color(value, 0x0000ff00) | 0x7f); + if (value) { + this->setColor(sp_svg_read_color(value, 0x0000ff00) | 0x7f); + } break; case SP_ATTR_INKSCAPE_LABEL: if (this->label) g_free(this->label); -- cgit v1.2.3 From 6699c5e9fbdae104044748ee6039a5e09d78f001 Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Thu, 16 Jul 2015 00:23:14 +1200 Subject: Read inkscape:color attribute in more places (bzr r14228.1.4) --- src/sp-guide.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/sp-guide.cpp') diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp index b4f4cecc0..b9c124138 100644 --- a/src/sp-guide.cpp +++ b/src/sp-guide.cpp @@ -71,6 +71,7 @@ void SPGuide::build(SPDocument *document, Inkscape::XML::Node *repr) { SPObject::build(document, repr); + this->readAttr( "inkscape:color" ); this->readAttr( "inkscape:label" ); this->readAttr( "orientation" ); this->readAttr( "position" ); -- cgit v1.2.3