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 7c1ca3b3916b3216188cdb32852cb2058cf070f3
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Jan 24 15:46:50 2022 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Tue Jan 25 13:46:10 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 <caol...@redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128910
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index c8c1bdad8a40..84a3da9b1ed0 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -49,7 +49,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 05a9428eda5e..3ea7e0121eb0 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 f28d31d7882d..7cdd782e120c 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