From fe2e3fdfc7a546795e4a7221300aefd96d05f215 Mon Sep 17 00:00:00 2001 From: kamalpreetgrewal Date: Tue, 19 Jul 2016 16:57:19 +0530 Subject: Update XML correctly when editing properties (bzr r14949.1.55) --- src/ui/dialog/styledialog.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/ui/dialog/styledialog.cpp') diff --git a/src/ui/dialog/styledialog.cpp b/src/ui/dialog/styledialog.cpp index efbde1767..99d5cd7e1 100644 --- a/src/ui/dialog/styledialog.cpp +++ b/src/ui/dialog/styledialog.cpp @@ -799,7 +799,7 @@ void StyleDialog::_handleEdited(const Glib::ustring& path, const Glib::ustring& if (key == matchSelector) { std::stringstream ss(value); - std::string token; + std::string token, editedToken; std::size_t found = value.find(";"); if (found!=std::string::npos) { while(std::getline(ss, token, ';')) { @@ -807,12 +807,11 @@ void StyleDialog::_handleEdited(const Glib::ustring& path, const Glib::ustring& if (!token.empty()) { if (token.substr(0, token.find(":")) == _cssPane ->_editedProp.substr(0, _cssPane->_editedProp - .find(":"))) - { - token = _cssPane->_editedProp; - value.clear(); - value += token + ";"; - (*it).second = key + " { " + value + " }\n"; + .find(":"))) { + editedToken = _cssPane->_editedProp; + size_t startPos = value.find(token); + value.replace(startPos, token.length(), editedToken); + (*it).second = key + "{" + value + "}\n"; _updateStyleContent(); } } -- cgit v1.2.3