diff options
author | Vishv Brahmbhatt <vishvbrahmbhatt19@gmail.com> | 2013-09-13 01:01:52 +0530 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-12-03 20:30:18 +0100 |
commit | 9de4fe985349401fda68e8384860b14ef6b071d2 (patch) | |
tree | 2e8618c1881635aa19262e292a8b6c6e69d1fba8 /unotools | |
parent | 5d8001c801efeed3dced312862d667d650b5dbfa (diff) |
Code clean-up/consolidation task.
Removing the duplicate code,and consolidating changes
by using method "getExpandedFilePath" of comphelper.
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>: adapted to recent change
from comphelper::getExpandedFilePath to comphelper::getExpandedUri; fixed the
two changes in framework to actually modify the by--non-const--ref argument;
fixed a loplugin:unreffun. More clean-up to follow.
Change-Id: Ie8875bcb61b616385bd64151f0a915bf7cce04e5
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/lingucfg.cxx | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index 24f9fc2c488e..cd504ec4b4d2 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -27,7 +27,6 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/container/XNameReplace.hpp> -#include <com/sun/star/util/theMacroExpander.hpp> #include <rtl/uri.hxx> #include <rtl/instance.hxx> #include <osl/mutex.hxx> @@ -37,7 +36,7 @@ #include <unotools/lingucfg.hxx> #include <unotools/linguprops.hxx> #include <sal/macros.h> - +#include <comphelper/getexpandeduri.hxx> #include <comphelper/processfactory.hxx> #include "itemholder1.hxx" @@ -46,7 +45,6 @@ using namespace com::sun::star; using ::rtl::Uri; -#define EXPAND_PROTOCOL "vnd.sun.star.expand:" #define FILE_PROTOCOL "file:///" namespace @@ -933,17 +931,10 @@ static bool lcl_GetFileUrlFromOrigin( if (!rOrigin.isEmpty()) { OUString aURL( rOrigin ); - if ( aURL.startsWith( EXPAND_PROTOCOL ) ) + if ( aURL.startsWith( "vnd.sun.star.expand:" ) ) { - // cut protocol - OUString aMacro( aURL.copy( sizeof ( EXPAND_PROTOCOL ) -1 ) ); - // decode uric class chars - aMacro = Uri::decode( aMacro, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); - // expand macro string - aURL = util::theMacroExpander::get( - comphelper::getProcessComponentContext() )->expandMacros( - aMacro ); - + aURL = comphelper::getExpandedUri( + comphelper::getProcessComponentContext(), aURL); bool bIsFileUrl = aURL.startsWith( FILE_PROTOCOL ); if (bIsFileUrl) { |