summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorVishv Brahmbhatt <vishvbrahmbhatt19@gmail.com>2013-09-11 00:44:36 +0530
committerThorsten Behrens <thb@documentfoundation.org>2013-09-13 14:26:39 +0000
commit6fc6494aa9fea0b47fbf048998d7bd412ef478b1 (patch)
tree4c377bee5774dceec6aa6c43f36644d3fde72a28 /comphelper
parent8b3cbc71151cf91a97e4c4340430876c8d02d030 (diff)
Using macro expansion function for the remaining config entries.
Macro Expansion function is used in 'CustomAnimationPreset.cxx' & 'TransitionPreset.cxx' to avoid code redundancy.Also appropriate changes are to made to 'getExpandedFilePath' function. Change-Id: I6b6ae068db3499fe2de2e78a884f9e0737577651 Reviewed-on: https://gerrit.libreoffice.org/5910 Reviewed-by: Thorsten Behrens <thb@documentfoundation.org> Tested-by: Thorsten Behrens <thb@documentfoundation.org>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/expandmacro.cxx24
1 files changed, 3 insertions, 21 deletions
diff --git a/comphelper/source/misc/expandmacro.cxx b/comphelper/source/misc/expandmacro.cxx
index a7eae4b12548..86eb7c21183e 100644
--- a/comphelper/source/misc/expandmacro.cxx
+++ b/comphelper/source/misc/expandmacro.cxx
@@ -10,29 +10,17 @@
#include <comphelper/expandmacro.hxx>
#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/util/theMacroExpander.hpp>
#include <rtl/ustring.hxx>
#include <rtl/uri.hxx>
-#include <osl/file.h>
-#include <comphelper/processfactory.hxx>
+#include <rtl/bootstrap.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-using ::com::sun::star::lang::XMultiServiceFactory;
namespace comphelper
{
rtl::OUString getExpandedFilePath(const rtl::OUString& filepath)
{
- const Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
- return getExpandedFilePath(filepath, xContext);
- }
-
- rtl::OUString getExpandedFilePath(const rtl::OUString& filepath, const Reference<XComponentContext>& xContext)
- {
- Reference< util::XMacroExpander > xMacroExpander = util::theMacroExpander::get( xContext );
-
rtl::OUString aFilename = filepath;
if( aFilename.startsWith( "vnd.sun.star.expand:" ) )
@@ -44,16 +32,10 @@ namespace comphelper
aMacro = rtl::Uri::decode( aMacro, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
// expand macro string
- aFilename = xMacroExpander->expandMacros( aMacro );
- }
+ rtl::Bootstrap::expandMacros( aMacro);
- if( aFilename.startsWith( "file://" ) )
- {
- rtl::OUString aSysPath;
- if( osl_getSystemPathFromFileURL( aFilename.pData, &aSysPath.pData ) == osl_File_E_None )
- aFilename = aSysPath;
+ aFilename = aMacro;
}
-
return aFilename;
}
}