summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-08-31 11:05:38 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-08-31 13:56:44 +0200
commit9460b6baf392c11091e46105071b7d7b6c4eb1ca (patch)
tree9508fd31733fa5c44d1287dbc429df1b780ed296
parent82f591a2ec06c680daf41628fe4c352b6a55d545 (diff)
Related: tdf#136242 should only matter input ref mode is active
Change-Id: I50a64ae18e6f0d5b4544c9b7b0111ba149385177 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101704 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/ui/view/tabview3.cxx27
1 files changed, 14 insertions, 13 deletions
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 2a5fec98d85b..981b127b86ae 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -444,25 +444,26 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
SfxLokHelper::notifyDocumentSizeChanged(aViewData.GetViewShell(), sSize, pModel, false);
}
-static bool lcl_IsRefDlgOpen(SfxViewFrame* pViewFrm)
+static bool lcl_IsRefDlgActive(SfxViewFrame* pViewFrm)
{
ScModule* pScMod = SC_MOD();
if (!pScMod->IsRefDialogOpen())
return false;
auto nDlgId = pScMod->GetCurRefDlgId();
- if (pViewFrm->HasChildWindow(nDlgId))
- {
- SfxChildWindow* pChild = pViewFrm->GetChildWindow(nDlgId);
- if (pChild)
- {
- auto xDlgController = pChild->GetController();
- if (xDlgController && xDlgController->getDialog()->get_visible())
- return true;
- }
- }
+ if (!pViewFrm->HasChildWindow(nDlgId))
+ return false;
- return false;
+ SfxChildWindow* pChild = pViewFrm->GetChildWindow(nDlgId);
+ if (!pChild)
+ return false;
+
+ auto xDlgController = pChild->GetController();
+ if (!xDlgController || !xDlgController->getDialog()->get_visible())
+ return false;
+
+ IAnyRefDialog* pRefDlg = dynamic_cast<IAnyRefDialog*>(xDlgController.get());
+ return pRefDlg && pRefDlg->IsRefInputMode();
}
void ScTabView::CheckSelectionTransfer()
@@ -486,7 +487,7 @@ void ScTabView::CheckSelectionTransfer()
// tdf#124975/tdf#136242 changing the calc selection can trigger removal of the
// selection of an open RefDlg dialog, so don't inform the
// desktop clipboard of the changed selection if that dialog is open
- if (!lcl_IsRefDlgOpen(aViewData.GetViewShell()->GetViewFrame()))
+ if (!lcl_IsRefDlgActive(aViewData.GetViewShell()->GetViewFrame()))
pNew->CopyToSelection( GetActiveWin() ); // may delete pOld
// Log the selection change