From 71fad56863301f47f19fdd47ab93099ad098474e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 10 Jan 2019 10:44:31 +0000 Subject: Resolves: tdf#122404 unlock just the toplevels that were locked MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit push what toplevels got locked to just unlock those ones. otherwise the just dismissed toplevel may still be present in the Application toplevel list. merge all the similar examples of this. Change-Id: I77c0d55d1e4b3bcc3b8d88fef00ba289edd1e831 Reviewed-on: https://gerrit.libreoffice.org/66080 Tested-by: Jenkins Tested-by: Xisco Faulí Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- .../source/xsltdialog/xmlfiltersettingsdialog.cxx | 26 ---------------------- .../source/xsltdialog/xmlfiltersettingsdialog.hxx | 6 +++-- 2 files changed, 4 insertions(+), 28 deletions(-) (limited to 'filter') diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 3af2023f67c5..a62ab1555576 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -131,32 +131,6 @@ void XMLFilterSettingsDialog::dispose() ModelessDialog::dispose(); } -void XMLFilterSettingsDialog::incBusy() -{ - // lock any toplevel windows from being closed until busy is over - // ensure any dialogs are reset before entering - vcl::Window *xTopWin = Application::GetFirstTopLevelWindow(); - while (xTopWin) - { - if (xTopWin != this) - xTopWin->IncModalCount(); - xTopWin = Application::GetNextTopLevelWindow(xTopWin); - } -} - -void XMLFilterSettingsDialog::decBusy() -{ - // unlock any toplevel windows from being closed until busy is over - // ensure any dialogs are reset before entering - vcl::Window *xTopWin = Application::GetFirstTopLevelWindow(); - while (xTopWin) - { - if (xTopWin != this) - xTopWin->DecModalCount(); - xTopWin = Application::GetNextTopLevelWindow(xTopWin); - } -} - IMPL_LINK(XMLFilterSettingsDialog, ClickHdl_Impl, Button *, pButton, void ) { // tdf#122171 block closing libreoffice until the following dialog is dismissed diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx index 37ed80f2d7aa..1a8ddd6ba6fa 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -109,8 +110,8 @@ private: void initFilterList(); void disposeFilterList(); - void incBusy(); - void decBusy(); + void incBusy() { maBusy.incBusy(this); } + void decBusy() { maBusy.decBusy(); } bool insertOrEdit( filter_info_impl* pNewInfo, const filter_info_impl* pOldInfo = nullptr ); @@ -126,6 +127,7 @@ private: std::vector< filter_info_impl* > maFilterVector; + TopLevelWindowLocker maBusy; VclPtr m_pFilterListBox; VclPtr m_pCtrlFilterList; VclPtr m_pPBNew; -- cgit v1.2.3