[Libreoffice-commits] core.git: filter/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Dec 19 14:16:51 UTC 2018
filter/source/xsltdialog/xmlfilterdialogcomponent.cxx | 20 +++++++-----------
filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 15 ++++++++-----
filter/source/xsltdialog/xmlfiltersettingsdialog.hxx | 4 ---
3 files changed, 17 insertions(+), 22 deletions(-)
New commits:
commit 422b12bc13b34f4e99f79b2571b89296873ebe89
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Dec 19 11:03:44 2018 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Dec 19 15:16:28 2018 +0100
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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;
More information about the Libreoffice-commits
mailing list