diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-09-02 19:32:59 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-09-02 19:32:59 +0000 |
| commit | fd0a5dfa4cb237f8e5232c785693cc3e676336e8 (patch) | |
| tree | 74bc967114726b2e9b87ba2439cdbfed03549dde /src/extension/dbus/document-interface.cpp | |
| parent | performance: ?? (diff) | |
| download | inkscape-fd0a5dfa4cb237f8e5232c785693cc3e676336e8.tar.gz inkscape-fd0a5dfa4cb237f8e5232c785693cc3e676336e8.zip | |
converted some c-string usage to c++ string class usage: should fix some memory leaks
(bzr r11646)
Diffstat (limited to '')
| -rw-r--r-- | src/extension/dbus/document-interface.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp index c67234b34..706215573 100644 --- a/src/extension/dbus/document-interface.cpp +++ b/src/extension/dbus/document-interface.cpp @@ -226,7 +226,9 @@ gchar *finish_create_shape (DocumentInterface *object, GError ** /*error*/, Inks SPCSSAttr *style = sp_desktop_get_style(object->desk, TRUE); if (style) { - newNode->setAttribute("style", sp_repr_css_write_string(style), TRUE); + Glib::ustring str; + sp_repr_css_write_string(style, str); + newNode->setAttribute("style", str.c_str(), TRUE); } else { newNode->setAttribute("style", "fill:#0000ff;fill-opacity:1;stroke:#c900b9;stroke-width:0;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none", TRUE); @@ -565,7 +567,7 @@ gchar *document_interface_node(DocumentInterface *object, gchar *type, GError ** } /**************************************************************************** - ENVIORNMENT FUNCTIONS + ENVIRONMENT FUNCTIONS ****************************************************************************/ gdouble document_interface_document_get_width (DocumentInterface *object) @@ -582,7 +584,9 @@ document_interface_document_get_height (DocumentInterface *object) gchar *document_interface_document_get_css(DocumentInterface *object, GError ** /*error*/) { SPCSSAttr *current = (object->desk)->current; - return sp_repr_css_write_string(current); + glib::ustring str; + sp_repr_css_write_string(current, str); + return (str.empty() ? NULL : g_strdup (str.c_str())); } gboolean document_interface_document_merge_css(DocumentInterface *object, |
