summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-12 08:57:24 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-23 11:45:47 +0200
commit5aa2cd1d3f85958917f47523ee430af11ac1751d (patch)
tree0a5e62c012841e51410500c5b6a52db1938c5ed3 /sw
parentf4776bf465ee682f65d1e978b031c928d9d310a5 (diff)
fdo#46808, use service constructor for uri::UriReferenceFactory
Change-Id: I4e72bf5880fa28cb96d93ede7730a63220af7fa6
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/fields/macrofld.cxx23
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx22
2 files changed, 18 insertions, 27 deletions
diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx
index d8cd5356ab61..08140f7b9ac4 100644
--- a/sw/source/core/fields/macrofld.cxx
+++ b/sw/source/core/fields/macrofld.cxx
@@ -32,7 +32,7 @@
#include <docufld.hxx>
#include <unofldmid.h>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/uri/XUriReferenceFactory.hpp>
+#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
#include <comphelper/processfactory.hxx>
@@ -235,23 +235,18 @@ void SwMacroField::CreateMacroString(
sal_Bool SwMacroField::isScriptURL( const String& str )
{
- uno::Reference< lang::XMultiServiceFactory > xSMgr =
- ::comphelper::getProcessServiceFactory();
+ uno::Reference< uno::XComponentContext > xContext =
+ ::comphelper::getProcessComponentContext();
uno::Reference< uri::XUriReferenceFactory >
- xFactory( xSMgr->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.uri.UriReferenceFactory")) ), uno::UNO_QUERY );
+ xFactory = uri::UriReferenceFactory::create( xContext );
- if ( xFactory.is() )
- {
- uno::Reference< uri::XVndSunStarScriptUrl >
- xUrl( xFactory->parse( str ), uno::UNO_QUERY );
+ uno::Reference< uri::XVndSunStarScriptUrl >
+ xUrl( xFactory->parse( str ), uno::UNO_QUERY );
- if ( xUrl.is() )
- {
- return sal_True;
- }
+ if ( xUrl.is() )
+ {
+ return sal_True;
}
return sal_False;
}
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index 3312a6a7b7bb..bd5df73d0ecf 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -39,7 +39,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdbc/XDataSource.hpp>
-#include <com/sun/star/uri/XUriReferenceFactory.hpp>
+#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
@@ -1695,22 +1695,18 @@ void SwFldMgr::SetMacroPath(const String& rPath)
// try to set sMacroName member variable by parsing the macro path
// using the new URI parsing services
- Reference< XMultiServiceFactory > xSMgr =
- ::comphelper::getProcessServiceFactory();
+ Reference< XComponentContext > xContext =
+ ::comphelper::getProcessComponentContext();
Reference< uri::XUriReferenceFactory >
- xFactory( xSMgr->createInstance(
- ::rtl::OUString( "com.sun.star.uri.UriReferenceFactory" ) ), UNO_QUERY );
+ xFactory = uri::UriReferenceFactory::create( xContext );
- if ( xFactory.is() )
- {
- Reference< uri::XVndSunStarScriptUrl >
- xUrl( xFactory->parse( sMacroPath ), UNO_QUERY );
+ Reference< uri::XVndSunStarScriptUrl >
+ xUrl( xFactory->parse( sMacroPath ), UNO_QUERY );
- if ( xUrl.is() )
- {
- sMacroName = xUrl->getName();
- }
+ if ( xUrl.is() )
+ {
+ sMacroName = xUrl->getName();
}
}