summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-02-08 11:02:37 +0200
committerNoel Grandin <noel@peralex.com>2013-02-11 08:02:13 +0200
commit591ef7844079e93ff627c7e194c04d520d2f1d55 (patch)
tree39c16f140ef2eae20f00a6c078d49519d4bd6bdc /xmlhelp
parent81c967e06e4247dec7ecb9ffec695ba31cb4f057 (diff)
fdo#46808, Use singleton util::theMacroExpander new-style constructor
And deprecate the old-style service util::MacroExpander Change-Id: Ifcefe31a8f8c68c6d44d6ec19616727eb607e1cd
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx7
-rw-r--r--xmlhelp/source/treeview/tvread.cxx28
2 files changed, 13 insertions, 22 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 7eda0aad3403..33f1c1c724de 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -46,7 +46,7 @@
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#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/util/theMacroExpander.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <com/sun/star/uri/XVndSunStarExpandUrl.hpp>
#include <com/sun/star/script/XInvocation.hpp>
@@ -91,10 +91,7 @@ rtl::OUString Databases::expandURL( const rtl::OUString& aURL, Reference< uno::X
{
xFac = uri::UriReferenceFactory::create( xContext );
- xMacroExpander = Reference< util::XMacroExpander >(
- xContext->getValueByName(
- ::rtl::OUString( "/singletons/com.sun.star.util.theMacroExpander" ) ),
- UNO_QUERY_THROW );
+ xMacroExpander = util::theMacroExpander::get(xContext);
}
rtl::OUString aRetURL = aURL;
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index fb9b62767b01..b47a2abd5536 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -31,7 +31,7 @@
#include <comphelper/processfactory.hxx>
#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
-#include <com/sun/star/util/XMacroExpander.hpp>
+#include <com/sun/star/util/theMacroExpander.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <com/sun/star/uri/XVndSunStarExpandUrl.hpp>
#include <comphelper/locale.hxx>
@@ -1281,29 +1281,23 @@ rtl::OUString TreeFileIterator::expandURL( const rtl::OUString& aURL )
{
xFac = uri::UriReferenceFactory::create( m_xContext );
- xMacroExpander = Reference< util::XMacroExpander >(
- m_xContext->getValueByName(
- ::rtl::OUString( "/singletons/com.sun.star.util.theMacroExpander" ) ),
- UNO_QUERY_THROW );
+ xMacroExpander = util::theMacroExpander::get(m_xContext);
}
rtl::OUString aRetURL = aURL;
- if( xMacroExpander.is() )
+ Reference< uri::XUriReference > uriRef;
+ for (;;)
{
- Reference< uri::XUriReference > uriRef;
- for (;;)
+ uriRef = Reference< uri::XUriReference >( xFac->parse( aRetURL ), UNO_QUERY );
+ if ( uriRef.is() )
{
- uriRef = Reference< uri::XUriReference >( xFac->parse( aRetURL ), UNO_QUERY );
- if ( uriRef.is() )
- {
- Reference < uri::XVndSunStarExpandUrl > sxUri( uriRef, UNO_QUERY );
- if( !sxUri.is() )
- break;
+ Reference < uri::XVndSunStarExpandUrl > sxUri( uriRef, UNO_QUERY );
+ if( !sxUri.is() )
+ break;
- aRetURL = sxUri->expand( xMacroExpander );
- }
+ aRetURL = sxUri->expand( xMacroExpander );
}
- }
+ }
return aRetURL;
}