summaryrefslogtreecommitdiff
path: root/ucbhelper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-05-26 13:53:19 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-06-04 16:57:55 +0200
commitb3c76dee6d44d07eae404b8d7341e6c88e6c4429 (patch)
treec747dd5bddf94c3b4312c7b1861a5087e76e71d6 /ucbhelper
parenteb68bf18f2d859486c4a737abb2536a6afe45411 (diff)
fdo#46808, Adapt UNO services to new style, Part 7, updating ::create
Update calls to factories to use new ::create methods Change-Id: I01d4417820f52718836c92faf3c2fae0dc96b30d Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, added some tweaks.
Diffstat (limited to 'ucbhelper')
-rw-r--r--ucbhelper/source/provider/registerucb.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/ucbhelper/source/provider/registerucb.cxx b/ucbhelper/source/provider/registerucb.cxx
index 631322f3f98f..b4dfcb6459e3 100644
--- a/ucbhelper/source/provider/registerucb.cxx
+++ b/ucbhelper/source/provider/registerucb.cxx
@@ -27,10 +27,13 @@
************************************************************************/
#include <ucbhelper/registerucb.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ucb/XContentProviderManager.hpp>
#include <com/sun/star/ucb/XParameterizedContentProvider.hpp>
+#include <com/sun/star/ucb/ContentProviderProxyFactory.hpp>
#include <com/sun/star/ucb/XContentProviderFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include "osl/diagnose.h"
@@ -74,14 +77,13 @@ registerAtUcb(
uno::Reference< ucb::XContentProviderFactory > xProxyFactory;
try
{
+ uno::Reference< beans::XPropertySet > xFactoryProperties( rServiceFactory, uno::UNO_QUERY_THROW );
+ uno::Reference< uno::XComponentContext > xContext = uno::Reference< uno::XComponentContext >(
+ xFactoryProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ),
+ uno::UNO_QUERY );
xProxyFactory
= uno::Reference< ucb::XContentProviderFactory >(
- rServiceFactory->
- createInstance(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.ucb.ContentProviderProxyFactory"))),
- uno::UNO_QUERY);
+ ucb::ContentProviderProxyFactory::create( xContext ) );
}
catch (uno::Exception const &) {}
OSL_ENSURE(xProxyFactory.is(), "No ContentProviderProxyFactory");