summaryrefslogtreecommitdiff
path: root/framework/source/loadenv
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 /framework/source/loadenv
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 'framework/source/loadenv')
-rw-r--r--framework/source/loadenv/loadenv.cxx31
1 files changed, 8 insertions, 23 deletions
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index b76f13ef8c66..3bfd87e3244c 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -1042,32 +1042,17 @@ bool LoadEnv::impl_loadContent()
bool bHidden = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN(), false);
bool bMinimized = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_MINIMIZED(), false);
bool bPreview = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PREVIEW(), false);
+ css::uno::Reference< css::task::XStatusIndicator > xProgress = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_STATUSINDICATOR(), css::uno::Reference< css::task::XStatusIndicator >());
- if (!bHidden && !bMinimized && !bPreview)
+ if (!bHidden && !bMinimized && !bPreview && !xProgress.is())
{
- css::uno::Reference< css::task::XStatusIndicator > xProgress = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_STATUSINDICATOR(), css::uno::Reference< css::task::XStatusIndicator >());
- if (!xProgress.is())
+ // Note: it's an optional interface!
+ css::uno::Reference< css::task::XStatusIndicatorFactory > xProgressFactory(xTargetFrame, css::uno::UNO_QUERY);
+ if (xProgressFactory.is())
{
- // Note: it's an optional interface!
- css::uno::Reference< css::task::XStatusIndicatorFactory > xProgressFactory(xTargetFrame, css::uno::UNO_QUERY);
- if (xProgressFactory.is())
- {
- xProgress = xProgressFactory->createStatusIndicator();
- if (xProgress.is())
- m_lMediaDescriptor[utl::MediaDescriptor::PROP_STATUSINDICATOR()] <<= xProgress;
- }
- }
- if (!comphelper::LibreOfficeKit::isActive())
- {
- //now that we have a window, set things up so that warnings dialogs are relative to that window
- css::uno::Reference<css::task::XInteractionHandler> xInteractionHandler(
- task::InteractionHandler::createWithParent(m_xContext, xTargetFrame->getContainerWindow()),
- css::uno::UNO_QUERY);
- if (xInteractionHandler.is())
- {
- m_lMediaDescriptor[utl::MediaDescriptor::PROP_INTERACTIONHANDLER()] <<= xInteractionHandler;
- m_lMediaDescriptor[utl::MediaDescriptor::PROP_AUTHENTICATIONHANDLER()] <<= xInteractionHandler;
- }
+ xProgress = xProgressFactory->createStatusIndicator();
+ if (xProgress.is())
+ m_lMediaDescriptor[utl::MediaDescriptor::PROP_STATUSINDICATOR()] <<= xProgress;
}
}