Gui: avoid unecessary visibility change when update view provider
This patch prevents syncing DocumentObject::Visibility when view provider hides itself before updating. Some object may have additional logic based on object visibility change. For example, GroupExtension monitors its children visibility for exporting, and propgate changes to upper hierarchy.
This commit is contained in:
@@ -145,7 +145,12 @@ void ViewProviderGroupExtension::extensionHide(void) {
|
||||
|
||||
// when reading the Visibility property from file then do not hide the
|
||||
// objects of this group because they have stored their visibility status, too
|
||||
if (!getExtendedViewProvider()->isRestoring()) {
|
||||
//
|
||||
// Property::User1 is used by ViewProviderDocumentObject to mark for
|
||||
// temporary visibility changes. Do not propagate the change to children.
|
||||
if (!getExtendedViewProvider()->isRestoring()
|
||||
&& !getExtendedViewProvider()->Visibility.testStatus(App::Property::User1))
|
||||
{
|
||||
auto* group = getExtendedViewProvider()->getObject()->getExtensionByType<App::GroupExtension>();
|
||||
for(auto obj : group->Group.getValues()) {
|
||||
if(obj && obj->Visibility.getValue())
|
||||
|
||||
Reference in New Issue
Block a user