diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-10-11 15:09:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-10-11 18:22:06 +0200 |
commit | ba535d8cbda1026823ce9796c20f97b7367d581f (patch) | |
tree | 1072ff621b29d58a161d99041a19746a95027c76 /sd | |
parent | 83cadf937ff9a0fd4ca24627673d45d1bab8c914 (diff) |
tdf#145030 resync with empty selection if we unselected everything
if we had something selected, but ended up unselecting everything then
while the maSelectionLock is unlocked resync with the empty selection
(git show -w)
Change-Id: Idf3ad1ce93e4dcf94dc79332cbb431dc5d896988
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123420
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.cxx | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 77850c52b887..a125838a07d5 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -2443,22 +2443,37 @@ void CustomAnimationPane::onSelect() if( maSelectionLock.isLocked() ) return; - ScopeLockGuard aGuard( maSelectionLock ); - DrawViewShell* pViewShell = dynamic_cast< DrawViewShell* >( - FrameworkHelper::Instance(mrBase)->GetViewShell(FrameworkHelper::msCenterPaneURL).get()); - DrawView* pView = pViewShell ? pViewShell->GetDrawView() : nullptr; + bool bHadSelection = maViewSelection.hasValue(); + bool bHasSelection = bHadSelection; - if( pView ) { - pView->UnmarkAllObj(); - for( const CustomAnimationEffectPtr& pEffect : maListSelection ) + ScopeLockGuard aGuard( maSelectionLock ); + + DrawViewShell* pViewShell = dynamic_cast< DrawViewShell* >( + FrameworkHelper::Instance(mrBase)->GetViewShell(FrameworkHelper::msCenterPaneURL).get()); + DrawView* pView = pViewShell ? pViewShell->GetDrawView() : nullptr; + + if (pView) { - Reference< XShape > xShape( pEffect->getTargetShape() ); - SdrObject* pObj = SdrObject::getSdrObjectFromXShape(xShape); - if( pObj ) - pView->MarkObj(pObj, pView->GetSdrPageView()); + 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; + } + } } } + + // 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 |