summaryrefslogtreecommitdiff
path: root/unotools/source/config/pathoptions.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 /unotools/source/config/pathoptions.cxx
parentee7f8cb10178fbc348210f6dea0e2ae64964ab6d (diff)
fdo#46808, Convert util::PathSettings service to new style
Change-Id: I302be46b46518e1e872771e1c8a0647f7c330b30
Diffstat (limited to 'unotools/source/config/pathoptions.cxx')
-rw-r--r--unotools/source/config/pathoptions.cxx20
1 files changed, 5 insertions, 15 deletions
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index c55072f136e9..8c39f291bd24 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -35,9 +35,10 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/util/PathSettings.hpp>
#include <com/sun/star/util/PathSubstitution.hpp>
#include <com/sun/star/util/XStringSubstitution.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/util/theMacroExpander.hpp>
#include <rtl/instance.hxx>
@@ -417,24 +418,13 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() :
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
// Create necessary services
- m_xPathSettings = Reference< XFastPropertySet >( xContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.util.PathSettings", xContext),
- UNO_QUERY );
- if ( !m_xPathSettings.is() )
- {
- // #112719#: check for existance
- OSL_FAIL( "SvtPathOptions_Impl::SvtPathOptions_Impl(): #112719# happened again!" );
- throw RuntimeException(
- OUString( "Service com.sun.star.util.PathSettings cannot be created" ),
- Reference< XInterface >() );
- }
-
+ Reference< XPathSettings > xPathSettings = PathSettings::create(xContext);
+ m_xPathSettings.set( xPathSettings, UNO_QUERY_THROW );
m_xSubstVariables.set( PathSubstitution::create(xContext) );
m_xMacroExpander = theMacroExpander::get(xContext);
// Create temporary hash map to have a mapping between property names and property handles
- Reference< XPropertySet > xPropertySet = Reference< XPropertySet >( m_xPathSettings, UNO_QUERY );
- Reference< XPropertySetInfo > xPropSetInfo = xPropertySet->getPropertySetInfo();
+ Reference< XPropertySetInfo > xPropSetInfo = xPathSettings->getPropertySetInfo();
Sequence< Property > aPathPropSeq = xPropSetInfo->getProperties();
NameToHandleMap aTempHashMap;