diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-12 08:57:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-23 11:45:47 +0200 |
commit | 5aa2cd1d3f85958917f47523ee430af11ac1751d (patch) | |
tree | 0a5e62c012841e51410500c5b6a52db1938c5ed3 /xmlhelp/source | |
parent | f4776bf465ee682f65d1e978b031c928d9d310a5 (diff) |
fdo#46808, use service constructor for uri::UriReferenceFactory
Change-Id: I4e72bf5880fa28cb96d93ede7730a63220af7fa6
Diffstat (limited to 'xmlhelp/source')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.cxx | 17 | ||||
-rw-r--r-- | xmlhelp/source/treeview/tvread.cxx | 14 |
2 files changed, 4 insertions, 27 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 8537685ae278..342923d341f9 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -53,7 +53,7 @@ #include <com/sun/star/frame/XConfigManager.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> #include <com/sun/star/util/XMacroExpander.hpp> -#include <com/sun/star/uri/XUriReferenceFactory.hpp> +#include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/uri/XVndSunStarExpandUrl.hpp> #include <com/sun/star/script/XInvocation.hpp> #include <comphelper/locale.hxx> @@ -94,22 +94,9 @@ rtl::OUString Databases::expandURL( const rtl::OUString& aURL, Reference< uno::X static Reference< util::XMacroExpander > xMacroExpander; static Reference< uri::XUriReferenceFactory > xFac; - if( !xContext.is() ) - return rtl::OUString(); - if( !xMacroExpander.is() || !xFac.is() ) { - Reference< XMultiComponentFactory > xSMgr( xContext->getServiceManager(), UNO_QUERY ); - - xFac = Reference< uri::XUriReferenceFactory >( - xSMgr->createInstanceWithContext( rtl::OUString( - "com.sun.star.uri.UriReferenceFactory"), xContext ) , UNO_QUERY ); - if( !xFac.is() ) - { - throw RuntimeException( - ::rtl::OUString( "Databases::expand(), could not instatiate UriReferenceFactory." ), - Reference< XInterface >() ); - } + xFac = uri::UriReferenceFactory::create( xContext ); xMacroExpander = Reference< util::XMacroExpander >( xContext->getValueByName( diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 387ba141d436..52d1e4abacc5 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -40,7 +40,7 @@ #include <comphelper/processfactory.hxx> #include "com/sun/star/deployment/thePackageManagerFactory.hpp" #include <com/sun/star/util/XMacroExpander.hpp> -#include <com/sun/star/uri/XUriReferenceFactory.hpp> +#include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/uri/XVndSunStarExpandUrl.hpp> #include <comphelper/locale.hxx> #include <comphelper/string.hxx> @@ -1292,17 +1292,7 @@ rtl::OUString TreeFileIterator::expandURL( const rtl::OUString& aURL ) if( !xMacroExpander.is() || !xFac.is() ) { - Reference< XMultiComponentFactory > xSMgr( m_xContext->getServiceManager(), UNO_QUERY ); - - xFac = Reference< uri::XUriReferenceFactory >( - xSMgr->createInstanceWithContext( rtl::OUString( - "com.sun.star.uri.UriReferenceFactory"), m_xContext ) , UNO_QUERY ); - if( !xFac.is() ) - { - throw RuntimeException( - ::rtl::OUString( "Databases::expand(), could not instatiate UriReferenceFactory." ), - Reference< XInterface >() ); - } + xFac = uri::UriReferenceFactory::create( m_xContext ); xMacroExpander = Reference< util::XMacroExpander >( m_xContext->getValueByName( |