summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkamalpreetgrewal <grewalkamal005@gmail.com>2016-07-19 11:27:19 +0000
committerkamalpreetgrewal <grewalkamal005@gmail.com>2016-07-19 11:27:19 +0000
commitfe2e3fdfc7a546795e4a7221300aefd96d05f215 (patch)
treedc45886c61752bf1c57449181a5e9a732579b949 /src
parentUpdate XML & hence drawing when properties are edited in CSS panel (diff)
downloadinkscape-fe2e3fdfc7a546795e4a7221300aefd96d05f215.tar.gz
inkscape-fe2e3fdfc7a546795e4a7221300aefd96d05f215.zip
Update XML correctly when editing properties
(bzr r14949.1.55)
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/styledialog.cpp13
1 files changed, 6 insertions, 7 deletions
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();
}
}