Kaydet (Commit) f2466b91 authored tarafından Caolán McNamara's avatar Caolán McNamara

tdf#124975 changing the clipboard selection clears the widget selection

gtk listens to the selection so realizes that the GtkEntry selection
is not the desktop selection anymore and drops the visual selection.

But we're relying on the visual selection to know what part of
a multiselection we are modifying

Change-Id: I42d5718ba029b4f94c436cb755485d05511b5708
Reviewed-on: https://gerrit.libreoffice.org/71576
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 37874c29
......@@ -165,6 +165,8 @@ void ScSimpleRefDlg::RefInputDone( bool bForced)
IMPL_LINK_NOARG(ScSimpleRefDlg, OkBtnHdl, weld::Button&, void)
{
if (IsClosing())
return;
bAutoReOpen = false;
OUString aResult=m_xEdAssign->GetText();
aCloseHdl.Call(&aResult);
......@@ -175,6 +177,8 @@ IMPL_LINK_NOARG(ScSimpleRefDlg, OkBtnHdl, weld::Button&, void)
IMPL_LINK_NOARG(ScSimpleRefDlg, CancelBtnHdl, weld::Button&, void)
{
if (IsClosing())
return;
bAutoReOpen = false;
OUString aResult=m_xEdAssign->GetText();
aCloseHdl.Call(nullptr);
......
......@@ -64,6 +64,7 @@
#include <AccessibilityHints.hxx>
#include <rangeutl.hxx>
#include <client.hxx>
#include <simpref.hxx>
#include <tabprotection.hxx>
#include <markdata.hxx>
#include <formula/FormulaCompiler.hxx>
......@@ -436,6 +437,22 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
}
}
static bool lcl_IsScSimpleRefDlgOpen(SfxViewFrame* pViewFrm)
{
if (pViewFrm->HasChildWindow(WID_SIMPLE_REF))
{
SfxChildWindow* pChild = pViewFrm->GetChildWindow(WID_SIMPLE_REF);
if (pChild)
{
auto xDlgController = pChild->GetController();
if (xDlgController && xDlgController->getDialog()->get_visible())
return true;
}
}
return false;
}
void ScTabView::CheckSelectionTransfer()
{
if ( aViewData.IsActive() ) // only for active view
......@@ -451,7 +468,12 @@ void ScTabView::CheckSelectionTransfer()
pOld->ForgetView();
pScMod->SetSelectionTransfer( pNew.get() );
pNew->CopyToSelection( GetActiveWin() ); // may delete pOld
// tdf#124975 changing the calc selection can trigger removal of the
// selection of an open ScSimpleRefDlg dialog, so don't inform the
// desktop clipboard of the changed selection if that dialog is open
if (!lcl_IsScSimpleRefDlgOpen(aViewData.GetViewShell()->GetViewFrame()))
pNew->CopyToSelection( GetActiveWin() ); // may delete pOld
// Log the selection change
ScMarkData& rMark = aViewData.GetMarkData();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment