diff --git a/src/Gui/ExpressionCompleter.cpp b/src/Gui/ExpressionCompleter.cpp index 2451c9c27e..face8d1a39 100644 --- a/src/Gui/ExpressionCompleter.cpp +++ b/src/Gui/ExpressionCompleter.cpp @@ -253,7 +253,7 @@ public: return result; } - // The completion tree structure created takes into account the current document and object + // The completion tree structure created takes into account the current document and object // // It is done as such: // * root (-1,-1) @@ -284,8 +284,9 @@ public: App::Property* prop = nullptr; // check if the document is uniquely identified: either the correct index in info.doc // OR if, the node is a descendant of the root, its row lands within 0...docsize - if(idx>=0 && idx=0 && idx0, ROOT_info) // objSize and propSize will be zero because of the early exit above *count = docSize + objSize + propSize; + } if(idx>=0 && v) { // we're asking for this child's data, and IT's NOT THE ROOT QString res; // we resolved the property - if (propName) - { + if (propName) { res = QString::fromLatin1(propName); // resolve the property if (sep && !noProperty && retrieveSubPaths(prop).size() != 0) @@ -360,7 +361,8 @@ public: res = QString::fromLatin1(obj->getNameInDocument()); if(sep && !noProperty) res += QLatin1Char('.'); - } else { + } + else { // the document has been resolved, use the saved idx to figure out quotation or not. if(idx & 1) res = QString::fromUtf8(quote(doc->Label.getStrValue()).c_str());