Gui: clean-up Selection API

Replace the int of the 'resolve' argument of several functions with a proper enum class.
* This avoids the inconsistencies in client code where often true/false is passed when an int is expected
* This avoids the use of magic numbers like 0, 1, 2 or the undocumented 3
This commit is contained in:
wmayer
2022-04-09 17:03:43 +02:00
parent 2d266a75cd
commit 0b2c73cf32
24 changed files with 365 additions and 274 deletions

View File

@@ -90,7 +90,7 @@ Gui::ActiveObjectList::ObjectInfo Gui::ActiveObjectList::getObjectInfo(App::Docu
// If the input object is not from this document, it must be brought in
// by some link type object of this document. We only accept the object
// if we can find such object in the current selection.
auto sels = Gui::Selection().getSelection(_Doc->getDocument()->getName(),false);
auto sels = Gui::Selection().getSelection(_Doc->getDocument()->getName(), ResolveMode::NoResolve);
for (auto &sel : sels) {
if (sel.pObject == obj || sel.pObject->getLinkedObject(true)==obj) {
info.obj = sel.pObject;