From 28f3464a571a23a2c16bd0980e9021b95d011511 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 18 Aug 2015 20:38:42 +0100 Subject: ConvertSystemPathToURL->getFileURLFromSystemPath Change-Id: I1c60c60f9b5318626f42e33091920a4404fb6d1c --- cui/source/dialogs/hldocntp.cxx | 2 +- cui/source/dialogs/hldoctp.cxx | 2 +- include/unotools/localfilehelper.hxx | 1 - sd/source/filter/ppt/pptin.cxx | 4 ++-- sfx2/source/appl/linkmgr2.cxx | 3 ++- svtools/source/control/inettbc.cxx | 2 +- unotools/source/ucbhelper/localfilehelper.cxx | 10 ---------- 7 files changed, 7 insertions(+), 17 deletions(-) diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx index 2cace41ede29..4581dbad2d45 100644 --- a/cui/source/dialogs/hldocntp.cxx +++ b/cui/source/dialogs/hldocntp.cxx @@ -408,7 +408,7 @@ IMPL_LINK_NOARG(SvxHyperlinkNewDocTp, ClickNewHdl_Impl) OUString aStrURL; OUString aTempStrURL( m_pCbbPath->GetText() ); - utl::LocalFileHelper::ConvertSystemPathToURL( aTempStrURL, aStrURL ); + osl::FileBase::getFileURLFromSystemPath( aTempStrURL, aStrURL ); OUString aStrPath = aStrURL; bool bZeroPath = aStrPath.isEmpty(); diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx index a7087f3efa75..2943637a2a30 100644 --- a/cui/source/dialogs/hldoctp.cxx +++ b/cui/source/dialogs/hldoctp.cxx @@ -127,7 +127,7 @@ OUString SvxHyperlinkDocTp::GetCurrentURL () if ( aURL.GetProtocol() != INetProtocol::NotValid ) // maybe the path is already a valid aStrURL = aStrPath; // hyperlink, then we can use this path directly else - utl::LocalFileHelper::ConvertSystemPathToURL( aStrPath, aStrURL ); + osl::FileBase::getFileURLFromSystemPath( aStrPath, aStrURL ); //#105788# always create a URL even if it is not valid if( aStrURL == aEmptyStr ) diff --git a/include/unotools/localfilehelper.hxx b/include/unotools/localfilehelper.hxx index 809104de8e12..8d93bf036b6d 100644 --- a/include/unotools/localfilehelper.hxx +++ b/include/unotools/localfilehelper.hxx @@ -35,7 +35,6 @@ namespace utl Returning sal_True and an empty URL means that the URL doesn't point to a local file. */ static bool ConvertPhysicalNameToURL(const OUString& rName, OUString& rReturn); - static bool ConvertSystemPathToURL( const OUString& rName, OUString& rReturn ); /** Converts a "UCB compatible" URL into a "physical" file name. diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 44c366892b34..735ac0f3ae2c 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -18,7 +18,7 @@ */ #include - +#include #include #include #include @@ -2066,7 +2066,7 @@ void ImplSdPPTImport::FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiv OUString aBookmarkURL( pInfo->GetBookmark() ); INetURLObject aURL( pPtr->aTarget ); if( INetProtocol::NotValid == aURL.GetProtocol() ) - utl::LocalFileHelper::ConvertSystemPathToURL( pPtr->aTarget, aBookmarkURL ); + osl::FileBase::getFileURLFromSystemPath( pPtr->aTarget, aBookmarkURL ); if( aBookmarkURL.isEmpty() ) aBookmarkURL = URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), pPtr->aTarget, URIHelper::GetMaybeFileHdl(), true ); pInfo->SetBookmark( aBookmarkURL ); diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 432ac511e771..6a934f31c6a8 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -564,7 +565,7 @@ OUString lcl_DDE_RelToAbs( const OUString& rTopic, const OUString& rBaseURL ) OUString sRet; INetURLObject aURL( rTopic ); if( INetProtocol::NotValid == aURL.GetProtocol() ) - utl::LocalFileHelper::ConvertSystemPathToURL( rTopic, sRet ); + osl::FileBase::getFileURLFromSystemPath(rTopic, sRet); if( sRet.isEmpty() ) sRet = URIHelper::SmartRel2Abs( INetURLObject(rBaseURL), rTopic, URIHelper::GetMaybeFileHdl(), true ); return sRet; diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 8d0a96f7ba8d..dbff62aa0ea1 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -538,7 +538,7 @@ OUString SvtURLBox::ParseSmart( const OUString& _aText, const OUString& _aBaseUR else { OUString aTmpMatch; - ::utl::LocalFileHelper::ConvertSystemPathToURL( aText, aTmpMatch ); + osl::FileBase::getFileURLFromSystemPath( aText, aTmpMatch ); aMatch = aTmpMatch; } diff --git a/unotools/source/ucbhelper/localfilehelper.cxx b/unotools/source/ucbhelper/localfilehelper.cxx index b04dd2e11717..52fb3739cdd3 100644 --- a/unotools/source/ucbhelper/localfilehelper.cxx +++ b/unotools/source/ucbhelper/localfilehelper.cxx @@ -36,16 +36,6 @@ using namespace ::com::sun::star::ucb; namespace utl { -bool LocalFileHelper::ConvertSystemPathToURL( const OUString& rName, OUString& rReturn ) -{ - bool ok = osl::FileBase::getFileURLFromSystemPath(rName, rReturn) - == osl::FileBase::E_None; - if (!ok) { - rReturn.clear(); - } - return ok; -} - bool LocalFileHelper::ConvertPhysicalNameToURL(const OUString& rName, OUString& rReturn) { bool ok = osl::FileBase::getFileURLFromSystemPath(rName, rReturn) -- cgit