summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/selectordialog.cpp
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2019-04-27 11:09:38 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2019-04-27 11:09:38 +0000
commit1d68398ea8e0259b065f2ea19fca411ea75d942f (patch)
treec3e832e95c79652d390f832cc09b899426bd2488 /src/ui/dialog/selectordialog.cpp
parentFixes some crashes when selector is * and allow select multiple tags (diff)
downloadinkscape-1d68398ea8e0259b065f2ea19fca411ea75d942f.tar.gz
inkscape-1d68398ea8e0259b065f2ea19fca411ea75d942f.zip
Fixing coding style
Diffstat (limited to 'src/ui/dialog/selectordialog.cpp')
-rw-r--r--src/ui/dialog/selectordialog.cpp51
1 files changed, 13 insertions, 38 deletions
diff --git a/src/ui/dialog/selectordialog.cpp b/src/ui/dialog/selectordialog.cpp
index b4977d0ee..4847facfb 100644
--- a/src/ui/dialog/selectordialog.cpp
+++ b/src/ui/dialog/selectordialog.cpp
@@ -457,14 +457,8 @@ void SelectorDialog::_readStyleElement()
coltype colType = SELECTOR;
for (auto tok : tokensplus) {
REMOVE_SPACES(tok);
- if (SPAttributeRelSVG::isSVGElement(tok) ||
- tok.find(" ") != -1 ||
- tok[0] == '>' ||
- tok[0] == '+' ||
- tok[0] == '~' ||
- tok[0] == '*' ||
- tok.erase(0, 1).find(".") != -1)
- {
+ if (SPAttributeRelSVG::isSVGElement(tok) || tok.find(" ") != -1 || tok[0] == '>' || tok[0] == '+' ||
+ tok[0] == '~' || tok[0] == '*' || tok.erase(0, 1).find(".") != -1) {
colType = UNHANDLED;
}
}
@@ -801,14 +795,8 @@ std::vector<SPObject *> SelectorDialog::_getObjVec(Glib::ustring selector) {
bool unhandled = false;
for (auto tok : tokensplus) {
REMOVE_SPACES(tok);
- if (SPAttributeRelSVG::isSVGElement(tok) ||
- tok.find(" ") != -1 ||
- tok[0] == '>' ||
- tok[0] == '+' ||
- tok[0] == '~' ||
- tok[0] == '*' ||
- tok.erase(0, 1).find(".") != -1)
- {
+ if (SPAttributeRelSVG::isSVGElement(tok) || tok.find(" ") != -1 || tok[0] == '>' || tok[0] == '+' ||
+ tok[0] == '~' || tok[0] == '*' || tok.erase(0, 1).find(".") != -1) {
unhandled = true;
std::vector<SPObject *> objVecSplited = SP_ACTIVE_DOCUMENT->getObjectsBySelector(tok);
objVec.insert(objVec.end(), objVecSplited.begin(), objVecSplited.end());
@@ -970,33 +958,23 @@ void SelectorDialog::_addSelector()
* set to ".Class1"
*/
selectorValue = textEditPtr->get_text();
-
+
del->set_sensitive(true);
std::vector<Glib::ustring> tokensplus = Glib::Regex::split_simple("[,]+", selectorValue);
bool unhandled = false;
bool partialinvalid = false;
for (auto tok : tokensplus) {
REMOVE_SPACES(tok);
- if (SPAttributeRelSVG::isSVGElement(tok) ||
- tok.find(" ") != -1 ||
- tok[0] == '>' ||
- tok[0] == '+' ||
- tok[0] == '~' ||
- tok[0] == '*' ||
- tok.erase(0, 1).find(".") != -1)
- {
+ if (SPAttributeRelSVG::isSVGElement(tok) || tok.find(" ") != -1 || tok[0] == '>' || tok[0] == '+' ||
+ tok[0] == '~' || tok[0] == '*' || tok.erase(0, 1).find(".") != -1) {
unhandled = true;
Glib::ustring firstWord = tok.substr(0, tok.find_first_of(" >+~"));
if (firstWord != tok) {
handled = false;
}
-
- if (!partialinvalid &&
- (tok[0] == '.' ||
- tok[0] == '#' ||
- tok[0] == '*' ||
- SPAttributeRelSVG::isSVGElement(tok)))
- {
+
+ if (!partialinvalid &&
+ (tok[0] == '.' || tok[0] == '#' || tok[0] == '*' || SPAttributeRelSVG::isSVGElement(tok))) {
partialinvalid = false;
} else {
partialinvalid = true;
@@ -1008,16 +986,13 @@ void SelectorDialog::_addSelector()
if (firstWord != selectorValue) {
handled = false;
}
- if (selectorValue[0] == '.' ||
- selectorValue[0] == '#' ||
- selectorValue[0] == '*' ||
- SPAttributeRelSVG::isSVGElement(selectorValue))
- {
+ if (selectorValue[0] == '.' || selectorValue[0] == '#' || selectorValue[0] == '*' ||
+ SPAttributeRelSVG::isSVGElement(selectorValue)) {
invalid = false;
} else {
textLabelPtr->show();
}
- } else if(partialinvalid) {
+ } else if (partialinvalid) {
textLabelPtr->show();
} else {
invalid = false;