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 c1f78108bcb9fe63586f37985e7bcbcf0970537a
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Wed Jul 12 23:09:45 2023 +0200
Commit:     Balazs Varga <balazs.varga.ext...@allotropia.de>
CommitDate: Tue Jul 25 11:05:59 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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154831
    Tested-by: Balazs Varga <balazs.varga.ext...@allotropia.de>

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 65a781d5e598..42c7054eb4de 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -51,6 +51,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 485aa70bbd3e..d3fb36947a83 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -212,8 +212,6 @@ public:
 };
 
 const int nCloseResponseToJustHide = -42;
-// sc.hrc --> SID_VALIDITY_REFERENCE: 26161
-const sal_uInt16 nScValidityWindowSlotID = 26161;
 
 //! The Macro of the future ...
 #define SFX_DECL_CHILDWINDOWCONTEXT(Class) \
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index 9ee85231f609..da10715a777d 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* pDoc ) override
     {
         if ( m_pHandler && m_pSetReferenceHdl )
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 05257229fd89..97a8c2e43bc2 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -639,7 +639,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