diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-08-19 10:43:19 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-08-19 10:48:42 +0200 |
commit | 236714e86c1c517d84d38395efabaf6e3793d196 (patch) | |
tree | 32c17d639ef464fba371d7d3a02afac18af8bfdb /unotools | |
parent | e87c08babed9e3ac34908771fc95cab5386f01a2 (diff) |
Clean up remaining utl::LocalFileHelper::Convert...
together with 58d68a1bc9146334376206ae7ba8b1a6594a1040
"ConvertURLToSystemPath->getSystemPathFromFileURL" and
28f3464a571a23a2c16bd0980e9021b95d011511
"ConvertSystemPathToURL->getFileURLFromSystemPath," this replaces all those
Convert... functionality with direct calls to the corresponding osl::FileBase
functions.
Change-Id: I2876171cd337a5eb939d25d8cf1e0c1253ff73a7
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/defaultoptions.cxx | 4 | ||||
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 14 | ||||
-rw-r--r-- | unotools/source/ucbhelper/localfilehelper.cxx | 20 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucbhelper.cxx | 5 |
4 files changed, 12 insertions, 31 deletions
diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx index b937a10d84bc..fab784414d80 100644 --- a/unotools/source/config/defaultoptions.cxx +++ b/unotools/source/config/defaultoptions.cxx @@ -19,6 +19,7 @@ #include <sal/config.h> +#include <osl/file.hxx> #include <sal/log.hxx> #include <unotools/defaultoptions.hxx> #include <unotools/pathoptions.hxx> @@ -30,7 +31,6 @@ #include <com/sun/star/uno/Sequence.hxx> #include <osl/mutex.hxx> -#include <unotools/localfilehelper.hxx> #include <rtl/instance.hxx> #include "itemholder1.hxx" @@ -204,7 +204,7 @@ OUString SvtDefaultOptions_Impl::GetDefaultPath( sal_uInt16 nId ) const nId == SvtPathOptions::PATH_PLUGIN ) { OUString aTmp; - ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aRet, aTmp ); + osl::FileBase::getFileURLFromSystemPath( aRet, aTmp ); aRet = aTmp; } diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 46bada49e3e3..2f4689c719b1 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -29,7 +29,6 @@ #include <com/sun/star/uno/Sequence.hxx> #include <osl/mutex.hxx> #include <osl/file.hxx> -#include <unotools/localfilehelper.hxx> #include <unotools/bootstrap.hxx> #include <unotools/ucbhelper.hxx> @@ -241,7 +240,7 @@ const OUString& SvtPathOptions_Impl::GetPath( SvtPathOptions::Paths ePath ) ) { // These office paths have to be converted to system pates - utl::LocalFileHelper::ConvertURLToPhysicalName( aPathValue, aResult ); + osl::FileBase::getSystemPathFromFileURL( aPathValue, aResult ); aPathValue = aResult; } @@ -275,7 +274,7 @@ void SvtPathOptions_Impl::SetPath( SvtPathOptions::Paths ePath, const OUString& case SvtPathOptions::PATH_STORAGE: { // These office paths have to be convert back to UCB-URL's - utl::LocalFileHelper::ConvertPhysicalNameToURL( rNewPath, aResult ); + osl::FileBase::getFileURLFromSystemPath( rNewPath, aResult ); aNewValue = aResult; } break; @@ -379,7 +378,7 @@ OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar ) const { // Convert the URL to a system path for special path variables OUString aReturn; - utl::LocalFileHelper::ConvertURLToPhysicalName( aWorkText, aReturn ); + osl::FileBase::getSystemPathFromFileURL( aWorkText, aReturn ); return aReturn; } @@ -795,7 +794,8 @@ bool SvtPathOptions::SearchFile( OUString& rIniFile, Paths ePath ) { bIsURL = false; OUString aURL; - if ( LocalFileHelper::ConvertPhysicalNameToURL( aPathToken, aURL ) ) + if ( osl::FileBase::getFileURLFromSystemPath( aPathToken, aURL ) + == osl::FileBase::E_None ) aObj.SetURL( aURL ); } if ( aObj.GetProtocol() == INetProtocol::VndSunStarExpand ) @@ -819,8 +819,8 @@ bool SvtPathOptions::SearchFile( OUString& rIniFile, Paths ePath ) { if ( !bIsURL ) { - OUString sTmp(rIniFile); - ::utl::LocalFileHelper::ConvertURLToPhysicalName( + OUString sTmp; + osl::FileBase::getSystemPathFromFileURL( aObj.GetMainURL( INetURLObject::NO_DECODE ), sTmp ); rIniFile = sTmp; } diff --git a/unotools/source/ucbhelper/localfilehelper.cxx b/unotools/source/ucbhelper/localfilehelper.cxx index bf4627378df4..9afcd8a33f41 100644 --- a/unotools/source/ucbhelper/localfilehelper.cxx +++ b/unotools/source/ucbhelper/localfilehelper.cxx @@ -36,26 +36,6 @@ using namespace ::com::sun::star::ucb; namespace utl { -bool LocalFileHelper::ConvertPhysicalNameToURL(const OUString& rName, OUString& rReturn) -{ - bool ok = osl::FileBase::getFileURLFromSystemPath(rName, rReturn) - == osl::FileBase::E_None; - if (!ok) { - rReturn.clear(); - } - return ok; -} - -bool LocalFileHelper::ConvertURLToPhysicalName(const OUString& rName, OUString& rReturn) -{ - bool ok = osl::FileBase::getSystemPathFromFileURL(rName, rReturn) - == osl::FileBase::E_None; - if (!ok) { - rReturn.clear(); - } - return ok; -} - bool LocalFileHelper::IsFileUrl(const OUString& rUrl) { return rUrl.startsWithIgnoreAsciiCase("file:"); diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 98c30d0f5fa6..ac3f4cf63b7a 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -56,7 +56,6 @@ #include <tools/urlobj.hxx> #include <ucbhelper/commandenvironment.hxx> #include <ucbhelper/content.hxx> -#include <unotools/localfilehelper.hxx> #include <unotools/ucbhelper.hxx> namespace { @@ -348,7 +347,9 @@ bool utl::UCBContentHelper::IsYounger( bool utl::UCBContentHelper::Exists(OUString const & url) { OUString pathname; - if (utl::LocalFileHelper::ConvertURLToPhysicalName(url, pathname)) { + if (osl::FileBase::getSystemPathFromFileURL(url, pathname) + == osl::FileBase::E_None) + { // Try to create a directory entry for the given URL: OUString url2; if (osl::FileBase::getFileURLFromSystemPath(pathname, url2) |