summaryrefslogtreecommitdiffstats
path: root/src/style-internal.cpp
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-10-18 21:44:39 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-10-18 21:44:39 +0000
commit68136c8b24a6995976db963a790207858e9baba5 (patch)
tree550e81af7c8d626ec80a2be5efec66dd10d84bc4 /src/style-internal.cpp
parentUpdate to experimental r13598 (diff)
parentUpdate to trunk r13621 (diff)
downloadinkscape-68136c8b24a6995976db963a790207858e9baba5.tar.gz
inkscape-68136c8b24a6995976db963a790207858e9baba5.zip
Update to experimental r13619
(bzr r13341.5.18)
Diffstat (limited to 'src/style-internal.cpp')
-rw-r--r--src/style-internal.cpp32
1 files changed, 27 insertions, 5 deletions
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index a55a11403..b858e5cb6 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -964,7 +964,11 @@ SPIPaint::read( gchar const *str ) {
if (!value.href && document) {
// std::cout << " Creating value.href" << std::endl;
value.href = new SPPaintServerReference(document);
- value.href->changedSignal().connect(sigc::bind(sigc::ptr_fun((this == &style->fill)? sp_style_fill_paint_server_ref_changed : sp_style_stroke_paint_server_ref_changed), style));
+ if (this == &style->fill) {
+ style->fill_ps_changed_connection = value.href->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_style_fill_paint_server_ref_changed), style));
+ } else {
+ style->stroke_ps_changed_connection = value.href->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_style_stroke_paint_server_ref_changed), style));
+ }
}
// std::cout << "uri: " << (uri?uri:"null") << std::endl;
@@ -981,7 +985,16 @@ SPIPaint::read( gchar const *str ) {
if (streq(str, "currentColor")) {
set = true;
currentcolor = true;
- setColor( style->color.value.color );
+ if (style) {
+ setColor( style->color.value.color );
+ } else {
+ // Normally an SPIPaint is part of an SPStyle and the value of 'color' is
+ // available. SPIPaint can be used 'stand-alone' (e.g. to parse color values) in
+ // which case a value of 'currentColor' is meaningless, thus we shouldn't reach
+ // here.
+ std::cerr << "SPIPaint::read(): value is 'currentColor' but 'color' not available." << std::endl;
+ setColor( 0 );
+ }
} else if (streq(str, "none")) {
set = true;
noneSet = true;
@@ -1396,11 +1409,20 @@ SPIFilter::read( gchar const *str ) {
set = true;
// Create href if not already done.
- if (!href && style->object) {
- href = new SPFilterReference(style->object);
- href->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_style_filter_ref_changed), style));
+ if (!href) {
+ if (style->object) {
+ href = new SPFilterReference(style->object);
+ }
+ // Do we have href now?
+ if ( href ) {
+ href->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_style_filter_ref_changed), style));
+ } else {
+ std::cerr << "SPIFilter::read(): Could not allocate 'href'" << std::endl;
+ return;
+ }
}
+ // We have href
try {
href->attach(Inkscape::URI(uri));
} catch (Inkscape::BadURIException &e) {