summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/view/tabview3.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index cfff46935dad..cc955f408503 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -444,11 +444,16 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
}
}
-static bool lcl_IsScSimpleRefDlgOpen(SfxViewFrame* pViewFrm)
+static bool lcl_IsRefDlgOpen(SfxViewFrame* pViewFrm)
{
- if (pViewFrm->HasChildWindow(WID_SIMPLE_REF))
+ ScModule* pScMod = SC_MOD();
+ if (!pScMod->IsRefDialogOpen())
+ return false;
+
+ auto nDlgId = pScMod->GetCurRefDlgId();
+ if (pViewFrm->HasChildWindow(nDlgId))
{
- SfxChildWindow* pChild = pViewFrm->GetChildWindow(WID_SIMPLE_REF);
+ SfxChildWindow* pChild = pViewFrm->GetChildWindow(nDlgId);
if (pChild)
{
auto xDlgController = pChild->GetController();
@@ -476,10 +481,10 @@ void ScTabView::CheckSelectionTransfer()
pScMod->SetSelectionTransfer( pNew.get() );
- // tdf#124975 changing the calc selection can trigger removal of the
- // selection of an open ScSimpleRefDlg dialog, so don't inform the
+ // 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_IsScSimpleRefDlgOpen(aViewData.GetViewShell()->GetViewFrame()))
+ if (!lcl_IsRefDlgOpen(aViewData.GetViewShell()->GetViewFrame()))
pNew->CopyToSelection( GetActiveWin() ); // may delete pOld
// Log the selection change