diff options
| author | Liam P. White <inkscapebronyat-signgmaildotcom> | 2014-03-19 01:21:00 +0000 |
|---|---|---|
| committer | Liam P. White <inkscapebronyat-signgmaildotcom> | 2014-03-19 01:21:00 +0000 |
| commit | 255dd5fcfd51a58d04aff8e119a2fa08cf5f71cb (patch) | |
| tree | 1f8c63d7d2bf86c01f2372b47c7afb5e6dc24339 /src/preferences.cpp | |
| parent | Added in new toy effect "Taper Strokes," readded a missing header file, bugfixes (diff) | |
| parent | Fix for Bug #1291546 (Linking color profile from Document properties dialog c... (diff) | |
| download | inkscape-255dd5fcfd51a58d04aff8e119a2fa08cf5f71cb.tar.gz inkscape-255dd5fcfd51a58d04aff8e119a2fa08cf5f71cb.zip | |
Update to trunk/Fix GTK3 build errors
(bzr r13090.1.26)
Diffstat (limited to 'src/preferences.cpp')
| -rw-r--r-- | src/preferences.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/preferences.cpp b/src/preferences.cpp index b4b873dc8..2fec3b307 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -438,9 +438,7 @@ void Preferences::setBool(Glib::ustring const &pref_path, bool value) */ void Preferences::setInt(Glib::ustring const &pref_path, int value) { - gchar intstr[32]; - g_snprintf(intstr, 32, "%d", value); - _setRawValue(pref_path, intstr); + _setRawValue(pref_path, Glib::ustring::compose("%1",value)); } /** @@ -451,9 +449,7 @@ void Preferences::setInt(Glib::ustring const &pref_path, int value) */ void Preferences::setDouble(Glib::ustring const &pref_path, double value) { - gchar buf[G_ASCII_DTOSTR_BUF_SIZE]; - g_ascii_dtostr(buf, G_ASCII_DTOSTR_BUF_SIZE, value); - _setRawValue(pref_path, buf); + _setRawValue(pref_path, Glib::ustring::compose("%1",value)); } /** @@ -465,11 +461,8 @@ void Preferences::setDouble(Glib::ustring const &pref_path, double value) */ void Preferences::setDoubleUnit(Glib::ustring const &pref_path, double value, Glib::ustring const &unit_abbr) { - gchar buf[G_ASCII_DTOSTR_BUF_SIZE]; - g_ascii_dtostr(buf, G_ASCII_DTOSTR_BUF_SIZE, value); - Glib::ustring str(buf); - str += unit_abbr; - _setRawValue(pref_path, str.c_str()); + Glib::ustring str = Glib::ustring::compose("%1%2",value,unit_abbr); + _setRawValue(pref_path, str); } void Preferences::setColor(Glib::ustring const &pref_path, guint32 value) @@ -487,14 +480,14 @@ void Preferences::setColor(Glib::ustring const &pref_path, guint32 value) */ void Preferences::setString(Glib::ustring const &pref_path, Glib::ustring const &value) { - _setRawValue(pref_path, value.c_str()); + _setRawValue(pref_path, value); } void Preferences::setStyle(Glib::ustring const &pref_path, SPCSSAttr *style) { Glib::ustring css_str; sp_repr_css_write_string(style, css_str); - _setRawValue(pref_path, css_str.c_str()); + _setRawValue(pref_path, css_str); } void Preferences::mergeStyle(Glib::ustring const &pref_path, SPCSSAttr *style) @@ -503,7 +496,7 @@ void Preferences::mergeStyle(Glib::ustring const &pref_path, SPCSSAttr *style) sp_repr_css_merge(current, style); Glib::ustring css_str; sp_repr_css_write_string(current, css_str); - _setRawValue(pref_path, css_str.c_str()); + _setRawValue(pref_path, css_str); sp_repr_css_attr_unref(current); } @@ -738,7 +731,7 @@ void Preferences::_getRawValue(Glib::ustring const &path, gchar const *&result) } } -void Preferences::_setRawValue(Glib::ustring const &path, gchar const *value) +void Preferences::_setRawValue(Glib::ustring const &path, Glib::ustring const &value) { // create node and attribute keys Glib::ustring node_key, attr_key; @@ -746,7 +739,7 @@ void Preferences::_setRawValue(Glib::ustring const &path, gchar const *value) // set the attribute Inkscape::XML::Node *node = _getNode(node_key, true); - node->setAttribute(attr_key.c_str(), value); + node->setAttribute(attr_key.c_str(), value.c_str()); } // The _extract* methods are where the actual wrok is done - they define how preferences are stored |
