summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-09-18 08:24:29 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-09-18 08:24:29 +0000
commitf887a993954942de9ee05e0282303187b6a22534 (patch)
treec4942114c13ad67c9b0b1ca04966b44bdc57f680 /uui
parentaae0ed4a283cc4a2d58d2eda10d12d0877913182 (diff)
CWS-TOOLING: integrate CWS tkr25
2009-09-01 14:44:57 +0200 tkr r275661 : #i104188# fixed linux build issue 2009-08-17 13:44:47 +0200 tkr r275048 : #104188# use XInitialization with custom interaction handler to provide parent window
Diffstat (limited to 'uui')
-rw-r--r--uui/source/iahndl.cxx29
-rw-r--r--uui/source/iahndl.hxx2
2 files changed, 30 insertions, 1 deletions
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 8ea299289986..996fd24e531d 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -107,6 +107,7 @@
#include "com/sun/star/uno/RuntimeException.hpp"
#include "com/sun/star/xforms/InvalidDataOnSubmitException.hpp"
#include <com/sun/star/security/CertificateValidity.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
#include "vos/mutex.hxx"
@@ -1370,6 +1371,23 @@ UUIInteractionHelper::handle_impl(
Reference< uno::XInterface > xIfc =
m_xServiceFactory->createInstance(aIt->ServiceName);
+
+ Reference< com::sun::star::lang::XInitialization > xInitialization =
+ Reference< com::sun::star::lang::XInitialization >( xIfc, UNO_QUERY );
+
+ OSL_ENSURE( xInitialization.is(), "Custom Interactionhandler does not implement mandatory interface XInitialization!" );
+ if (xInitialization.is())
+ {
+ uno::Sequence< uno::Any > propertyValues(1);
+ beans::PropertyValue aProperty;
+
+ aProperty.Name = rtl::OUString::createFromAscii( "Parent" );
+ aProperty.Value <<= getParentXWindow();
+ propertyValues[ 0 ] <<= aProperty;
+
+ xInitialization->initialize(propertyValues);
+ }
+
Reference< task::XInteractionHandler2 >
xInteractionHandler( xIfc, UNO_QUERY );
@@ -1503,6 +1521,15 @@ void UUIInteractionHelper::GetInteractionHandlerList(InteractionHandlerDataList
Window * UUIInteractionHelper::getParentProperty() SAL_THROW(())
{
+ star::uno::Reference< star::awt::XWindow > xWindow = getParentXWindow();
+ if ( xWindow.is() )
+ return VCLUnoHelper::GetWindow(xWindow);
+
+ return 0;
+}
+
+star::uno::Reference< ::com::sun::star::awt::XWindow> UUIInteractionHelper::getParentXWindow() SAL_THROW(())
+{
osl::MutexGuard aGuard(m_aPropertyMutex);
for (sal_Int32 i = 0; i < m_aProperties.getLength(); ++i)
{
@@ -1513,7 +1540,7 @@ Window * UUIInteractionHelper::getParentProperty() SAL_THROW(())
{
star::uno::Reference< star::awt::XWindow > xWindow;
aProperty.Value >>= xWindow;
- return VCLUnoHelper::GetWindow(xWindow);
+ return xWindow;
}
}
return 0;
diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx
index dadac27b63a4..bea53e436c6d 100644
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -177,6 +177,8 @@ private:
Window * getParentProperty() SAL_THROW(());
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> getParentXWindow() SAL_THROW(());
+
rtl::OUString getContextProperty() SAL_THROW(());
bool