include/sfx2/basedlgs.hxx     |    1 +
 include/sfx2/childwin.hxx     |    2 --
 sc/source/ui/inc/validate.hxx |    2 ++
 sfx2/source/appl/childwin.cxx |    2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 11d23a92cf15f8086e78a5fe9a6ae5d238208bbd
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Wed Jul 12 23:09:45 2023 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Jul 23 20:25:13 2023 +0200

    Related: tdf#155708 Clean-up - Fix validity dialog closes
    
    Do not close Validation window if click on another Calc sheet.
    
    Follow-up of commits:
    1 - a5c61b143d53bb10430b8a486874856c16a2d86c
    2 - efaa065eb7053954242c83760f897e7dba2e9fe8
    
    Change-Id: I5352ee869f3e8a93b49abec863089f57cdf0aeba
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154369
    Tested-by: Jenkins
    Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de>
    (cherry picked from commit 396cbd8cd017f883946f1a0be7285c89f84f40af)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154704
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index f87fe22c1dbd..e182b9aa7789 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -49,6 +49,7 @@ public:
     virtual void ChildWinDispose() {} // called from the associated 
SfxChildWin dtor
     virtual void Close(); // called by the SfxChildWin when the dialog is 
closed
     virtual void EndDialog(int nResponse); // called by the SfxChildWin to 
close the dialog
+    virtual bool CloseOnHide() const { return true; } // called from 
ScValidationDlg
 };
 
 class SfxModelessDialog_Impl;
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 6e4b20037be0..57c2369233ef 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -156,8 +156,6 @@ public:
 };
 
 const int nCloseResponseToJustHide = -42;
-// sc.hrc --> SID_VALIDITY_REFERENCE: 26161
-const sal_uInt16 nScValidityWindowSlotID = 26161;
 
 #define SFX_DECL_CHILDWINDOW(Class) \
     public  :   \
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index c58ae53bbf7f..4a3a2e80e97c 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -180,6 +180,8 @@ public:
 
     virtual void EndDialog(int nResponse) override;
 
+    virtual bool CloseOnHide() const override { return false; }
+
     virtual void            SetReference( const ScRange& rRef, ScDocument& 
rDoc ) override
     {
         if ( m_pHandler && m_pSetReferenceHdl )
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 633c33bb35c9..6bf2814599ec 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -522,7 +522,7 @@ void SfxChildWindow::Show( ShowFlags nFlags )
     {
         if (!xController->getDialog()->get_visible())
         {
-            if (nScValidityWindowSlotID == GetType())
+            if (!xController->CloseOnHide())
             {
                 // tdf#155708 - do not run a new (Async) validation window,
                 // because we already have one in sync mode, just show the 
running one

Reply via email to