summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-10-26 11:16:50 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-26 11:16:50 +0200
commit402eaced7554aaeea75c10015857ea197191ba34 (patch)
treec245843a2b9b1df58b74d6c79347f0d2be956bdf /uui
parent489a0032f4dd6b1cd8b5e2e7c70b1ea626bee0d9 (diff)
Related fdo#46808: Fix UUIInteractionHandler::initialize argument handling
This was a regression introduced with c25cb8a641723ab098980bb842caf75c0dc9b059 "fdo#46808, Adapt task::InteractionHandler UNO service to new style." Change-Id: I52e36c4aabbf4b2b4552ed0e8ea164db15071980
Diffstat (limited to 'uui')
-rw-r--r--uui/source/interactionhandler.cxx24
1 files changed, 16 insertions, 8 deletions
diff --git a/uui/source/interactionhandler.cxx b/uui/source/interactionhandler.cxx
index 821b03e632a8..71f11eb33533 100644
--- a/uui/source/interactionhandler.cxx
+++ b/uui/source/interactionhandler.cxx
@@ -70,18 +70,26 @@ UUIInteractionHandler::initialize(
{
delete m_pImpl;
+ // The old-style InteractionHandler service supported a sequence of
+ // PropertyValue, while the new-style service now uses constructors to pass
+ // in Parent and Context values; for backwards compatibility, keep support
+ // for a PropertyValue sequence, too:
uno::Reference< awt::XWindow > xWindow;
rtl::OUString aContext;
- ::comphelper::NamedValueCollection aProperties( rArguments );
- if ( aProperties.has( "Parent" ) )
+ if (!((rArguments.getLength() == 1 && (rArguments[0] >>= xWindow)) ||
+ (rArguments.getLength() == 2 && (rArguments[0] >>= xWindow) &&
+ (rArguments[1] >>= aContext))))
{
- OSL_VERIFY( aProperties.get( "Parent" ) >>= xWindow );
+ ::comphelper::NamedValueCollection aProperties( rArguments );
+ if ( aProperties.has( "Parent" ) )
+ {
+ OSL_VERIFY( aProperties.get( "Parent" ) >>= xWindow );
+ }
+ if ( aProperties.has( "Context" ) )
+ {
+ OSL_VERIFY( aProperties.get( "Context" ) >>= aContext );
+ }
}
- if ( aProperties.has( "Context" ) )
- {
- OSL_VERIFY( aProperties.get( "Context" ) >>= aContext );
- }
-
m_pImpl = new UUIInteractionHelper(m_xServiceFactory, xWindow, aContext);
}