summaryrefslogtreecommitdiff
path: root/scripting
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 /scripting
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 'scripting')
-rw-r--r--scripting/source/basprov/basprov.cxx11
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx8
2 files changed, 7 insertions, 12 deletions
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx
index 30743ec0fb7a..674885b4334d 100644
--- a/scripting/source/basprov/basprov.cxx
+++ b/scripting/source/basprov/basprov.cxx
@@ -41,7 +41,7 @@
#include <sfx2/app.hxx>
#include <sfx2/objsh.hxx>
-#include <com/sun/star/util/XMacroExpander.hpp>
+#include <com/sun/star/util/theMacroExpander.hpp>
#include <com/sun/star/script/XLibraryContainer2.hpp>
#include <com/sun/star/uri/XUriReference.hpp>
#include <com/sun/star/uri/XUriReferenceFactory.hpp>
@@ -155,12 +155,9 @@ namespace basprov
{
::rtl::OUString aDecodedURL( aAuthority.copy( sizeof ( "vnd.sun.star.expand:" ) - 1 ) );
aDecodedURL = ::rtl::Uri::decode( aDecodedURL, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
- Reference<util::XMacroExpander> xMacroExpander(
- m_xContext->getValueByName(
- ::rtl::OUString("/singletons/com.sun.star.util.theMacroExpander") ),
- UNO_QUERY );
- if ( xMacroExpander.is() )
- aFileURL = xMacroExpander->expandMacros( aDecodedURL );
+ Reference<util::XMacroExpander> xMacroExpander =
+ util::theMacroExpander::get(m_xContext);
+ aFileURL = xMacroExpander->expandMacros( aDecodedURL );
}
}
}
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 04c458f273de..9ea9735c9d44 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -47,7 +47,7 @@
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
#include <com/sun/star/uri/XVndSunStarExpandUrl.hpp>
-#include <com/sun/star/util/XMacroExpander.hpp>
+#include <com/sun/star/util/theMacroExpander.hpp>
#include <util/MiscUtils.hxx>
@@ -295,10 +295,8 @@ static ::rtl::OUString aResourceResolverPropName("ResourceResolver");
// Accept file URL to single dialog
bool bSingleDialog = false;
- Reference< util::XMacroExpander > xMacroExpander(
- m_xContext->getValueByName(
- ::rtl::OUString("/singletons/com.sun.star.util.theMacroExpander") ),
- UNO_QUERY_THROW );
+ Reference< util::XMacroExpander > xMacroExpander =
+ util::theMacroExpander::get(m_xContext);
Reference< uri::XUriReference > uriRef;
for (;;)