[Libreoffice-commits] core.git: cui/source include/unotools sd/source sfx2/source svtools/source unotools/source

Caolán McNamara caolanm at redhat.com
Tue Aug 18 13:00:14 PDT 2015


 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(-)

New commits:
commit 28f3464a571a23a2c16bd0980e9021b95d011511
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Aug 18 20:38:42 2015 +0100

    ConvertSystemPathToURL->getFileURLFromSystemPath
    
    Change-Id: I1c60c60f9b5318626f42e33091920a4404fb6d1c

diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 2cace41..4581dba 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 a7087f3..2943637 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 809104d..8d93bf0 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 44c3668..735ac0f 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -18,7 +18,7 @@
  */
 
 #include <editeng/numitem.hxx>
-
+#include <osl/file.hxx>
 #include <unotools/ucbstreamhelper.hxx>
 #include <vcl/wrkwin.hxx>
 #include <svl/urihelper.hxx>
@@ -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 432ac51..6a934f3 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -20,6 +20,7 @@
 #include <comphelper/string.hxx>
 #include <sfx2/linkmgr.hxx>
 #include <com/sun/star/document/UpdateDocMode.hpp>
+#include <osl/file.hxx>
 #include <sfx2/objsh.hxx>
 #include <svl/urihelper.hxx>
 #include <sot/formats.hxx>
@@ -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 8d0a96f..dbff62a 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 b04dd2e..52fb373 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)


More information about the Libreoffice-commits mailing list