Kaydet (Commit) 28f3464a authored tarafından Caolán McNamara's avatar Caolán McNamara

ConvertSystemPathToURL->getFileURLFromSystemPath

Change-Id: I1c60c60f9b5318626f42e33091920a4404fb6d1c
üst 75a8b1cf
...@@ -408,7 +408,7 @@ IMPL_LINK_NOARG(SvxHyperlinkNewDocTp, ClickNewHdl_Impl) ...@@ -408,7 +408,7 @@ IMPL_LINK_NOARG(SvxHyperlinkNewDocTp, ClickNewHdl_Impl)
OUString aStrURL; OUString aStrURL;
OUString aTempStrURL( m_pCbbPath->GetText() ); OUString aTempStrURL( m_pCbbPath->GetText() );
utl::LocalFileHelper::ConvertSystemPathToURL( aTempStrURL, aStrURL ); osl::FileBase::getFileURLFromSystemPath( aTempStrURL, aStrURL );
OUString aStrPath = aStrURL; OUString aStrPath = aStrURL;
bool bZeroPath = aStrPath.isEmpty(); bool bZeroPath = aStrPath.isEmpty();
......
...@@ -127,7 +127,7 @@ OUString SvxHyperlinkDocTp::GetCurrentURL () ...@@ -127,7 +127,7 @@ OUString SvxHyperlinkDocTp::GetCurrentURL ()
if ( aURL.GetProtocol() != INetProtocol::NotValid ) // maybe the path is already a valid if ( aURL.GetProtocol() != INetProtocol::NotValid ) // maybe the path is already a valid
aStrURL = aStrPath; // hyperlink, then we can use this path directly aStrURL = aStrPath; // hyperlink, then we can use this path directly
else else
utl::LocalFileHelper::ConvertSystemPathToURL( aStrPath, aStrURL ); osl::FileBase::getFileURLFromSystemPath( aStrPath, aStrURL );
//#105788# always create a URL even if it is not valid //#105788# always create a URL even if it is not valid
if( aStrURL == aEmptyStr ) if( aStrURL == aEmptyStr )
......
...@@ -35,7 +35,6 @@ namespace utl ...@@ -35,7 +35,6 @@ namespace utl
Returning sal_True and an empty URL means that the URL doesn't point to a local file. 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 ConvertPhysicalNameToURL(const OUString& rName, OUString& rReturn);
static bool ConvertSystemPathToURL( const OUString& rName, OUString& rReturn );
/** /**
Converts a "UCB compatible" URL into a "physical" file name. Converts a "UCB compatible" URL into a "physical" file name.
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#include <editeng/numitem.hxx> #include <editeng/numitem.hxx>
#include <osl/file.hxx>
#include <unotools/ucbstreamhelper.hxx> #include <unotools/ucbstreamhelper.hxx>
#include <vcl/wrkwin.hxx> #include <vcl/wrkwin.hxx>
#include <svl/urihelper.hxx> #include <svl/urihelper.hxx>
...@@ -2066,7 +2066,7 @@ void ImplSdPPTImport::FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiv ...@@ -2066,7 +2066,7 @@ void ImplSdPPTImport::FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiv
OUString aBookmarkURL( pInfo->GetBookmark() ); OUString aBookmarkURL( pInfo->GetBookmark() );
INetURLObject aURL( pPtr->aTarget ); INetURLObject aURL( pPtr->aTarget );
if( INetProtocol::NotValid == aURL.GetProtocol() ) if( INetProtocol::NotValid == aURL.GetProtocol() )
utl::LocalFileHelper::ConvertSystemPathToURL( pPtr->aTarget, aBookmarkURL ); osl::FileBase::getFileURLFromSystemPath( pPtr->aTarget, aBookmarkURL );
if( aBookmarkURL.isEmpty() ) if( aBookmarkURL.isEmpty() )
aBookmarkURL = URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), pPtr->aTarget, URIHelper::GetMaybeFileHdl(), true ); aBookmarkURL = URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), pPtr->aTarget, URIHelper::GetMaybeFileHdl(), true );
pInfo->SetBookmark( aBookmarkURL ); pInfo->SetBookmark( aBookmarkURL );
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <sfx2/linkmgr.hxx> #include <sfx2/linkmgr.hxx>
#include <com/sun/star/document/UpdateDocMode.hpp> #include <com/sun/star/document/UpdateDocMode.hpp>
#include <osl/file.hxx>
#include <sfx2/objsh.hxx> #include <sfx2/objsh.hxx>
#include <svl/urihelper.hxx> #include <svl/urihelper.hxx>
#include <sot/formats.hxx> #include <sot/formats.hxx>
...@@ -564,7 +565,7 @@ OUString lcl_DDE_RelToAbs( const OUString& rTopic, const OUString& rBaseURL ) ...@@ -564,7 +565,7 @@ OUString lcl_DDE_RelToAbs( const OUString& rTopic, const OUString& rBaseURL )
OUString sRet; OUString sRet;
INetURLObject aURL( rTopic ); INetURLObject aURL( rTopic );
if( INetProtocol::NotValid == aURL.GetProtocol() ) if( INetProtocol::NotValid == aURL.GetProtocol() )
utl::LocalFileHelper::ConvertSystemPathToURL( rTopic, sRet ); osl::FileBase::getFileURLFromSystemPath(rTopic, sRet);
if( sRet.isEmpty() ) if( sRet.isEmpty() )
sRet = URIHelper::SmartRel2Abs( INetURLObject(rBaseURL), rTopic, URIHelper::GetMaybeFileHdl(), true ); sRet = URIHelper::SmartRel2Abs( INetURLObject(rBaseURL), rTopic, URIHelper::GetMaybeFileHdl(), true );
return sRet; return sRet;
......
...@@ -538,7 +538,7 @@ OUString SvtURLBox::ParseSmart( const OUString& _aText, const OUString& _aBaseUR ...@@ -538,7 +538,7 @@ OUString SvtURLBox::ParseSmart( const OUString& _aText, const OUString& _aBaseUR
else else
{ {
OUString aTmpMatch; OUString aTmpMatch;
::utl::LocalFileHelper::ConvertSystemPathToURL( aText, aTmpMatch ); osl::FileBase::getFileURLFromSystemPath( aText, aTmpMatch );
aMatch = aTmpMatch; aMatch = aTmpMatch;
} }
......
...@@ -36,16 +36,6 @@ using namespace ::com::sun::star::ucb; ...@@ -36,16 +36,6 @@ using namespace ::com::sun::star::ucb;
namespace utl 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 LocalFileHelper::ConvertPhysicalNameToURL(const OUString& rName, OUString& rReturn)
{ {
bool ok = osl::FileBase::getFileURLFromSystemPath(rName, rReturn) bool ok = osl::FileBase::getFileURLFromSystemPath(rName, rReturn)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment