Skip to content

Commit

Permalink
Gui: fix several compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer authored and donovaly committed Jan 25, 2023
1 parent 9374155 commit 0f694c3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Gui/ExpressionCompleter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ class ExpressionCompleterModel: public QAbstractItemModel {
}

// check to see if this is a valid path
if (idx < 0 || idx >= paths.size()) {
if (idx < 0 || idx >= static_cast<int>(paths.size())) {
return;
}

Expand Down Expand Up @@ -523,12 +523,13 @@ class ExpressionCompleterModel: public QAbstractItemModel {
if (parentInfo.doc < 0) {
// need special casing to properly identify this model's object
const auto& docs = App::GetApplication().getDocuments();
auto docsSize = static_cast<int>(docs.size()*2);

info.doc = element.row();

// if my element is a contextual descendant of root (current doc object list, current object prop list)
// mark it as such
if (element.row() >= docs.size()*2) {
if (element.row() >= docsSize) {
info.contextualHierarchy = 1;
}
} else if (parentInfo.contextualHierarchy) {
Expand All @@ -537,9 +538,9 @@ class ExpressionCompleterModel: public QAbstractItemModel {
auto cdoc = App::GetApplication().getDocument(currentDoc.c_str());

if (cdoc) {
auto objsSize = cdoc->getObjects().size()*2;
auto objsSize = static_cast<int>(cdoc->getObjects().size()*2);
int idx = parentInfo.doc - docs.size();
if (idx < cdoc->getObjects().size()*2) {
if (idx < objsSize) {
// |-- Parent (OBJECT) - (row 4, [-1,-1,-1,0]) = encode as element => [parent.row,-1,-1,1]
// |- element (PROP) - (row 0, [parent.row,-1,-1,1]) = encode as element => [parent.row,-1,parent.row,1]

Expand Down

0 comments on commit 0f694c3

Please sign in to comment.