From 9094351b78c40b8ad59e86fcea438a27f666083b Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 15 Nov 2014 10:24:11 -0800 Subject: Purged SP_STYLE_ELEM/SP_IS_STYLE_ELEM macro abuse. (bzr r13711) --- src/sp-object.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp-object.cpp') diff --git a/src/sp-object.cpp b/src/sp-object.cpp index fcff43aa5..569714bae 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -406,7 +406,7 @@ void SPObject::requestOrphanCollection() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); // do not remove style or script elements (Bug #276244) - if (SP_IS_STYLE_ELEM(this)) { + if (dynamic_cast(this)) { // leave it } else if (SP_IS_SCRIPT(this)) { // leave it -- cgit v1.2.3 From 692ee3551c1a101b16134b0b446ab98231fa4d1f Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 15 Nov 2014 10:37:38 -0800 Subject: Purged GTKish macros SP_SCRIPT/SP_IS_SCRIPT. (bzr r13712) --- src/sp-object.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp-object.cpp') diff --git a/src/sp-object.cpp b/src/sp-object.cpp index 569714bae..024fce85a 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -408,7 +408,7 @@ void SPObject::requestOrphanCollection() { // do not remove style or script elements (Bug #276244) if (dynamic_cast(this)) { // leave it - } else if (SP_IS_SCRIPT(this)) { + } else if (dynamic_cast(this)) { // leave it } else if ((! prefs->getBool("/options/cleanupswatches/value", false)) && SP_IS_PAINT_SERVER(this) && static_cast(this)->isSwatch() ) { -- cgit v1.2.3 From c1e2bbe2ed5d8b7cddd69b80ee20c7d39ab20c44 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Tue, 25 Nov 2014 22:39:57 +0100 Subject: More c++ string usage. (bzr r13763) --- src/sp-object.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/sp-object.cpp') diff --git a/src/sp-object.cpp b/src/sp-object.cpp index 024fce85a..4e45eb824 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -1254,6 +1254,16 @@ void SPObject::setAttribute(gchar const *key, gchar const *value, SPException *e //XML Tree being used here. getRepr()->setAttribute(key, value, false); } +void SPObject::setAttribute(char const *key, Glib::ustring const &value, SPException *ex) +{ + setAttribute(key, value.empty() ? NULL : value.c_str(), ex); +} +void SPObject::setAttribute(Glib::ustring const &key, Glib::ustring const &value, SPException *ex) +{ + setAttribute( key.empty() ? NULL : key.c_str(), + value.empty() ? NULL : value.c_str(), ex); +} + void SPObject::removeAttribute(gchar const *key, SPException *ex) { -- cgit v1.2.3