summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2023-07-03 19:56:43 +0200
committerBalazs Varga <balazs.varga.extern@allotropia.de>2023-07-05 14:30:14 +0200
commita5c61b143d53bb10430b8a486874856c16a2d86c (patch)
treedb7f7619b616241c32d9e9acef8048dbb154e819
parentf98296117b2c27af73c093525ad828909fd8fb31 (diff)
tdf#155708 Fix validity dialog closes when moving focus to another window
Do not close Validation window if click on another Calc sheet. Change-Id: I75569cbb91ebd445ac57f7a52d914297c21349e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153930 Tested-by: Balazs Varga <balazs.varga.extern@allotropia.de> Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
-rw-r--r--include/sfx2/childwin.hxx2
-rw-r--r--include/vcl/toolkit/dialog.hxx2
-rw-r--r--sc/source/ui/dbgui/validate.cxx6
-rw-r--r--sc/source/ui/inc/validate.hxx2
-rw-r--r--sfx2/source/appl/childwin.cxx21
5 files changed, 27 insertions, 6 deletions
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 57c2369233ef..6e4b20037be0 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -156,6 +156,8 @@ 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/include/vcl/toolkit/dialog.hxx b/include/vcl/toolkit/dialog.hxx
index 5e11d2f783b5..640204acfe60 100644
--- a/include/vcl/toolkit/dialog.hxx
+++ b/include/vcl/toolkit/dialog.hxx
@@ -58,6 +58,8 @@ private:
bool mbModalMode;
InitFlag mnInitFlag; // used for deferred init
+ const int nCloseResponseToJustHide = -42;
+
VclPtr<VclButtonBox> mpActionArea;
VclPtr<VclBox> mpContentArea;
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 4445f68245c8..f8565e964354 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -104,6 +104,12 @@ ScValidationDlg::ScValidationDlg(weld::Window* pParent, const SfxItemSet* pArgSe
void ScValidationDlg::EndDialog(int nResponse)
{
+ // tdf#155708 - do not close, just hide validation window if we click in another sheet
+ if (nResponse == nCloseResponseToJustHide && getDialog()->get_visible())
+ {
+ getDialog()->hide();
+ return;
+ }
// tdf#137215 ensure original modality of true is restored before dialog loop ends
if (m_bOwnRefHdlr)
RemoveRefDlg(true);
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index c8ed4447c400..c58ae53bbf7f 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -154,6 +154,8 @@ class ScValidationDlg
bool m_bOwnRefHdlr:1;
bool m_bRefInputting:1;
+ const int nCloseResponseToJustHide = -42;
+
std::unique_ptr<weld::Container> m_xHBox;
bool EnterRefStatus();
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 1fe6c39a7a03..633c33bb35c9 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -522,12 +522,21 @@ void SfxChildWindow::Show( ShowFlags nFlags )
{
if (!xController->getDialog()->get_visible())
{
- weld::DialogController::runAsync(xController,
- [this](sal_Int32 nResult) {
- if (nResult == nCloseResponseToJustHide)
- return;
- xController->Close();
- });
+ if (nScValidityWindowSlotID == GetType())
+ {
+ // tdf#155708 - do not run a new (Async) validation window,
+ // because we already have one in sync mode, just show the running one
+ xController->getDialog()->show();
+ }
+ else
+ {
+ weld::DialogController::runAsync(xController,
+ [this](sal_Int32 nResult) {
+ if (nResult == nCloseResponseToJustHide)
+ return;
+ xController->Close();
+ });
+ }
}
}
else