diff options
author | Noel Grandin <noel@peralex.com> | 2012-09-13 11:01:15 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-14 18:24:48 +0200 |
commit | 2e284203da7f9882842111265f5f68ea0a145065 (patch) | |
tree | 40eb08bffa732c6371bb15eff73a8d2ff18859a3 /svl | |
parent | 82e94dcaab4534f657458a2461033d686f10cb10 (diff) |
fdo#46808, Adapt ucb::UniversalContentBroker UNO service to new style
Create a merged XUniversalContentBroker interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.
Change-Id: Id264387bf8af8bf211050e15b8801a1fde368167
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/misc/urihelper.cxx | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index a080eda28095..23340841999c 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include "com/sun/star/lang/WrappedTargetRuntimeException.hpp" #include "com/sun/star/lang/XMultiComponentFactory.hpp" +#include "com/sun/star/ucb/UniversalContentBroker.hpp" #include "com/sun/star/ucb/Command.hpp" #include <com/sun/star/ucb/FileSystemNotation.hpp> #include "com/sun/star/ucb/IllegalIdentifierException.hpp" @@ -286,22 +287,11 @@ URIHelper::normalizedMakeRelative( rtl::OUString const & baseUriReference, rtl::OUString const & uriReference) { OSL_ASSERT(context.is()); - css::uno::Reference< css::lang::XMultiComponentFactory > componentFactory( - context->getServiceManager()); - if (!componentFactory.is()) { - throw css::uno::RuntimeException("component context has no service manager", - css::uno::Reference< css::uno::XInterface >()); - } - css::uno::Sequence< css::uno::Any > args(2); - args[0] <<= rtl::OUString("Local"); - args[1] <<= rtl::OUString("Office"); css::uno::Reference< css::ucb::XContentProvider > broker; try { broker = css::uno::Reference< css::ucb::XContentProvider >( - componentFactory->createInstanceWithArgumentsAndContext( - "com.sun.star.ucb.UniversalContentBroker", - args, context), - css::uno::UNO_QUERY_THROW); + css::ucb::UniversalContentBroker::createWithKeys(context, "Local", "Office"), + css::uno::UNO_QUERY_THROW); } catch (css::uno::RuntimeException &) { throw; } catch (css::uno::Exception &) { |