From 0a09ca614bcf07fadddeecb217f0c871f084810c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 3 Nov 2017 15:27:35 +0000 Subject: Related: tdf#113160 set parent of warning dialogs during load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit to the new window frame being constructed that (may) contain the progress bar, that way such modal dialogs affect the loading document window and not whatever window happens to be active Change-Id: I1c7d3185e47fa316eef003b80d18b31d341b79d6 Reviewed-on: https://gerrit.libreoffice.org/44269 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- framework/source/loadenv/loadenv.cxx | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'framework/source/loadenv') diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 3bfd87e3244c..b76f13ef8c66 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -1042,17 +1042,32 @@ 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 && !xProgress.is()) + if (!bHidden && !bMinimized && !bPreview) { - // Note: it's an optional interface! - css::uno::Reference< css::task::XStatusIndicatorFactory > xProgressFactory(xTargetFrame, css::uno::UNO_QUERY); - if (xProgressFactory.is()) + css::uno::Reference< css::task::XStatusIndicator > xProgress = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_STATUSINDICATOR(), css::uno::Reference< css::task::XStatusIndicator >()); + if (!xProgress.is()) { - xProgress = xProgressFactory->createStatusIndicator(); - if (xProgress.is()) - m_lMediaDescriptor[utl::MediaDescriptor::PROP_STATUSINDICATOR()] <<= xProgress; + // 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 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; + } } } -- cgit