tdf#133807 represent a visible search dialog when search results is closed
Change-Id: If38b2770cfdd7d88bb75cbd47f44cc8515c4e041
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95883
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx
index 76cffa4..11e670f 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -10,6 +10,8 @@
#include <searchresults.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
#include <svx/srchdlg.hxx>
#include <dociter.hxx>
#include <document.hxx>
#include <tabvwsh.hxx>
@@ -39,6 +41,19 @@ SearchResultsDlg::SearchResultsDlg(SfxBindings* _pBindings, weld::Window* pParen
SearchResultsDlg::~SearchResultsDlg()
{
// tdf#133807 if the search dialog is shown then re-present that dialog
// when this results dialog is dismissed
SfxViewFrame* pViewFrame = mpBindings->GetDispatcher()->GetFrame();
if (!pViewFrame)
return;
SfxChildWindow* pChildWindow = pViewFrame->GetChildWindow(
SvxSearchDialogWrapper::GetChildWindowId());
if (!pChildWindow)
return;
SvxSearchDialog* pSearchDlg = static_cast<SvxSearchDialog*>(pChildWindow->GetController().get());
if (!pSearchDlg)
return;
pSearchDlg->getDialog()->present();
}
namespace