[Libreoffice-commits] core.git: sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 31 11:57:24 UTC 2020
sc/source/ui/view/tabview3.cxx | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
New commits:
commit 9460b6baf392c11091e46105071b7d7b6c4eb1ca
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 31 11:05:38 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Aug 31 13:56:44 2020 +0200
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 at redhat.com>
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
More information about the Libreoffice-commits
mailing list