diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-01-24 17:10:48 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-01-24 20:38:51 +0100 |
commit | 6c5c6ede0103e15b8e8ac432f0ca7f6e00c9dcb4 (patch) | |
tree | ac9eee5af19ae935b09e58b5d0944b8b692c3e46 /sfx2/source/appl | |
parent | de170db187852c42f6bad845d00c2b19b99e9a31 (diff) |
tdf#146913 don't destroy the dialog if we just want to hide it
Change-Id: Ie534aba915120d12e65aa965e5435bc7575ecb29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128879
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r-- | sfx2/source/appl/childwin.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/appl/workwin.cxx | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 263f750f9b12..944fe47ed64a 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -511,7 +511,7 @@ void SfxChildWindow::SetVisible_Impl( bool bVis ) void SfxChildWindow::Hide() { if (xController) - xController->EndDialog(); + xController->EndDialog(nCloseResponseToJustHide); else pWindow->Hide(); } @@ -523,7 +523,11 @@ void SfxChildWindow::Show( ShowFlags nFlags ) if (!xController->getDialog()->get_visible()) { weld::DialogController::runAsync(xController, - [this](sal_Int32 /*nResult*/){ xController->Close(); }); + [this](sal_Int32 nResult) { + if (nResult == nCloseResponseToJustHide) + return; + xController->Close(); + }); } } else diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index ef9f546c20fa..ca0e55d5cdb8 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -999,7 +999,11 @@ void SfxWorkWindow::ShowChildren_Impl() { auto xController = pCli->xController; weld::DialogController::runAsync(xController, - [=](sal_Int32 /*nResult*/){ xController->Close(); }); + [=](sal_Int32 nResult){ + if (nResult == nCloseResponseToJustHide) + return; + xController->Close(); + }); } } else |