summaryrefslogtreecommitdiff
path: root/sw/source/core/fields
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/source/core/fields
parentf4776bf465ee682f65d1e978b031c928d9d310a5 (diff)
fdo#46808, use service constructor for uri::UriReferenceFactory
Change-Id: I4e72bf5880fa28cb96d93ede7730a63220af7fa6
Diffstat (limited to 'sw/source/core/fields')
-rw-r--r--sw/source/core/fields/macrofld.cxx23
1 files changed, 9 insertions, 14 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;
}