summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkamalpreetgrewal <grewalkamal005@gmail.com>2016-08-19 07:53:45 +0000
committerkamalpreetgrewal <grewalkamal005@gmail.com>2016-08-19 07:53:45 +0000
commit0cb42f2ea44a9d5da0c3a3ff5cca6fa82511d81b (patch)
tree9e646bad379857178b4b329627993d1837a75f4e /src
parentComplete passing of test to add ID selectors (diff)
downloadinkscape-0cb42f2ea44a9d5da0c3a3ff5cca6fa82511d81b.tar.gz
inkscape-0cb42f2ea44a9d5da0c3a3ff5cca6fa82511d81b.zip
Pass remaining simple class selector tests
(bzr r14949.1.74)
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/styledialog.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/src/ui/dialog/styledialog.cpp b/src/ui/dialog/styledialog.cpp
index e9b00bf1c..878ab1926 100644
--- a/src/ui/dialog/styledialog.cpp
+++ b/src/ui/dialog/styledialog.cpp
@@ -671,11 +671,14 @@ void StyleDialog::_selAdd(Gtk::TreeModel::Row row)
obj->setAttribute("class", key.erase(0,1));
}
else {
- obj->setAttribute("class", std::string
- (obj->getRepr()->
- attribute("class"))
- + " " + key
- .erase(0,1));
+ if (obj->getRepr()->attribute("class") != key
+ .erase(0,1)) {
+ obj->setAttribute("class", std::string
+ (obj->getRepr()->
+ attribute("class"))
+ + " " + key
+ .erase(0,1));
+ }
}
}
}
@@ -708,21 +711,23 @@ void StyleDialog::_selAdd(Gtk::TreeModel::Row row)
REMOVE_SPACES(matchSelector);
if (key == matchSelector) {
REMOVE_SPACES((*it)._selector);
- if ("#" + std::string(obj->getId()) != selectorName) {
- inkSelector._selector = (*it)._selector;
- inkSelector._selector.append(", #" + std::string(obj->getId()));
- inkSelector._xmlContent = inkSelector._selector + "{" + value + "}\n";
- row[_mColumns._selectorLabel] = selectorName + ", " +
- childrow[_mColumns._selectorLabel];
+ if (selectorName[0] == '#') {
+ if ("#" + std::string(obj->getId()) != selectorName) {
+ inkSelector._selector = (*it)._selector;
+ inkSelector._selector.append(", #" + std::string(obj->getId()));
+ inkSelector._xmlContent = inkSelector._selector + "{" + value + "}\n";
+ row[_mColumns._selectorLabel] = selectorName + ", " +
+ childrow[_mColumns._selectorLabel];
+ }
+ }
+ else if (selectorName[0] == '.') {
+ inkSelector._xmlContent = (*it)._selector + "{" + value + "}\n";
}
+
it = _selectorVec.erase(it);
it = _selectorVec.insert(it, inkSelector);
}
}
-
-// if (selectorName[0] == '.') {
-// inkSelector._xmlContent = "";
-// }
}
if (_styleElementNode()) {
_styleChild = _styleElementNode();