From 451210ce988fb6e6964bd4869f74ffa7fb2c462d Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 15 Aug 2013 21:13:44 +0200 Subject: Prevent writing out empty style strings. (bzr r12481) --- src/attribute-rel-util.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/attribute-rel-util.cpp') diff --git a/src/attribute-rel-util.cpp b/src/attribute-rel-util.cpp index 933339632..15c71daa7 100644 --- a/src/attribute-rel-util.cpp +++ b/src/attribute-rel-util.cpp @@ -141,7 +141,11 @@ void sp_attribute_clean_style(Node *repr, unsigned int flags) { // sp_repr_css_set( repr, css, "style"); // Don't use as it will cause loop. Glib::ustring value; sp_repr_css_write_string(css, value); - repr->setAttribute("style", value.c_str()); + if( value.empty() ) { + repr->setAttribute("style", NULL ); + } else { + repr->setAttribute("style", value.c_str()); + } sp_repr_css_attr_unref( css ); } -- cgit v1.2.3