summaryrefslogtreecommitdiff
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
commitaab4bf3591d4c8396ce78a7bb14772ded609457e (patch)
treec18f707f55c81670e13ff915d2228abd45378a37
parent7ac6207a79b1850367e59e03c0b7f8807e6ae4b0 (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
-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 14530711ed..127a9bcbd6 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"
@@ -1369,6 +1370,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 7b78efffd1..177273a032 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