diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-01-10 10:44:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-01-11 11:57:24 +0100 |
commit | e94dc6f63a05ab7744b720847c13bd0e2f674417 (patch) | |
tree | aaca480a3a2665a0e6eaa067cc61c5ce97225f34 /filter | |
parent | make Insert->Header and Footer dialog async (diff) | |
download | core-e94dc6f63a05ab7744b720847c13bd0e2f674417.tar.gz core-e94dc6f63a05ab7744b720847c13bd0e2f674417.zip |
Resolves: tdf#122404 unlock just the toplevels that were locked
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/66076
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 26 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfiltersettingsdialog.hxx | 6 |
2 files changed, 4 insertions, 28 deletions
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 036cfcb95d89..e5bbba97ee3e 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -133,32 +133,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 e1e1d82418d5..6c1e89c4a9bd 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx @@ -27,6 +27,7 @@ #include <vcl/dialog.hxx> #include <vcl/layout.hxx> #include <vcl/svtabbx.hxx> +#include <vcl/waitobj.hxx> #include <svl/poolitem.hxx> #include <unotools/moduleoptions.hxx> @@ -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< std::unique_ptr<filter_info_impl> > maFilterVector; + TopLevelWindowLocker maBusy; VclPtr<XMLFilterListBox> m_pFilterListBox; VclPtr<SvxPathControl> m_pCtrlFilterList; VclPtr<PushButton> m_pPBNew; |