diff options
| author | su_v <suv-sf@users.sourceforge.net> | 2012-09-23 17:24:25 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2012-09-23 17:24:25 +0000 |
| commit | ac16411f213f98407fc42c1d04eb4ae6c187e4a6 (patch) | |
| tree | b8fd94caee6b202043810a7366ab3f032882a48f /src/style.cpp | |
| parent | add newly linked-in m4 files to .bzrignore (diff) | |
| parent | Fix for 170395 : Add Trace Bitmap to context menu of images : Focus fix (diff) | |
| download | inkscape-ac16411f213f98407fc42c1d04eb4ae6c187e4a6.tar.gz inkscape-ac16411f213f98407fc42c1d04eb4ae6c187e4a6.zip | |
merge from trunk (r11698)
(bzr r11668.1.10)
Diffstat (limited to 'src/style.cpp')
| -rw-r--r-- | src/style.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/style.cpp b/src/style.cpp index ba720d538..ab8b646aa 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -3892,10 +3892,9 @@ sp_style_write_istring(gchar *p, gint const len, gchar const *const key, if (val->inherit) { res = g_snprintf(p, len, "%s:inherit;", key); } else { - gchar *val_quoted = css2_escape_quote(val->value); - if (val_quoted) { - res = g_snprintf(p, len, "%s:%s;", key, val_quoted); - g_free (val_quoted); + Glib::ustring val_quoted = css2_escape_quote(val->value); + if (~val_quoted.empty()) { + res = g_snprintf(p, len, "%s:%s;", key, val_quoted.c_str()); } } } @@ -4712,8 +4711,7 @@ attribute_unquote(gchar const *val) /** * Quote and/or escape string for writing to CSS (style=). Returned value must be g_free'd. */ -gchar * -css2_escape_quote(gchar const *val) { +Glib::ustring css2_escape_quote(gchar const *val) { Glib::ustring t; bool quote = false; @@ -4757,7 +4755,7 @@ css2_escape_quote(gchar const *val) { t.push_back('\''); } - return (t.empty() ? NULL : g_strdup (t.c_str())); + return t; } /* |
