summaryrefslogtreecommitdiff
path: root/linguistic/source/misc2.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-08 15:02:35 +0200
committerNoel Grandin <noel@peralex.com>2013-05-13 09:38:01 +0200
commit86c1ebc1ef4a90e9bc58fb69c2d1d978765a34ca (patch)
treef9ba1c3c02198c83484b68fc190cd2995f6734ab /linguistic/source/misc2.cxx
parentee7f8cb10178fbc348210f6dea0e2ae64964ab6d (diff)
fdo#46808, Convert util::PathSettings service to new style
Change-Id: I302be46b46518e1e872771e1c8a0647f7c330b30
Diffstat (limited to 'linguistic/source/misc2.cxx')
-rw-r--r--linguistic/source/misc2.cxx41
1 files changed, 19 insertions, 22 deletions
diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx
index de5ac2442b34..d3ed5504a06a 100644
--- a/linguistic/source/misc2.cxx
+++ b/linguistic/source/misc2.cxx
@@ -28,10 +28,10 @@
#include <unotools/ucbhelper.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XFastPropertySet.hpp>
-
#include <com/sun/star/beans/PropertyValues.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/util/PathSettings.hpp>
#include "linguistic/misc.hxx"
@@ -70,28 +70,25 @@ static uno::Sequence< OUString > GetMultiPaths_Impl(
OUString aWritablePath;
bool bSuccess = true;
- uno::Reference< lang::XMultiServiceFactory > xMgr( comphelper::getProcessServiceFactory() );
- if (xMgr.is())
+ uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+ try
{
- try
- {
- String aInternal( rPathPrefix );
- String aUser( rPathPrefix );
- String aWriteable( rPathPrefix );
- aInternal .AppendAscii( "_internal" );
- aUser .AppendAscii( "_user" );
- aWriteable.AppendAscii( "_writable" );
-
- uno::Reference< beans::XPropertySet > xPathSettings( xMgr->createInstance(
- "com.sun.star.util.PathSettings" ), uno::UNO_QUERY_THROW );
- xPathSettings->getPropertyValue( aInternal ) >>= aInternalPaths;
- xPathSettings->getPropertyValue( aUser ) >>= aUserPaths;
- xPathSettings->getPropertyValue( aWriteable ) >>= aWritablePath;
- }
- catch (uno::Exception &)
- {
- bSuccess = false;
- }
+ String aInternal( rPathPrefix );
+ String aUser( rPathPrefix );
+ String aWriteable( rPathPrefix );
+ aInternal .AppendAscii( "_internal" );
+ aUser .AppendAscii( "_user" );
+ aWriteable.AppendAscii( "_writable" );
+
+ uno::Reference< util::XPathSettings > xPathSettings =
+ util::PathSettings::create( xContext );
+ xPathSettings->getPropertyValue( aInternal ) >>= aInternalPaths;
+ xPathSettings->getPropertyValue( aUser ) >>= aUserPaths;
+ xPathSettings->getPropertyValue( aWriteable ) >>= aWritablePath;
+ }
+ catch (uno::Exception &)
+ {
+ bSuccess = false;
}
if (bSuccess)
{