diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-04-27 11:09:38 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-04-27 11:09:38 +0000 |
| commit | 1d68398ea8e0259b065f2ea19fca411ea75d942f (patch) | |
| tree | c3e832e95c79652d390f832cc09b899426bd2488 /src | |
| parent | Fixes some crashes when selector is * and allow select multiple tags (diff) | |
| download | inkscape-1d68398ea8e0259b065f2ea19fca411ea75d942f.tar.gz inkscape-1d68398ea8e0259b065f2ea19fca411ea75d942f.zip | |
Fixing coding style
Diffstat (limited to 'src')
| -rw-r--r-- | src/selection-describer.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/selectordialog.cpp | 51 | ||||
| -rw-r--r-- | src/widgets/stroke-style.cpp | 4 |
3 files changed, 16 insertions, 41 deletions
diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index 212ec9cf7..b3250ffbd 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -139,7 +139,7 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select // Parent name SPObject *parent = item->parent; - if (!parent) { //fix selector * to "svg:svg" + if (!parent) { // fix selector * to "svg:svg" return; } gchar const *parent_label = parent->getId(); 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; diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index 5bd1b5d8d..48f0e3d78 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -952,8 +952,8 @@ StrokeStyle::updateLine() std::vector<SPItem*> const objects(sel->items().begin(), sel->items().end()); if (objects.size()) { - SPObject * const object = objects[0]; - SPStyle * const style = object->style; + SPObject *const object = objects[0]; + SPStyle *const style = object->style; /* Markers */ updateAllMarkers(objects, true); // FIXME: make this desktop query too |
