include/sfx2/basedlgs.hxx                |    2 +-
 sc/source/ui/dbgui/PivotLayoutDialog.cxx |    3 ++-
 sfx2/source/dialog/basedlgs.cxx          |    7 +++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 333ad127b915e6d318df4eef4f30f9231b5f8a95
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Jan 24 15:46:50 2022 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Jan 25 16:38:29 2022 +0100

    tdf#146571 Ignore focus changes after closing Manage changes dialog
    
    Change-Id: Ib588310410a265acdd129a8e51adf56bb5973bd9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128869
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128823
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 2d32406e4de9..39b5df4115c2 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -48,7 +48,7 @@ public:
 
     // when the dialog has an associated SfxChildWin, typically for Modeless 
interaction
     virtual void ChildWinDispose() {} // called from the associated 
SfxChildWin dtor
-    virtual void Close() {} // called by the SfxChildWin when the dialog is 
closed
+    virtual void Close(); // called by the SfxChildWin when the dialog is 
closed
     virtual void EndDialog(); // called by the SfxChildWin to close the dialog
 };
 
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx 
b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 39357771105d..a496b9a6efb4 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -627,7 +627,8 @@ void 
ScPivotLayoutDialog::PushDataFieldNames(std::vector<ScDPName>& rDataFieldNa
 
 void ScPivotLayoutDialog::Close()
 {
-    DoClose( ScPivotLayoutWrapper::GetChildWindowId() );
+    DoClose(ScPivotLayoutWrapper::GetChildWindowId());
+    SfxDialogController::Close();
 }
 
 IMPL_LINK_NOARG( ScPivotLayoutDialog, OKClicked, weld::Button&, void )
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 1f10f73ce5e4..190fea086ba9 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -197,6 +197,7 @@ void SfxModelessDialogController::Close()
     m_pBindings->GetDispatcher_Impl()->ExecuteList(
         m_xImpl->pMgr->GetType(),
         SfxCallMode::RECORD|SfxCallMode::SYNCHRON, { &aValue } );
+    SfxDialogController::Close();
 }
 
 SfxDialogController::SfxDialogController(weld::Widget* pParent, const 
OUString& rUIFile,
@@ -210,6 +211,12 @@ SfxDialogController::SfxDialogController(weld::Widget* 
pParent, const OUString&
     m_xDialog->connect_container_focus_changed(LINK(this, SfxDialogController, 
FocusChangeHdl));
 }
 
+void SfxDialogController::Close()
+{
+    // tdf3146571 ignore focus changes after we've closed
+    m_xDialog->connect_container_focus_changed(Link<weld::Container&, void>());
+}
+
 IMPL_STATIC_LINK_NOARG(SfxDialogController, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*)
 {
     return SfxViewShell::Current();

Reply via email to