summaryrefslogtreecommitdiff
path: root/sfx2/source/appl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-21 16:25:55 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-23 15:13:46 +0100
commitc46f0c9f6eb07db061d2f99c61c9ea05644a78ec (patch)
tree84346fccf04a608ff88c5c1d23d323592d66fb8c /sfx2/source/appl
parente0bd8f36964b84d7649b7705c3df98256d3ce627 (diff)
Related: tdf#113160 set a temporary dialog parent during type detection
to get warning dialogs that don't block the existing windows but whose lifecycle can be controlled to avoid crashes during exit Change-Id: I57965301c3d8a031acb33e83bf7715fe132385d0 Reviewed-on: https://gerrit.libreoffice.org/45044 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r--sfx2/source/appl/preventduplicateinteraction.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sfx2/source/appl/preventduplicateinteraction.cxx b/sfx2/source/appl/preventduplicateinteraction.cxx
index bf7eeab13a16..009754cae517 100644
--- a/sfx2/source/appl/preventduplicateinteraction.cxx
+++ b/sfx2/source/appl/preventduplicateinteraction.cxx
@@ -19,6 +19,7 @@
#include <preventduplicateinteraction.hxx>
+#include <comphelper/processfactory.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/task/InteractionHandler.hpp>
@@ -53,7 +54,9 @@ void PreventDuplicateInteraction::useDefaultUUIHandler()
aLock.clear();
// <- SAFE
- css::uno::Reference< css::task::XInteractionHandler > xHandler( css::task::InteractionHandler::createWithParent( m_xContext, nullptr ), css::uno::UNO_QUERY_THROW );
+ m_xWarningDialogsParent.reset(new WarningDialogsParentScope(m_xContext));
+ css::uno::Reference<css::task::XInteractionHandler> xHandler(css::task::InteractionHandler::createWithParent(
+ m_xContext, m_xWarningDialogsParent->GetDialogParent()), css::uno::UNO_QUERY_THROW);
// SAFE ->
aLock.reset();
@@ -227,6 +230,11 @@ bool PreventDuplicateInteraction::getInteractionInfo(const css::uno::Type&
return false;
}
+IMPL_STATIC_LINK_NOARG(WarningDialogsParent, TerminateDesktop, void*, void)
+{
+ css::frame::Desktop::create(comphelper::getProcessComponentContext())->terminate();
+}
+
} // namespace sfx2
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */