diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-12-19 11:03:44 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-12-19 15:16:28 +0100 |
commit | 422b12bc13b34f4e99f79b2571b89296873ebe89 (patch) | |
tree | 0d285947e833149b353171203f2ae6fbe1c95c5f | |
parent | b16992f92090f616af02ea46912ebde697c7780d (diff) |
tdf#122171 block closing final window while xslt filter dialog is modal
Change-Id: Ic40d4074bad7c06d1c1e395de74442f2a3bca5cd
Reviewed-on: https://gerrit.libreoffice.org/65419
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | filter/source/xsltdialog/xmlfilterdialogcomponent.cxx | 20 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 15 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfiltersettingsdialog.hxx | 4 |
3 files changed, 17 insertions, 22 deletions
diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx index 9b5dd734002f..2f35661d014b 100644 --- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx +++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx @@ -249,24 +249,20 @@ void SAL_CALL XMLFilterDialogComponent::disposing() void SAL_CALL XMLFilterDialogComponent::queryTermination( const EventObject& /* Event */ ) { ::SolarMutexGuard aGuard; - if (!mpDialog) return; - - // we will never give a veto here - if (!mpDialog->isClosable()) - { - mpDialog->ToTop(); - throw TerminationVetoException( - "The office cannot be closed while the XMLFilterDialog is running", - static_cast<XTerminateListener*>(this)); - } - else - mpDialog->Close(); + mpDialog->ToTop(); } void SAL_CALL XMLFilterDialogComponent::notifyTermination( const EventObject& /* Event */ ) { + { + ::SolarMutexGuard aGuard; + if (!mpDialog) + return; + mpDialog->Close(); + } + // we are going down, so dispose us! dispose(); } diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 5ae90948e75c..39b3dfee190b 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -18,17 +18,19 @@ */ #include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/util/XFlushable.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> -#include <unotools/resmgr.hxx> #include <tools/urlobj.hxx> #include <vcl/headbar.hxx> -#include <unotools/streamwrap.hxx> +#include <unotools/closeveto.hxx> #include <unotools/pathoptions.hxx> +#include <unotools/resmgr.hxx> +#include <unotools/streamwrap.hxx> #include <osl/file.hxx> #include <o3tl/enumrange.hxx> #include <vcl/builderfactory.hxx> @@ -70,7 +72,6 @@ XMLFilterSettingsDialog::XMLFilterSettingsDialog(vcl::Window* pParent, Dialog::InitFlag eFlag) : ModelessDialog(pParent, "XMLFilterSettingsDialog", "filter/ui/xmlfiltersettings.ui", eFlag) , mxContext( rxContext ) - , m_bIsClosable(true) , m_sTemplatePath("$(user)/template/") , m_sDocTypePrefix("doctype:") { @@ -134,7 +135,11 @@ void XMLFilterSettingsDialog::dispose() IMPL_LINK(XMLFilterSettingsDialog, ClickHdl_Impl, Button *, pButton, void ) { - m_bIsClosable = false; + // tdf#122171 block closing libreoffice until the following dialog + // is dismissed + css::uno::Reference<css::frame::XDesktop2> xDesktop(css::frame::Desktop::create(mxContext)); + css::uno::Reference<css::frame::XFrame> xFrame(xDesktop->getCurrentFrame()); + utl::CloseVeto aKeepDoc(xFrame); if (m_pPBNew == pButton) { @@ -164,8 +169,6 @@ IMPL_LINK(XMLFilterSettingsDialog, ClickHdl_Impl, Button *, pButton, void ) { Close(); } - - m_bIsClosable = true; } IMPL_LINK_NOARG(XMLFilterSettingsDialog, SelectionChangedHdl_Impl, SvTreeListBox*, void) diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx index ff55a19f9b5a..d6933dad425a 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx @@ -105,8 +105,6 @@ public: virtual bool EventNotify( NotifyEvent& rNEvt ) override; - bool isClosable() { return m_bIsClosable;} - private: void initFilterList(); void disposeFilterList(); @@ -135,8 +133,6 @@ private: VclPtr<PushButton> m_pPBOpen; VclPtr<CloseButton> m_pPBClose; - bool m_bIsClosable; - OUString m_sTemplatePath; OUString m_sDocTypePrefix; |