Gui: fix several compiler warnings

This commit is contained in:
wmayer
2023-01-25 12:55:56 +01:00
committed by Uwe
parent 7b8c6335a3
commit 95444519dc

View File

@@ -450,7 +450,7 @@ public:
}
// 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;
}
@@ -523,12 +523,13 @@ public:
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) {
@@ -537,9 +538,9 @@ public:
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]