2654e0
From fa0371ce0456bfe355c36df0741ff23daeccb3a3 Mon Sep 17 00:00:00 2001
2654e0
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
2654e0
Date: Tue, 3 Nov 2020 14:04:37 +0000
2654e0
Subject: [PATCH 8/8] Resolves: tdf#137215 restore original modality before
2654e0
 dialog loop ends
2654e0
2654e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105214
2654e0
Tested-by: Jenkins
2654e0
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2654e0
(cherry picked from commit 022c11602d2101b49724b5cf104cc6c70b5a5e4b)
2654e0
2654e0
Change-Id: I83467e28534b781c51b8d75a023e41f3c6a03903
2654e0
---
2654e0
 sc/source/ui/dbgui/validate.cxx | 8 ++++++++
2654e0
 sc/source/ui/inc/validate.hxx   | 2 ++
2654e0
 2 files changed, 10 insertions(+)
2654e0
2654e0
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
2654e0
index 41bc913db911..73e04cc44706 100644
2654e0
--- a/sc/source/ui/dbgui/validate.cxx
2654e0
+++ b/sc/source/ui/dbgui/validate.cxx
2654e0
@@ -95,6 +95,14 @@ ScValidationDlg::ScValidationDlg(weld::Window* pParent, const SfxItemSet* pArgSe
2654e0
     AddTabPage("erroralert", ScTPValidationError::Create, nullptr);
2654e0
 }
2654e0
 
2654e0
+void ScValidationDlg::EndDialog()
2654e0
+{
2654e0
+    // tdf#137215 ensure original modalality of true is restored before dialog loop ends
2654e0
+    if (m_bOwnRefHdlr)
2654e0
+        RemoveRefDlg(true);
2654e0
+    ScValidationDlgBase::EndDialog();
2654e0
+}
2654e0
+
2654e0
 ScValidationDlg::~ScValidationDlg()
2654e0
 {
2654e0
     if (m_bOwnRefHdlr)
2654e0
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
2654e0
index 2c562717f921..cb88b9e8b40e 100644
2654e0
--- a/sc/source/ui/inc/validate.hxx
2654e0
+++ b/sc/source/ui/inc/validate.hxx
2654e0
@@ -176,6 +176,8 @@ public:
2654e0
 
2654e0
     void            SetModal(bool bModal) { m_xDialog->set_modal(bModal); }
2654e0
 
2654e0
+    virtual void EndDialog() override;
2654e0
+
2654e0
     virtual void            SetReference( const ScRange& rRef, ScDocument* pDoc ) override
2654e0
     {
2654e0
         if ( m_pHandler && m_pSetReferenceHdl )
2654e0
-- 
2654e0
2.28.0
2654e0