diff options
Diffstat (limited to 'xmlhelp')
-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( |