diff options
-rw-r--r-- | include/svx/srchdlg.hxx | 7 | ||||
-rw-r--r-- | sc/source/ui/dialogs/searchresults.cxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 17 |
3 files changed, 25 insertions, 1 deletions
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx index 6b45e838dcf9..8982e4d37a2b 100644 --- a/include/svx/srchdlg.hxx +++ b/include/svx/srchdlg.hxx @@ -25,6 +25,7 @@ #include <svl/srchdefs.hxx> #include <svl/srchitem.hxx> #include <svx/svxdllapi.h> +#include <vcl/timer.hxx> #include <memory> #include <vector> @@ -132,8 +133,12 @@ public: void SetSearchLabel(const OUString& rStr); + // bring this window back to the foreground + void Present(); + private: SfxBindings& rBindings; + Timer m_aPresentIdle; bool bWriter; bool bSearch; bool bFormat; @@ -255,6 +260,8 @@ private: SVX_DLLPRIVATE bool IsOtherOptionsExpanded() const; SVX_DLLPRIVATE short executeSubDialog(VclAbstractDialog * dialog); + + DECL_DLLPRIVATE_LINK(PresentTimeoutHdl_Impl, Timer*, void); }; #endif diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx index b1b0e45aec5f..950726a18c4e 100644 --- a/sc/source/ui/dialogs/searchresults.cxx +++ b/sc/source/ui/dialogs/searchresults.cxx @@ -55,7 +55,7 @@ SearchResultsDlg::~SearchResultsDlg() SvxSearchDialog* pSearchDlg = static_cast<SvxSearchDialog*>(pChildWindow->GetController().get()); if (!pSearchDlg) return; - pSearchDlg->getDialog()->present(); + pSearchDlg->Present(); } namespace diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index adab6f86b642..6653be858078 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -255,6 +255,7 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWi : SfxModelessDialogController(&rBind, pChildWin, pParent, "svx/ui/findreplacedialog.ui", "FindReplaceDialog") , rBindings(rBind) + , m_aPresentIdle("Bring SvxSearchDialog to Foreground") , bWriter(false) , bSearch(true) , bFormat(false) @@ -312,6 +313,9 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWi , m_xAllSheetsCB(m_xBuilder->weld_check_button("allsheets")) , m_xCalcStrFT(m_xBuilder->weld_label("entirecells")) { + m_aPresentIdle.SetTimeout(50); + m_aPresentIdle.SetInvokeHandler(LINK(this, SvxSearchDialog, PresentTimeoutHdl_Impl)); + m_xSearchTmplLB->make_sorted(); m_xSearchAttrText->hide(); m_xSearchLabel->show(); @@ -338,6 +342,18 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWi Construct_Impl(); } +IMPL_LINK_NOARG(SvxSearchDialog, PresentTimeoutHdl_Impl, Timer*, void) +{ + getDialog()->present(); +} + +void SvxSearchDialog::Present() +{ + PresentTimeoutHdl_Impl(nullptr); + // tdf#133807 try again in a short timeout + m_aPresentIdle.Start(); +} + void SvxSearchDialog::ChildWinDispose() { rBindings.EnterRegistrations(); @@ -350,6 +366,7 @@ void SvxSearchDialog::ChildWinDispose() SvxSearchDialog::~SvxSearchDialog() { + m_aPresentIdle.Stop(); } void SvxSearchDialog::Construct_Impl() |