summaryrefslogtreecommitdiff
path: root/xmloff
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 /xmloff
parentf4776bf465ee682f65d1e978b031c928d9d310a5 (diff)
fdo#46808, use service constructor for uri::UriReferenceFactory
Change-Id: I4e72bf5880fa28cb96d93ede7730a63220af7fa6
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/RDFaExportHelper.cxx10
-rw-r--r--xmloff/source/transform/EventOASISTContext.cxx62
2 files changed, 30 insertions, 42 deletions
diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx
index 4a9d39ba15ec..e74cdaff3516 100644
--- a/xmloff/source/core/RDFaExportHelper.cxx
+++ b/xmloff/source/core/RDFaExportHelper.cxx
@@ -38,7 +38,7 @@
#include <comphelper/stl_types.hxx>
#include <com/sun/star/uri/XUriReference.hpp>
-#include <com/sun/star/uri/XUriReferenceFactory.hpp>
+#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <com/sun/star/rdf/Statement.hpp>
#include <com/sun/star/rdf/URIs.hpp>
#include <com/sun/star/rdf/URI.hpp>
@@ -99,12 +99,8 @@ getRelativeReference(SvXMLExport const& rExport, ::rtl::OUString const& rURI)
uno::Reference<uno::XComponentContext> const xContext(
rExport.GetComponentContext());
- uno::Reference<lang::XMultiComponentFactory> const xServiceFactory(
- xContext->getServiceManager(), uno::UNO_SET_THROW);
- uno::Reference<uri::XUriReferenceFactory> const xUriFactory(
- xServiceFactory->createInstanceWithContext(
- ::rtl::OUString( "com.sun.star.uri.UriReferenceFactory"), xContext),
- uno::UNO_QUERY_THROW);
+ uno::Reference<uri::XUriReferenceFactory> const xUriFactory =
+ uri::UriReferenceFactory::create( xContext );
uno::Reference< uri::XUriReference > const xBaseURI(
xUriFactory->parse(baseURI), uno::UNO_SET_THROW );
diff --git a/xmloff/source/transform/EventOASISTContext.cxx b/xmloff/source/transform/EventOASISTContext.cxx
index 07b9487756a0..dc68e1881178 100644
--- a/xmloff/source/transform/EventOASISTContext.cxx
+++ b/xmloff/source/transform/EventOASISTContext.cxx
@@ -37,7 +37,7 @@
#ifndef OASIS_FILTER_OOO_1X
// Used to parse Scripting Framework URLs
-#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>
#endif
@@ -197,52 +197,44 @@ bool ParseURL(
#ifdef OASIS_FILTER_OOO_1X
return ParseURLAsString( rAttrValue, pName, pLocation );
#else
- Reference< com::sun::star::lang::XMultiServiceFactory >
- xSMgr = ::comphelper::getProcessServiceFactory();
+ Reference< com::sun::star::uno::XComponentContext >
+ xContext = ::comphelper::getProcessComponentContext();
- Reference< com::sun::star::uri::XUriReferenceFactory >
- xFactory( xSMgr->createInstance( OUString(
- "com.sun.star.uri.UriReferenceFactory" ) ), UNO_QUERY );
+ Reference< com::sun::star::uri::XUriReferenceFactory > xFactory =
+ com::sun::star::uri::UriReferenceFactory::create(xContext);
- if ( xFactory.is() )
- {
- Reference< com::sun::star::uri::XVndSunStarScriptUrl > xUrl (
- xFactory->parse( rAttrValue ), UNO_QUERY );
+ Reference< com::sun::star::uri::XVndSunStarScriptUrl > xUrl (
+ xFactory->parse( rAttrValue ), UNO_QUERY );
- if ( xUrl.is() )
+ if ( xUrl.is() )
+ {
+ OUString aLanguageKey = GetXMLToken( XML_LANGUAGE );
+ if ( xUrl.is() && xUrl->hasParameter( aLanguageKey ) )
{
- OUString aLanguageKey = GetXMLToken( XML_LANGUAGE );
- if ( xUrl.is() && xUrl->hasParameter( aLanguageKey ) )
- {
- OUString aLanguage = xUrl->getParameter( aLanguageKey );
+ OUString aLanguage = xUrl->getParameter( aLanguageKey );
- if ( aLanguage.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("basic")) )
- {
- *pName = xUrl->getName();
+ if ( aLanguage.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("basic")) )
+ {
+ *pName = xUrl->getName();
- OUString tmp =
- xUrl->getParameter( GetXMLToken( XML_LOCATION ) );
+ OUString tmp =
+ xUrl->getParameter( GetXMLToken( XML_LOCATION ) );
- OUString doc = GetXMLToken( XML_DOCUMENT );
+ OUString doc = GetXMLToken( XML_DOCUMENT );
- if ( tmp.equalsIgnoreAsciiCase( doc ) )
- {
- *pLocation = doc;
- }
- else
- {
- *pLocation = GetXMLToken( XML_APPLICATION );
- }
- return sal_True;
+ if ( tmp.equalsIgnoreAsciiCase( doc ) )
+ {
+ *pLocation = doc;
}
+ else
+ {
+ *pLocation = GetXMLToken( XML_APPLICATION );
+ }
+ return sal_True;
}
}
- return sal_False;
- }
- else
- {
- return ParseURLAsString( rAttrValue, pName, pLocation );
}
+ return sal_False;
#endif
}