sd/source/ui/animations/CustomAnimationPane.cxx |   37 +++++++-----------------
 1 file changed, 11 insertions(+), 26 deletions(-)

New commits:
commit 8a1825bf896c8004a10275d93a626e472a52966c
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Jan 31 20:38:22 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Feb 1 09:36:29 2022 +0100

    Revert "tdf#145030 resync with empty selection if we unselected everything"
    
    This reverts commit ba535d8cbda1026823ce9796c20f97b7367d581f.
    
    Change-Id: I277e640c0f8ed0038e8ea867ddeef999a00b7b87
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129242
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx 
b/sd/source/ui/animations/CustomAnimationPane.cxx
index 3fe62f843f15..496b7eedbb42 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -2446,37 +2446,22 @@ void CustomAnimationPane::onSelect()
     if( maSelectionLock.isLocked() )
         return;
 
-    bool bHadSelection = maViewSelection.hasValue();
-    bool bHasSelection = bHadSelection;
+    ScopeLockGuard aGuard( maSelectionLock );
+    DrawViewShell* pViewShell = dynamic_cast< DrawViewShell* >(
+        
FrameworkHelper::Instance(mrBase)->GetViewShell(FrameworkHelper::msCenterPaneURL).get());
+    DrawView* pView = pViewShell ? pViewShell->GetDrawView() : nullptr;
 
+    if( pView )
     {
-        ScopeLockGuard aGuard( maSelectionLock );
-
-        DrawViewShell* pViewShell = dynamic_cast< DrawViewShell* >(
-            
FrameworkHelper::Instance(mrBase)->GetViewShell(FrameworkHelper::msCenterPaneURL).get());
-        DrawView* pView = pViewShell ? pViewShell->GetDrawView() : nullptr;
-
-        if (pView)
+        pView->UnmarkAllObj();
+        for( const CustomAnimationEffectPtr& pEffect : maListSelection )
         {
-            pView->UnmarkAllObj();
-            bHasSelection = false;
-            for( const CustomAnimationEffectPtr& pEffect : maListSelection )
-            {
-                Reference< XShape > xShape( pEffect->getTargetShape() );
-                SdrObject* pObj = SdrObject::getSdrObjectFromXShape(xShape);
-                if (pObj)
-                {
-                    pView->MarkObj(pObj, pView->GetSdrPageView());
-                    bHasSelection = true;
-                }
-            }
+            Reference< XShape > xShape( pEffect->getTargetShape() );
+            SdrObject* pObj = SdrObject::getSdrObjectFromXShape(xShape);
+            if( pObj )
+                pView->MarkObj(pObj, pView->GetSdrPageView());
         }
     }
-
-    // tdf#145030 if we had something selected, but ended up unselecting 
everything
-    // then now while the maSelectionLock is unlocked resync with the empty 
selection
-    if (bHadSelection != bHasSelection)
-        onSelectionChanged();
 }
 
 // ICustomAnimationListController

Reply via email to