summaryrefslogtreecommitdiffstats
path: root/src/style-internal.cpp
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2014-10-14 03:01:31 +0000
committer~suv <suv-sf@users.sourceforge.net>2014-10-14 03:01:31 +0000
commit1d2cec18d1038150b6511454a2fbb2b3cb6d36f8 (patch)
tree38aeab42635a7ebfa0b87394e42d8bebbcdc7ce6 /src/style-internal.cpp
parentupdate to trunk (r13586) (diff)
parent2geom: Re-fix IS_NAN and IS_FINITE for solaris (diff)
downloadinkscape-1d2cec18d1038150b6511454a2fbb2b3cb6d36f8.tar.gz
inkscape-1d2cec18d1038150b6511454a2fbb2b3cb6d36f8.zip
update to trunk (r13610)
(bzr r13506.1.112)
Diffstat (limited to 'src/style-internal.cpp')
-rw-r--r--src/style-internal.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index a55a11403..a81a2799d 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -981,7 +981,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 +1405,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) {