summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e089532)
raw | patch | inline | side by side (parent: e089532)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 23 May 2006 23:00:56 +0000 (23:00 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Tue, 23 May 2006 23:00:56 +0000 (23:00 +0000) |
src/desktop-style.cpp | patch | blob | history |
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp
index fa900600d1f72eeca15fe1c9d5717230c938868d..c9989df275b0751f10263cf841e7ded0a656053b 100644 (file)
--- a/src/desktop-style.cpp
+++ b/src/desktop-style.cpp
css = sp_desktop_get_style(desktop, true);
} else {
Inkscape::XML::Node *tool_repr = inkscape_get_repr(INKSCAPE, tool);
- css = sp_repr_css_attr_inherited(tool_repr, "style");
+ if (tool_repr) {
+ css = sp_repr_css_attr_inherited(tool_repr, "style");
+ }
}
- gchar const *property = css ? sp_repr_css_property(css, "opacity", "1.000") : 0;
+ if (css) {
+ gchar const *property = css ? sp_repr_css_property(css, "opacity", "1.000") : 0;
- if (desktop->current && property) { // if there is style and the property in it,
- if ( !sp_svg_number_read_f(property, &value) ) {
- value = 1.0; // things failed. set back to the default
+ if (desktop->current && property) { // if there is style and the property in it,
+ if ( !sp_svg_number_read_f(property, &value) ) {
+ value = 1.0; // things failed. set back to the default
+ }
}
- }
- if (css) {
sp_repr_css_attr_unref(css);
}
@@ -256,18 +258,20 @@ sp_desktop_get_opacity_tool(SPDesktop *desktop, char const *tool, bool is_fill)
css = sp_desktop_get_style(desktop, true);
} else {
Inkscape::XML::Node *tool_repr = inkscape_get_repr(INKSCAPE, tool);
- css = sp_repr_css_attr_inherited(tool_repr, "style");
+ if (tool_repr) {
+ css = sp_repr_css_attr_inherited(tool_repr, "style");
+ }
}
- gchar const *property = css ? sp_repr_css_property(css, is_fill ? "fill-opacity": "stroke-opacity", "1.000") : 0;
+ if (css) {
+ gchar const *property = css ? sp_repr_css_property(css, is_fill ? "fill-opacity": "stroke-opacity", "1.000") : 0;
- if (desktop->current && property) { // if there is style and the property in it,
- if ( !sp_svg_number_read_f(property, &value) ) {
- value = 1.0; // things failed. set back to the default
+ if (desktop->current && property) { // if there is style and the property in it,
+ if ( !sp_svg_number_read_f(property, &value) ) {
+ value = 1.0; // things failed. set back to the default
+ }
}
- }
- if (css) {
sp_repr_css_attr_unref(css);
}
css = sp_desktop_get_style(desktop, true);
} else {
Inkscape::XML::Node *tool_repr = inkscape_get_repr(INKSCAPE, tool);
- css = sp_repr_css_attr_inherited(tool_repr, "style");
+ if (tool_repr) {
+ css = sp_repr_css_attr_inherited(tool_repr, "style");
+ }
}
- gchar const *property = sp_repr_css_property(css, is_fill ? "fill" : "stroke", "#000");
+ if (css) {
+ gchar const *property = sp_repr_css_property(css, is_fill ? "fill" : "stroke", "#000");
- if (desktop->current && property) { // if there is style and the property in it,
- if (strncmp(property, "url", 3)) { // and if it's not url,
- // read it
- r = sp_svg_read_color(property, r);
+ if (desktop->current && property) { // if there is style and the property in it,
+ if (strncmp(property, "url", 3)) { // and if it's not url,
+ // read it
+ r = sp_svg_read_color(property, r);
+ }
}
- }
- if (css) {
sp_repr_css_attr_unref(css);
}