From cd4a239063a77d49fe178255c20f0558e337a82f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 16 Nov 2020 15:21:58 +0000 Subject: tdf#138049 different parents for restart dialog depending on ok vs apply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and in ok case hide the to-be-dismissed dialog before putting up the next dialog Change-Id: Ie9c0dfc1a7c10f8fd1d7a70749e07db123de2bf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105951 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- cui/source/options/treeopt.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'cui') diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index e2ec8ed927dd..cd30560c3fd2 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -735,11 +735,21 @@ IMPL_LINK(OfaTreeOptionsDialog, ApplyHdl_Impl, weld::Button&, rButton, void) SelectHdl_Impl(); } - if ( bNeedsRestart ) + if (bNeedsRestart) { SolarMutexGuard aGuard; - ::svtools::executeRestartDialog(comphelper::getProcessComponentContext(), - m_pParent, eRestartReason); + weld::Window* pParent; + if (!bOkPressed) + pParent = m_xDialog.get(); + else + { + m_xDialog->hide(); + pParent = m_pParent; + } + bool bRestart = ::svtools::executeRestartDialog(comphelper::getProcessComponentContext(), + pParent, eRestartReason); + if (bRestart && !bOkPressed) + m_xDialog->response(RET_OK); } } -- cgit