summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-08-19 10:43:19 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-08-19 10:48:42 +0200
commit236714e86c1c517d84d38395efabaf6e3793d196 (patch)
tree32c17d639ef464fba371d7d3a02afac18af8bfdb
parente87c08babed9e3ac34908771fc95cab5386f01a2 (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
-rw-r--r--avmedia/source/framework/modeltools.cxx3
-rw-r--r--avmedia/source/vlc/vlcframegrabber.cxx4
-rw-r--r--avmedia/source/win/framegrabber.cxx5
-rw-r--r--connectivity/source/drivers/dbase/DIndex.cxx7
-rw-r--r--cui/source/dialogs/hldocntp.cxx1
-rw-r--r--cui/source/dialogs/hldoctp.cxx1
-rw-r--r--cui/source/dialogs/hltpbase.cxx3
-rw-r--r--cui/source/dialogs/multipat.cxx3
-rw-r--r--cui/source/options/optinet2.cxx9
-rw-r--r--cui/source/tabpages/tpline.cxx5
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.cxx3
-rw-r--r--desktop/source/app/appinit.cxx9
-rw-r--r--editeng/source/items/flditem.cxx5
-rw-r--r--filter/source/msfilter/msdffimp.cxx8
-rw-r--r--filter/source/pdf/pdfexport.cxx4
-rw-r--r--fpicker/source/office/iodlg.cxx14
-rw-r--r--framework/source/services/substitutepathvars.cxx3
-rw-r--r--include/unotools/localfilehelper.hxx15
-rw-r--r--lingucomponent/source/languageguessing/guesslang.cxx4
-rw-r--r--sc/source/core/data/globalx.cxx6
-rw-r--r--sc/source/ui/collab/sccollaboration.cxx3
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx5
-rw-r--r--sd/source/filter/html/htmlex.cxx3
-rw-r--r--sd/source/filter/ppt/pptin.cxx11
-rw-r--r--sd/source/ui/dlg/navigatr.cxx6
-rw-r--r--sd/source/ui/view/sdview4.cxx4
-rw-r--r--sfx2/source/appl/appcfg.cxx26
-rw-r--r--sfx2/source/appl/linkmgr2.cxx4
-rw-r--r--sfx2/source/doc/docfac.cxx3
-rw-r--r--sfx2/source/doc/docfile.cxx29
-rw-r--r--sfx2/source/doc/new.cxx4
-rw-r--r--sfx2/source/doc/objstor.cxx3
-rw-r--r--sfx2/source/doc/objxtor.cxx4
-rw-r--r--sfx2/source/doc/printhelper.cxx1
-rw-r--r--sfx2/source/inet/inettbc.cxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx5
-rw-r--r--sot/source/sdstor/storage.cxx5
-rw-r--r--svtools/source/control/inettbc.cxx8
-rw-r--r--svtools/source/graphic/grfmgr.cxx4
-rw-r--r--svtools/source/misc/openfiledroptargetlistener.cxx3
-rw-r--r--svtools/source/misc/templatefoldercache.cxx6
-rw-r--r--svx/source/dialog/docrecovery.cxx3
-rw-r--r--svx/source/gallery2/galtheme.cxx6
-rw-r--r--svx/source/svdraw/svdotxln.cxx4
-rw-r--r--svx/source/unodraw/unoshap2.cxx4
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par.cxx3
-rw-r--r--unotools/source/config/defaultoptions.cxx4
-rw-r--r--unotools/source/config/pathoptions.cxx14
-rw-r--r--unotools/source/ucbhelper/localfilehelper.cxx20
-rw-r--r--unotools/source/ucbhelper/ucbhelper.cxx5
-rw-r--r--uui/source/fltdlg.cxx1
-rw-r--r--vcl/source/filter/graphicfilter.cxx3
53 files changed, 150 insertions, 172 deletions
diff --git a/avmedia/source/framework/modeltools.cxx b/avmedia/source/framework/modeltools.cxx
index c42e4c130082..40d48a2c97ac 100644
--- a/avmedia/source/framework/modeltools.cxx
+++ b/avmedia/source/framework/modeltools.cxx
@@ -20,7 +20,6 @@
#include <comphelper/processfactory.hxx>
#include <tools/urlobj.hxx>
#include <ucbhelper/content.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -80,7 +79,7 @@ bool KmzDae2Gltf(const OUString& rSourceURL, OUString& o_rOutput)
// Create a temporary folder for conversion
OUString sOutput;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL(::utl::TempFile::CreateTempName(), sOutput);
+ osl::FileBase::getFileURLFromSystemPath(::utl::TempFile::CreateTempName(), sOutput);
// remove .tmp extension
sOutput = sOutput.copy(0, sOutput.getLength()-4);
diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index bb100c290af9..e2634f933f32 100644
--- a/avmedia/source/vlc/vlcframegrabber.cxx
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -21,11 +21,11 @@
#include <chrono>
#include <iostream>
#include <osl/conditn.hxx>
+#include <osl/file.hxx>
#include <vcl/graph.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/pngread.hxx>
#include <avmedia/mediawindow.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <tools/stream.hxx>
@@ -102,7 +102,7 @@ VLCFrameGrabber::VLCFrameGrabber( wrapper::EventHandler& eh, const rtl::OUString
}
rtl::OUString url;
- utl::LocalFileHelper::ConvertPhysicalNameToURL( fileName, url );
+ osl::FileBase::getFileURLFromSystemPath( fileName, url );
boost::shared_ptr<SvStream> stream( utl::UcbStreamHelper::CreateStream( url,
STREAM_STD_READ ) );
diff --git a/avmedia/source/win/framegrabber.cxx b/avmedia/source/win/framegrabber.cxx
index 63303827d76b..9ef404778213 100644
--- a/avmedia/source/win/framegrabber.cxx
+++ b/avmedia/source/win/framegrabber.cxx
@@ -36,9 +36,9 @@
#include "player.hxx"
#include <cppuhelper/supportsservice.hxx>
+#include <osl/file.hxx>
#include <tools/stream.hxx>
#include <vcl/graph.hxx>
-#include <unotools/localfilehelper.hxx>
#include <vcl/dibtools.hxx>
#define AVMEDIA_WIN_FRAMEGRABBER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.FrameGrabber_DirectX"
@@ -71,7 +71,8 @@ IMediaDet* FrameGrabber::implCreateMediaDet( const OUString& rURL ) const
{
OUString aLocalStr;
- if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( rURL, aLocalStr ) && !aLocalStr.isEmpty() )
+ if( osl::FileBase::getSystemPathFromFileURL( rURL, aLocalStr )
+ == osl::FileBase::E_None )
{
if( !SUCCEEDED( pDet->put_Filename( ::SysAllocString( reinterpret_cast<LPCOLESTR>(aLocalStr.getStr()) ) ) ) )
{
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index c904e1743d69..57ee565a3f4a 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -24,6 +24,7 @@
#include <comphelper/sequence.hxx>
#include "dbase/DTable.hxx"
#include "dbase/DIndexIter.hxx"
+#include <osl/file.hxx>
#include <tools/config.hxx>
#include <connectivity/CommonTools.hxx>
#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
@@ -31,7 +32,6 @@
#include <com/sun/star/sdbcx/XRowLocate.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <comphelper/extract.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/ucbhelper.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
@@ -388,7 +388,7 @@ void ODbaseIndex::createINFEntry()
".inf");
OUString sPhysicalPath;
- LocalFileHelper::ConvertURLToPhysicalName(sCfgFile, sPhysicalPath);
+ osl::FileBase::getSystemPathFromFileURL(sCfgFile, sPhysicalPath);
Config aInfFile(sPhysicalPath);
aInfFile.SetGroup(dBASE_III_GROUP);
@@ -430,7 +430,8 @@ bool ODbaseIndex::DropImpl()
m_pTable->getName() + ".inf";
OUString sPhysicalPath;
- OSL_VERIFY_RES( LocalFileHelper::ConvertURLToPhysicalName(sCfgFile, sPhysicalPath),
+ OSL_VERIFY_RES( osl::FileBase::getSystemPathFromFileURL(sCfgFile, sPhysicalPath)
+ == osl::FileBase::E_None,
"Can not convert Config Filename into Physical Name!");
Config aInfFile(sPhysicalPath);
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 4581dbad2d45..d0aba8f9cdd7 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -25,7 +25,6 @@
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/uno/Exception.hpp>
-#include <unotools/localfilehelper.hxx>
#include <vcl/image.hxx>
#include <tools/urlobj.hxx>
#include <unotools/pathoptions.hxx>
diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx
index 2943637a2a30..c1125c6ba211 100644
--- a/cui/source/dialogs/hldoctp.cxx
+++ b/cui/source/dialogs/hldoctp.cxx
@@ -19,7 +19,6 @@
#include "cuihyperdlg.hxx"
#include <osl/file.hxx>
-#include <unotools/localfilehelper.hxx>
#include <sfx2/filedlghelper.hxx>
#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 9764400f5f2e..2107a5c8b234 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
#include <osl/file.hxx>
#include <sfx2/frame.hxx>
#include <sfx2/viewfrm.hxx>
@@ -24,7 +26,6 @@
#include <sfx2/sfxsids.hrc>
#include <svl/macitem.hxx>
#include <ucbhelper/content.hxx>
-#include <unotools/localfilehelper.hxx>
#include "cuihyperdlg.hxx"
#include "hltpbase.hxx"
#include "macroass.hxx"
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index 15e9a0b1afd7..c1d3bd5d72d6 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
#include <osl/file.hxx>
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
@@ -32,7 +34,6 @@
#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <unotools/localfilehelper.hxx>
#include <unotools/pathoptions.hxx>
#include "svtools/treelistentry.hxx"
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 59bee66ad0a7..67d5fed7124c 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -43,7 +43,6 @@
#include <sfx2/viewfrm.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/securityoptions.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/extendedsecurityoptions.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -1089,14 +1088,18 @@ IMPL_LINK( SvxEMailTabPage, FileDialogHdl_Impl, PushButton*, pButton )
sPath = "/usr/bin";
OUString sUrl;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL(sPath, sUrl);
+ osl::FileBase::getFileURLFromSystemPath(sPath, sUrl);
aHelper.SetDisplayDirectory(sUrl);
aHelper.AddFilter( m_sDefaultFilterName, OUString("*"));
if ( ERRCODE_NONE == aHelper.Execute() )
{
sUrl = aHelper.GetPath();
- ::utl::LocalFileHelper::ConvertURLToPhysicalName(sUrl, sPath);
+ if (osl::FileBase::getSystemPathFromFileURL(sUrl, sPath)
+ != osl::FileBase::E_None)
+ {
+ sPath.clear();
+ }
m_pMailerURLED->SetText(sPath);
}
}
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 753bb9249a47..1c3266c32e0f 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -18,6 +18,7 @@
*/
#include <editeng/sizeitem.hxx>
+#include <osl/file.hxx>
#include <tools/urlobj.hxx>
#include <sfx2/app.hxx>
#include <sfx2/module.hxx>
@@ -45,7 +46,6 @@
#include <sfx2/objsh.hxx>
#include <editeng/brushitem.hxx>
#include <svx/gallery.hxx>
-#include <unotools/localfilehelper.hxx>
#include "paragrph.hrc"
#include "sfx2/opengrf.hxx"
#include <svx/dialmgr.hxx>
@@ -309,7 +309,8 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton)
// Convert URL encodings to UI characters (e.g. %20 for spaces)
OUString aPhysicalName;
- if (utl::LocalFileHelper::ConvertURLToPhysicalName(*it, aPhysicalName))
+ if (osl::FileBase::getSystemPathFromFileURL(*it, aPhysicalName)
+ == osl::FileBase::E_None)
{
pUIName = &aPhysicalName;
}
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index 45dd2c53b090..2ee6700967c4 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -19,6 +19,7 @@
#include "dbfindex.hxx"
#include <comphelper/processfactory.hxx>
+#include <osl/file.hxx>
#include <tools/config.hxx>
#include <sfx2/app.hxx>
#include "moduledbu.hxx"
@@ -323,7 +324,7 @@ void ODbaseIndexDialog::Init()
for(;pBegin != pEnd;++pBegin)
{
OUString aName;
- ::utl::LocalFileHelper::ConvertURLToPhysicalName(pBegin->getStr(),aName);
+ osl::FileBase::getSystemPathFromFileURL(pBegin->getStr(),aName);
aURL.SetSmartURL(aName);
OUString aExt = aURL.getExtension();
if (aExt == aIndexExt)
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index d51057868269..794071953dcd 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -49,7 +49,6 @@
#include <rtl/instance.hxx>
#include <comphelper/processfactory.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/ucbhelper.hxx>
#include <unotools/tempfile.hxx>
#include <vcl/svapp.hxx>
@@ -283,7 +282,7 @@ void Desktop::CreateTemporaryDirectory()
OUString aTempPath( aTempBaseURL );
// create new current temporary directory
- ::utl::LocalFileHelper::ConvertURLToPhysicalName( aTempBaseURL, aRet );
+ osl::FileBase::getSystemPathFromFileURL( aTempBaseURL, aRet );
::osl::FileBase::getFileURLFromSystemPath( aRet, aTempPath );
aTempPath = ::utl::TempFile::SetTempNameBaseDirectory( aTempPath );
if ( aTempPath.isEmpty() )
@@ -299,7 +298,11 @@ void Desktop::CreateTemporaryDirectory()
}
// set new current temporary directory
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aTempPath, aRet );
+ if (osl::FileBase::getFileURLFromSystemPath( aTempPath, aRet )
+ != osl::FileBase::E_None)
+ {
+ aRet.clear();
+ }
CurrentTempURL::get() = aRet;
}
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 5df2649ca3da..c2a7e5d12412 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -18,12 +18,11 @@
*/
#include <comphelper/string.hxx>
+#include <osl/file.hxx>
#include <vcl/metaact.hxx>
#include <svl/zforlist.hxx>
#include <tools/urlobj.hxx>
-#include <unotools/localfilehelper.hxx>
-
#include <editeng/flditem.hxx>
#include <editeng/measfld.hxx>
#include "editeng/unonames.hxx"
@@ -1013,7 +1012,7 @@ OUString SvxExtFileField::GetFormatted() const
// invalid? try to interpret string as system file name
OUString aURLStr;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aFile, aURLStr );
+ osl::FileBase::getFileURLFromSystemPath( aFile, aURLStr );
aURLObj.SetURL( aURLStr );
}
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index aebe275c41a0..cd329f4d0a24 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -23,6 +23,7 @@
#include <limits.h>
#include <vector>
#include <osl/endian.h>
+#include <osl/file.hxx>
#include <tools/solar.h>
#include <rtl/math.hxx>
@@ -48,7 +49,6 @@
#include <tools/debug.hxx>
#include <tools/zcodec.hxx>
#include <unotools/ucbstreamhelper.hxx>
-#include <unotools/localfilehelper.hxx>
#include <filter/msfilter/escherex.hxx>
#include <basegfx/range/b2drange.hxx>
#include <com/sun/star/container/XIdentifierContainer.hpp>
@@ -266,7 +266,7 @@ void DffPropertyReader::ReadPropSet( SvStream& rIn, void* pClientData ) const
OUString aURLStr;
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( OUString("d:\\ashape.dbg"), aURLStr ) )
+ if( osl::FileBase::getFileURLFromSystemPath( OUString("d:\\ashape.dbg"), aURLStr ) == osl::FileBase::E_None )
{
std::unique_ptr<SvStream> xOut(::utl::UcbStreamHelper::CreateStream( aURLStr, StreamMode::WRITE ));
@@ -3951,7 +3951,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
if ( !INetURLObject( maBaseURL ).GetNewAbsURL( aFileName, &aAbsURL ) )
{
OUString aValidURL;
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aFileName, aValidURL ) )
+ if( osl::FileBase::getFileURLFromSystemPath( aFileName, aValidURL ) == osl::FileBase::E_None )
aAbsURL = INetURLObject( aValidURL );
}
if( aAbsURL.GetProtocol() != INetProtocol::NotValid )
@@ -6374,7 +6374,7 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, Rect
}
OUString aURLStr;
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( Application::GetAppFileName(), aURLStr ) )
+ if( osl::FileBase::getFileURLFromSystemPath( Application::GetAppFileName(), aURLStr ) == osl::FileBase::E_None )
{
INetURLObject aURL( aURLStr );
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 45938fb10fc5..455e2bccaef5 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -22,6 +22,7 @@
#include "impdialog.hxx"
#include "pdf.hrc"
+#include <osl/file.hxx>
#include "tools/urlobj.hxx"
#include "tools/fract.hxx"
#include "tools/poly.hxx"
@@ -33,7 +34,6 @@
#include "vcl/bmpacc.hxx"
#include "vcl/svapp.hxx"
#include "toolkit/awt/vclxdevice.hxx"
-#include "unotools/localfilehelper.hxx"
#include <vcl/FilterConfigItem.hxx>
#include <vcl/graphicfilter.hxx>
#include <vcl/settings.hxx>
@@ -384,7 +384,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
{
OUString aTmp;
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rFile, aTmp ) )
+ if( osl::FileBase::getFileURLFromSystemPath( rFile, aTmp ) == osl::FileBase::E_None )
aURL = INetURLObject(aTmp);
}
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index e4c5637006a7..65c0d444786d 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
#include <sal/macros.h>
#include "iodlg.hxx"
#include <svtools/PlaceEditDialog.hxx>
@@ -39,7 +41,6 @@
#include "svtools/svtabbx.hxx"
#include "svtools/treelistentry.hxx"
#include <toolkit/helper/vclunohelper.hxx>
-#include <unotools/localfilehelper.hxx>
#include "svtools/helpid.hrc"
#include <svtools/svtools.hrc>
@@ -211,7 +212,8 @@ namespace
if ( INetProtocol::NotValid == aURL.GetProtocol() )
{
OUString sURL;
- if ( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aNewFile, sURL ) )
+ if ( osl::FileBase::getFileURLFromSystemPath( aNewFile, sURL )
+ == osl::FileBase::E_None )
aURL = INetURLObject( sURL );
}
if ( INetProtocol::File == aURL.GetProtocol() )
@@ -1784,8 +1786,12 @@ void SvtFileDialog::displayIOException( const OUString& _rURL, IOErrorCode _eCod
try
{
// create make a human-readable string from the URL
- OUString sDisplayPath( _rURL );
- osl::FileBase::getSystemPathFromFileURL(_rURL, sDisplayPath);
+ OUString sDisplayPath;
+ if (osl::FileBase::getSystemPathFromFileURL(_rURL, sDisplayPath)
+ == osl::FileBase::E_None)
+ {
+ sDisplayPath = _rURL;
+ }
// build an own exception which tells "access denied"
InteractiveAugmentedIOException aException;
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index e2e9d12bace1..7a86ef6cdcc8 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -25,7 +25,6 @@
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <unotools/configitem.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/bootstrap.hxx>
@@ -794,7 +793,7 @@ OUString SubstitutePathVariables::ConvertOSLtoUCBURL( const OUString& aOSLCompli
OUString aTemp;
osl::FileBase::getSystemPathFromFileURL( aOSLCompliantURL, aTemp );
- utl::LocalFileHelper::ConvertPhysicalNameToURL( aTemp, aResult );
+ osl::FileBase::getFileURLFromSystemPath( aTemp, aResult );
// Not all OSL URL's can be mapped to UCB URL's!
if ( aResult.isEmpty() )
diff --git a/include/unotools/localfilehelper.hxx b/include/unotools/localfilehelper.hxx
index d53115bfcee5..7c1be21b7e5c 100644
--- a/include/unotools/localfilehelper.hxx
+++ b/include/unotools/localfilehelper.hxx
@@ -29,21 +29,6 @@ namespace utl
class UNOTOOLS_DLLPUBLIC LocalFileHelper
{
public:
- /**
- Converts a "physical" file name into a "UCB compatible" URL ( if possible ).
- If no UCP is available for the local file system, sal_False and an empty URL is returned.
- 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);
-
- /**
- Converts a "UCB compatible" URL into a "physical" file name.
- If no UCP is available for the local file system, sal_False and an empty file name is returned,
- otherwise sal_True and a valid URL, because a file name can always be converted if a UCP for the local
- file system is present ( watch: this doesn't mean that this file really exists! )
- */
- static bool ConvertURLToPhysicalName( const OUString& rName, OUString& rReturn );
-
static bool IsFileUrl(const OUString& rUrl);
static ::com::sun::star::uno::Sequence< OUString >
diff --git a/lingucomponent/source/languageguessing/guesslang.cxx b/lingucomponent/source/languageguessing/guesslang.cxx
index 2b2da0e0e544..488ce106eb26 100644
--- a/lingucomponent/source/languageguessing/guesslang.cxx
+++ b/lingucomponent/source/languageguessing/guesslang.cxx
@@ -20,6 +20,7 @@
#include <iostream>
#include <boost/noncopyable.hpp>
+#include <osl/file.hxx>
#include <tools/debug.hxx>
#include <sal/config.h>
@@ -34,7 +35,6 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
#include <unotools/pathoptions.hxx>
-#include <unotools/localfilehelper.hxx>
#include <osl/thread.h>
#include <sal/macros.h>
@@ -124,7 +124,7 @@ void LangGuess_Impl::EnsureInitialized()
// set default fingerprint path to where those get installed
OUString aPhysPath;
OUString aURL( SvtPathOptions().GetFingerprintPath() );
- utl::LocalFileHelper::ConvertURLToPhysicalName( aURL, aPhysPath );
+ osl::FileBase::getSystemPathFromFileURL( aURL, aPhysPath );
#ifdef WNT
aPhysPath += "\\";
#else
diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx
index bd28c5472037..5430bb8cf9d3 100644
--- a/sc/source/core/data/globalx.cxx
+++ b/sc/source/core/data/globalx.cxx
@@ -20,9 +20,9 @@
#include "callform.hxx"
#include "global.hxx"
#include <osl/diagnose.h>
+#include <osl/file.hxx>
#include <tools/urlobj.hxx>
#include <ucbhelper/content.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/pathoptions.hxx>
@@ -56,10 +56,8 @@ void ScGlobal::InitAddIns()
if (aPath.isEmpty())
continue;
- // use LocalFileHelper to convert the path to a URL that always points
- // to the file on the server
OUString aUrl;
- if ( utl::LocalFileHelper::ConvertPhysicalNameToURL( aPath, aUrl ) )
+ if ( osl::FileBase::getFileURLFromSystemPath( aPath, aUrl ) == osl::FileBase::E_None )
aPath = aUrl;
INetURLObject aObj;
diff --git a/sc/source/ui/collab/sccollaboration.cxx b/sc/source/ui/collab/sccollaboration.cxx
index 7dd6ef9eba2e..c275526d7bdb 100644
--- a/sc/source/ui/collab/sccollaboration.cxx
+++ b/sc/source/ui/collab/sccollaboration.cxx
@@ -14,7 +14,6 @@
#include <com/sun/star/document/XDocumentRecovery.hpp>
#include <unotools/mediadescriptor.hxx>
#include <unotools/tempfile.hxx>
-#include <unotools/localfilehelper.hxx>
ScCollaboration::ScCollaboration( ScDocShell* pScDocShell ) :
mpScDocShell( pScDocShell )
@@ -48,7 +47,7 @@ void ScCollaboration::SaveAndSendFile( TpContact* pContact ) const
aTmpPath += ".ods";
OUString aFileURL;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aTmpPath, aFileURL );
+ osl::FileBase::getFileURLFromSystemPath( aTmpPath, aFileURL );
utl::MediaDescriptor aDescriptor;
// some issue with hyperlinks:
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index ce775508dab0..870947ce7b71 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -33,6 +33,7 @@
#include "globstr.hrc"
#include "cellvalue.hxx"
+#include <osl/file.hxx>
#include <sfx2/app.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
@@ -49,7 +50,6 @@
#include <sfx2/linkmgr.hxx>
#include <tools/urlobj.hxx>
#include <unotools/ucbhelper.hxx>
-#include <unotools/localfilehelper.hxx>
#include <vcl/msgbox.hxx>
#include "stringutil.hxx"
#include "scmatrix.hxx"
@@ -2456,7 +2456,8 @@ bool ScExternalRefManager::isFileLoadable(const OUString& rFile) const
if (isOwnDocument(rFile))
return false;
OUString aPhysical;
- if (utl::LocalFileHelper::ConvertURLToPhysicalName(rFile, aPhysical) && !aPhysical.isEmpty())
+ if (osl::FileBase::getSystemPathFromFileURL(rFile, aPhysical)
+ == osl::FileBase::E_None)
{
// #i114504# try IsFolder/Exists only for file URLs
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index 9bef488e8301..21f210c603d0 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -30,7 +30,6 @@
#include <unotools/pathoptions.hxx>
#include <vcl/FilterConfigItem.hxx>
#include <unotools/ucbstreamhelper.hxx>
-#include <unotools/localfilehelper.hxx>
#include <com/sun/star/frame/XStorable.hpp>
#include <sfx2/app.hxx>
#include <sfx2/dispatch.hxx>
@@ -3209,7 +3208,7 @@ sal_uLong EasyFile::createFileName( const OUString& rURL, OUString& rFileName )
if( aURL.GetProtocol() == INetProtocol::NotValid )
{
OUString aURLStr;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rURL, aURLStr );
+ osl::FileBase::getFileURLFromSystemPath( rURL, aURLStr );
aURL = INetURLObject( aURLStr );
}
DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 735ac0f3ae2c..063c6ec176ce 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -75,7 +75,6 @@
#include <unotools/fltrcfg.hxx>
#include <sfx2/progress.hxx>
-#include <unotools/localfilehelper.hxx>
#include <editeng/editstat.hxx>
#include <unotools/pathoptions.hxx>
#include <sfx2/docfac.hxx>
@@ -1969,7 +1968,8 @@ OUString ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef ) const
OUString aStr;
if ( ReadString( aStr ) )
{
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aStr, aRetVal ) )
+ if( osl::FileBase::getFileURLFromSystemPath( aStr, aRetVal )
+ == osl::FileBase::E_None )
{
aRetVal = INetURLObject( aRetVal ).GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS );
}else{
@@ -2065,8 +2065,11 @@ void ImplSdPPTImport::FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiv
OUString aBaseURL = pDocShell->GetMedium()->GetBaseURL();
OUString aBookmarkURL( pInfo->GetBookmark() );
INetURLObject aURL( pPtr->aTarget );
- if( INetProtocol::NotValid == aURL.GetProtocol() )
- osl::FileBase::getFileURLFromSystemPath( pPtr->aTarget, aBookmarkURL );
+ if( INetProtocol::NotValid == aURL.GetProtocol()
+ && (osl::FileBase::getFileURLFromSystemPath(
+ pPtr->aTarget, aBookmarkURL)
+ != osl::FileBase::E_None) )
+ aBookmarkURL.clear();
if( aBookmarkURL.isEmpty() )
aBookmarkURL = URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), pPtr->aTarget, URIHelper::GetMaybeFileHdl(), true );
pInfo->SetBookmark( aBookmarkURL );
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index a52c43c7dd9f..343be422b595 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -17,8 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <osl/file.hxx>
#include <tools/urlobj.hxx>
-#include <unotools/localfilehelper.hxx>
#include <sfx2/imgmgr.hxx>
#include <sfx2/fcontnr.hxx>
#include <svl/eitem.hxx>
@@ -593,7 +595,7 @@ bool SdNavigatorWin::InsertFile(const OUString& rFileName)
if( aURL.GetProtocol() == INetProtocol::NotValid )
{
OUString aURLStr;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rFileName, aURLStr );
+ osl::FileBase::getFileURLFromSystemPath( rFileName, aURLStr );
aURL = INetURLObject( aURLStr );
}
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index bf55d9439357..1616d619d711 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -18,7 +18,7 @@
*/
#include "View.hxx"
-#include <unotools/localfilehelper.hxx>
+#include <osl/file.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/request.hxx>
#include <sfx2/docfilt.hxx>
@@ -418,7 +418,7 @@ IMPL_LINK_NOARG_TYPED(View, DropInsertFileHdl, Idle *, void)
if( aURL.GetProtocol() == INetProtocol::NotValid )
{
OUString aURLStr;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aCurrentDropFile, aURLStr );
+ osl::FileBase::getFileURLFromSystemPath( aCurrentDropFile, aURLStr );
aURL = INetURLObject( aURLStr );
}
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index f7b541433c4b..54cd1528c4bb 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/util/XFlushable.hpp>
+#include <osl/file.hxx>
#include <stdlib.h>
#include <vcl/msgbox.hxx>
@@ -51,7 +52,6 @@
#include <unotools/pathoptions.hxx>
#include <svtools/miscopt.hxx>
#include <vcl/toolbox.hxx>
-#include <unotools/localfilehelper.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <vcl/idle.hxx>
@@ -448,7 +448,7 @@ bool SfxApplication::GetOptions( SfxItemSet& rSet )
OUString aValue;
switch ( nProp )
{
- case SvtPathOptions::PATH_ADDIN: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetAddinPath(), aValue ); break;
+ case SvtPathOptions::PATH_ADDIN: osl::FileBase::getFileURLFromSystemPath( aPathCfg.GetAddinPath(), aValue ); break;
case SvtPathOptions::PATH_AUTOCORRECT: aValue = aPathCfg.GetAutoCorrectPath(); break;
case SvtPathOptions::PATH_AUTOTEXT: aValue = aPathCfg.GetAutoTextPath(); break;
case SvtPathOptions::PATH_BACKUP: aValue = aPathCfg.GetBackupPath(); break;
@@ -457,15 +457,15 @@ bool SfxApplication::GetOptions( SfxItemSet& rSet )
case SvtPathOptions::PATH_CONFIG: aValue = aPathCfg.GetConfigPath(); break;
case SvtPathOptions::PATH_DICTIONARY: aValue = aPathCfg.GetDictionaryPath(); break;
case SvtPathOptions::PATH_FAVORITES: aValue = aPathCfg.GetFavoritesPath(); break;
- case SvtPathOptions::PATH_FILTER: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetFilterPath(), aValue ); break;
+ case SvtPathOptions::PATH_FILTER: osl::FileBase::getFileURLFromSystemPath( aPathCfg.GetFilterPath(), aValue ); break;
case SvtPathOptions::PATH_GALLERY: aValue = aPathCfg.GetGalleryPath(); break;
case SvtPathOptions::PATH_GRAPHIC: aValue = aPathCfg.GetGraphicPath(); break;
- case SvtPathOptions::PATH_HELP: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetHelpPath(), aValue ); break;
+ case SvtPathOptions::PATH_HELP: osl::FileBase::getFileURLFromSystemPath( aPathCfg.GetHelpPath(), aValue ); break;
case SvtPathOptions::PATH_LINGUISTIC: aValue = aPathCfg.GetLinguisticPath(); break;
- case SvtPathOptions::PATH_MODULE: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetModulePath(), aValue ); break;
+ case SvtPathOptions::PATH_MODULE: osl::FileBase::getFileURLFromSystemPath( aPathCfg.GetModulePath(), aValue ); break;
case SvtPathOptions::PATH_PALETTE: aValue = aPathCfg.GetPalettePath(); break;
- case SvtPathOptions::PATH_PLUGIN: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetPluginPath(), aValue ); break;
- case SvtPathOptions::PATH_STORAGE: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetStoragePath(), aValue ); break;
+ case SvtPathOptions::PATH_PLUGIN: osl::FileBase::getFileURLFromSystemPath( aPathCfg.GetPluginPath(), aValue ); break;
+ case SvtPathOptions::PATH_STORAGE: osl::FileBase::getFileURLFromSystemPath( aPathCfg.GetStoragePath(), aValue ); break;
case SvtPathOptions::PATH_TEMP: aValue = aPathCfg.GetTempPath(); break;
case SvtPathOptions::PATH_TEMPLATE: aValue = aPathCfg.GetTemplatePath(); break;
case SvtPathOptions::PATH_USERCONFIG: aValue = aPathCfg.GetUserConfigPath(); break;
@@ -798,7 +798,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet)
case SvtPathOptions::PATH_ADDIN:
{
OUString aTmp;
- if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
+ if( osl::FileBase::getSystemPathFromFileURL( sValue, aTmp ) == osl::FileBase::E_None )
aPathOptions.SetAddinPath( aTmp );
break;
}
@@ -814,7 +814,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet)
case SvtPathOptions::PATH_FILTER:
{
OUString aTmp;
- if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
+ if( osl::FileBase::getSystemPathFromFileURL( sValue, aTmp ) == osl::FileBase::E_None )
aPathOptions.SetFilterPath( aTmp );
break;
}
@@ -823,7 +823,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet)
case SvtPathOptions::PATH_HELP:
{
OUString aTmp;
- if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
+ if( osl::FileBase::getSystemPathFromFileURL( sValue, aTmp ) == osl::FileBase::E_None )
aPathOptions.SetHelpPath( aTmp );
break;
}
@@ -832,7 +832,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet)
case SvtPathOptions::PATH_MODULE:
{
OUString aTmp;
- if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
+ if( osl::FileBase::getSystemPathFromFileURL( sValue, aTmp ) == osl::FileBase::E_None )
aPathOptions.SetModulePath( aTmp );
break;
}
@@ -841,7 +841,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet)
case SvtPathOptions::PATH_PLUGIN:
{
OUString aTmp;
- if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
+ if( osl::FileBase::getSystemPathFromFileURL( sValue, aTmp ) == osl::FileBase::E_None )
aPathOptions.SetPluginPath( aTmp );
break;
}
@@ -849,7 +849,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet)
case SvtPathOptions::PATH_STORAGE:
{
OUString aTmp;
- if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
+ if( osl::FileBase::getSystemPathFromFileURL( sValue, aTmp ) == osl::FileBase::E_None )
aPathOptions.SetStoragePath( aTmp );
break;
}
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 6a934f31c6a8..3fa3e4665fdf 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -34,7 +34,6 @@
#include <svl/stritem.hxx>
#include <svl/eitem.hxx>
#include <svl/intitem.hxx>
-#include <unotools/localfilehelper.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <sfx2/request.hxx>
#include <vcl/dibtools.hxx>
@@ -431,7 +430,8 @@ void LinkManager::ReconnectDdeLink(SfxObjectShell& rServer)
OUString aTmp;
OUString aURL = aFile;
- if (utl::LocalFileHelper::ConvertPhysicalNameToURL(aFile, aTmp))
+ if (osl::FileBase::getFileURLFromSystemPath(aFile, aTmp)
+ == osl::FileBase::E_None)
aURL = aTmp;
if (!aURL.equalsIgnoreAsciiCase(pMed->GetName()))
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index ba2ff680d591..4243181297f1 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -29,7 +29,6 @@
#include <unotools/pathoptions.hxx>
#include <unotools/moduleoptions.hxx>
#include <unotools/ucbstreamhelper.hxx>
-#include <unotools/localfilehelper.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/configurationhelper.hxx>
@@ -203,7 +202,7 @@ void SfxObjectFactory::SetSystemTemplate( const OUString& rServiceName, const OU
sal_Unicode aPathBuffer[nMaxPathSize];
if ( SystemPath::GetUserTemplateLocation( aPathBuffer, nMaxPathSize ))
sPath = OUString( aPathBuffer );
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPath, sURL );
+ osl::FileBase::getFileURLFromSystemPath( sPath, sURL );
OUString aUserTemplateURL( sURL );
if ( !aUserTemplateURL.isEmpty())
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index e04b3ce22d54..cb7b20bc79a8 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -433,7 +433,7 @@ Reference < XContent > SfxMedium::GetContent() const
// TODO: SAL_WARN( "sfx.doc", "SfxMedium::GetContent()\nCreate Content? This code exists as fallback only. Please clarify, why its used.");
OUString aURL;
if ( !pImp->m_aName.isEmpty() )
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( pImp->m_aName, aURL );
+ osl::FileBase::getFileURLFromSystemPath( pImp->m_aName, aURL );
else if ( !pImp->m_aLogicName.isEmpty() )
aURL = GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
if (!aURL.isEmpty() )
@@ -685,7 +685,8 @@ bool SfxMedium::IsStorage()
if ( pImp->pTempFile )
{
OUString aURL;
- if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( pImp->m_aName, aURL ) )
+ if ( osl::FileBase::getFileURLFromSystemPath( pImp->m_aName, aURL )
+ == osl::FileBase::E_None )
{
SAL_WARN( "sfx.doc", "Physical name not convertible!");
}
@@ -999,7 +1000,8 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI )
// the file is not readonly, check the ACL
OUString aPhysPath;
- if ( ::utl::LocalFileHelper::ConvertURLToPhysicalName( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), aPhysPath ) )
+ if ( osl::FileBase::getSystemPathFromFileURL( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), aPhysPath )
+ == osl::FileBase::E_None )
bContentReadonly = IsReadonlyAccordingACL( aPhysPath.getStr() );
}
#endif
@@ -1316,7 +1318,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( bool bCreateTempIfNo )
pImp->xStorage = comphelper::OStorageHelper::GetStorageFromURL( aTmpName, embed::ElementModes::READ );
pImp->bStorageBasedOnInStream = false;
OUString aTemp;
- ::utl::LocalFileHelper::ConvertURLToPhysicalName( aTmpName, aTemp );
+ osl::FileBase::getSystemPathFromFileURL( aTmpName, aTemp );
SetPhysicalName_Impl( aTemp );
pImp->bIsTemp = true;
@@ -1732,7 +1734,8 @@ void SfxMedium::Transfer_Impl()
else if ( !pImp->m_aLogicName.isEmpty() && pImp->m_bSalvageMode )
{
// makes sense only in case logic name is set
- if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( pImp->m_aName, aNameURL ) )
+ if ( osl::FileBase::getFileURLFromSystemPath( pImp->m_aName, aNameURL )
+ != osl::FileBase::E_None )
SAL_WARN( "sfx.doc", "The medium name is not convertible!" );
}
@@ -2011,8 +2014,12 @@ void SfxMedium::Transfer_Impl()
if ( ( !pImp->m_eError || (pImp->m_eError & ERRCODE_WARNING_MASK) ) && !pImp->pTempFile )
{
// without a TempFile the physical and logical name should be the same after successful transfer
- ::utl::LocalFileHelper::ConvertURLToPhysicalName(
- GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), pImp->m_aName );
+ if (osl::FileBase::getSystemPathFromFileURL(
+ GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), pImp->m_aName )
+ != osl::FileBase::E_None)
+ {
+ pImp->m_aName.clear();
+ }
pImp->m_bSalvageMode = false;
}
}
@@ -2248,7 +2255,8 @@ void SfxMedium::GetMedium_Impl()
OUString aFileName;
if (!pImp->m_aName.isEmpty())
{
- if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( pImp->m_aName, aFileName ) )
+ if ( osl::FileBase::getFileURLFromSystemPath( pImp->m_aName, aFileName )
+ != osl::FileBase::E_None )
{
SAL_WARN( "sfx.doc", "Physical name not convertible!");
}
@@ -2425,7 +2433,7 @@ void SfxMedium::Init_Impl()
// try to convert the URL into a physical name - but never change a physical name
// physical name may be set if the logical name is changed after construction
if ( pImp->m_aName.isEmpty() )
- ::utl::LocalFileHelper::ConvertURLToPhysicalName( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), pImp->m_aName );
+ osl::FileBase::getSystemPathFromFileURL( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), pImp->m_aName );
else
{
DBG_ASSERT( pSalvageItem, "Suspicious change of logical name!" );
@@ -2932,7 +2940,8 @@ SfxMedium::~SfxMedium()
if( pImp->bIsTemp && !pImp->m_aName.isEmpty() )
{
OUString aTemp;
- if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( pImp->m_aName, aTemp ))
+ if ( osl::FileBase::getFileURLFromSystemPath( pImp->m_aName, aTemp )
+ != osl::FileBase::E_None )
{
SAL_WARN( "sfx.doc", "Physical name not convertible!");
}
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index 29561b0ef791..ac71fd744cbf 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -18,6 +18,7 @@
*/
#include <comphelper/string.hxx>
+#include <osl/file.hxx>
#include <sfx2/new.hxx>
#include <vcl/builderfactory.hxx>
#include <vcl/layout.hxx>
@@ -29,7 +30,6 @@
#include <svtools/sfxecode.hxx>
#include <svtools/ehdl.hxx>
#include <tools/urlobj.hxx>
-#include <unotools/localfilehelper.hxx>
#include "doc.hrc"
#include <sfx2/app.hxx>
@@ -196,7 +196,7 @@ IMPL_LINK_NOARG_TYPED(SfxNewFileDialog_Impl, Update, Idle*, void)
// temp. fix until Templates are managed by UCB compatible service
// does NOT work with locally cached components !
OUString aTemp;
- utl::LocalFileHelper::ConvertPhysicalNameToURL( aFileName, aTemp );
+ osl::FileBase::getFileURLFromSystemPath( aFileName, aTemp );
aFileName = aTemp;
}
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 2baa124f7b95..73ab864526f8 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -82,7 +82,6 @@
#include <unotools/pathoptions.hxx>
#include <tools/urlobj.hxx>
#include <tools/diagnose_ex.h>
-#include <unotools/localfilehelper.hxx>
#include <unotools/ucbhelper.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/docinfohelper.hxx>
@@ -651,7 +650,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
if ( pSalvageItem )
{
OUString aName( pMed->GetPhysicalName() );
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aBaseURL );
+ osl::FileBase::getFileURLFromSystemPath( aName, aBaseURL );
}
else
aBaseURL = pMed->GetBaseURL();
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 45fd2e8271e7..0a198b61c271 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XTitle.hpp>
+#include <osl/file.hxx>
#include <osl/mutex.hxx>
#include <rtl/instance.hxx>
#include <vcl/msgbox.hxx>
@@ -66,7 +67,6 @@
#include <svl/urihelper.hxx>
#include <unotools/pathoptions.hxx>
#include <svl/sharecontrolfile.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/ucbhelper.hxx>
#include <svtools/asynclink.hxx>
#include <tools/diagnose_ex.h>
@@ -398,7 +398,7 @@ SfxObjectShell::~SfxObjectShell()
if ( !pImp->aTempName.isEmpty() )
{
OUString aTmp;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( pImp->aTempName, aTmp );
+ osl::FileBase::getFileURLFromSystemPath( pImp->aTempName, aTmp );
::utl::UCBContentHelper::Kill( aTmp );
}
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 9e5c69132f64..660c52127733 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -36,7 +36,6 @@
#include <svl/intitem.hxx>
#include <svl/eitem.hxx>
#include <unotools/tempfile.hxx>
-#include <unotools/localfilehelper.hxx>
#include <osl/file.hxx>
#include <osl/thread.hxx>
#include <tools/urlobj.hxx>
diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx
index f23ec36d29b0..fc85b0055cff 100644
--- a/sfx2/source/inet/inettbc.cxx
+++ b/sfx2/source/inet/inettbc.cxx
@@ -36,11 +36,9 @@
#include <svl/itemset.hxx>
#include <svl/urihelper.hxx>
-#include <unotools/pathoptions.hxx>
#include <svtools/asynclink.hxx>
#include <svtools/inettbc.hxx>
-#include <unotools/localfilehelper.hxx>
#include <comphelper/processfactory.hxx>
#include <sfx2/sfx.hrc>
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index d15134eb7bd0..b693a5736a59 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -18,7 +18,7 @@
*/
#include <config_features.h>
-
+#include <osl/file.hxx>
#include <sfx2/infobar.hxx>
#include <sfx2/viewfrm.hxx>
#include <com/sun/star/document/MacroExecMode.hpp>
@@ -67,7 +67,6 @@
#include <com/sun/star/task/InteractionHandler.hpp>
#include <rtl/ustrbuf.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/ucbhelper.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/namedvaluecollection.hxx>
@@ -426,7 +425,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// doing
OUString aTemp;
- utl::LocalFileHelper::ConvertPhysicalNameToURL( pMed->GetPhysicalName(), aTemp );
+ osl::FileBase::getFileURLFromSystemPath( pMed->GetPhysicalName(), aTemp );
INetURLObject aPhysObj( aTemp );
SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(),
pVersionItem, SfxInt16Item, SID_VERSION, false );
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index 00a4801d0778..9a23f5f17933 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -33,7 +33,6 @@
#include <unotools/ucbstreamhelper.hxx>
#include <tools/debug.hxx>
#include <tools/urlobj.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/ucbhelper.hxx>
#include <comphelper/processfactory.hxx>
#include <memory>
@@ -385,7 +384,7 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode, bool tr
if ( aObj.GetProtocol() == INetProtocol::NotValid )
{
OUString aURL;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( m_aName, aURL );
+ osl::FileBase::getFileURLFromSystemPath( m_aName, aURL );
aObj.SetURL( aURL );
m_aName = aObj.GetMainURL( INetURLObject::NO_DECODE );
}
@@ -568,7 +567,7 @@ bool SotStorage::IsStorageFile( const OUString & rFileName )
if ( aObj.GetProtocol() == INetProtocol::NotValid )
{
OUString aURL;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aURL );
+ osl::FileBase::getFileURLFromSystemPath( aName, aURL );
aObj.SetURL( aURL );
aName = aObj.GetMainURL( INetURLObject::NO_DECODE );
}
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index dbff62aa0ea1..c0753a61047a 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -55,7 +55,6 @@
#include <unotools/pathoptions.hxx>
#include <ucbhelper/commandenvironment.hxx>
#include <ucbhelper/content.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/ucbhelper.hxx>
#include <svtools/asynclink.hxx>
#include <svl/urlfilter.hxx>
@@ -233,8 +232,8 @@ IMPL_LINK_NOARG( SvtMatchContext_Impl, Select_Impl )
OUString sCompletion(*i);
// convert the file into an URL
- OUString sURL( sCompletion );
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sCompletion, sURL );
+ OUString sURL;
+ osl::FileBase::getFileURLFromSystemPath( sCompletion, sURL );
// note: if this doesn't work, we're not interested in: we're checking the
// untouched sCompletion then
@@ -569,11 +568,10 @@ void SvtMatchContext_Impl::doExecute()
return;
OUString aMatch;
- OUString aWorkDir( SvtPathOptions().GetWorkPath() );
INetProtocol eProt = INetURLObject::CompareProtocolScheme( aText );
INetProtocol eBaseProt = INetURLObject::CompareProtocolScheme( aBaseURL );
if ( aBaseURL.isEmpty() )
- eBaseProt = INetURLObject::CompareProtocolScheme( aWorkDir );
+ eBaseProt = INetURLObject::CompareProtocolScheme( SvtPathOptions().GetWorkPath() );
INetProtocol eSmartProt = pBox->GetSmartProtocol();
// if the user input is a valid URL, go on with it
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index e39ee4cbdb23..64c4ee7f247d 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -22,11 +22,11 @@
#include <algorithm>
#include <officecfg/Office/Common.hxx>
+#include <osl/file.hxx>
#include <tools/vcompat.hxx>
#include <tools/fract.hxx>
#include <tools/helpers.hxx>
#include <unotools/ucbstreamhelper.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/tempfile.hxx>
#include <unotools/configmgr.hxx>
#include <vcl/svapp.hxx>
@@ -237,7 +237,7 @@ void GraphicObject::ImplAutoSwapIn()
{
OUString aURLStr;
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( GetLink(), aURLStr ) )
+ if( osl::FileBase::getFileURLFromSystemPath( GetLink(), aURLStr ) == osl::FileBase::E_None )
{
boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( aURLStr, StreamMode::READ ));
diff --git a/svtools/source/misc/openfiledroptargetlistener.cxx b/svtools/source/misc/openfiledroptargetlistener.cxx
index baec61c590d9..8ea014741d4b 100644
--- a/svtools/source/misc/openfiledroptargetlistener.cxx
+++ b/svtools/source/misc/openfiledroptargetlistener.cxx
@@ -27,7 +27,6 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <svtools/transfer.hxx>
-#include <unotools/localfilehelper.hxx>
#include <sot/filelist.hxx>
#include <comphelper/processfactory.hxx>
@@ -194,7 +193,7 @@ bool OpenFileDropTargetListener::implts_IsDropFormatSupported( SotClipboardForma
void OpenFileDropTargetListener::implts_OpenFile( const OUString& rFilePath )
{
OUString aFileURL;
- if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( rFilePath, aFileURL ) )
+ if ( osl::FileBase::getFileURLFromSystemPath( rFilePath, aFileURL ) != osl::FileBase::E_None )
aFileURL = rFilePath;
::osl::FileStatus aStatus( osl_FileStatus_Mask_FileURL );
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index 4d7d9bec26d1..98e6160404ba 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -17,9 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <osl/file.hxx>
#include <svtools/templatefoldercache.hxx>
#include <unotools/ucbstreamhelper.hxx>
-#include <unotools/localfilehelper.hxx>
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/ucb/XDynamicResultSet.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
@@ -565,7 +567,7 @@ namespace svt
if ( INetProtocol::NotValid == aParser.GetProtocol() )
{
OUString sURL;
- LocalFileHelper::ConvertPhysicalNameToURL( _rPath, sURL );
+ osl::FileBase::getFileURLFromSystemPath( _rPath, sURL );
aParser.SetURL( sURL, INetURLObject::WAS_ENCODED );
}
return aParser.GetMainURL( INetURLObject::DECODE_TO_IURI );
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index 629e6455d9de..c08b4b9f7bc9 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -55,7 +55,6 @@
#include <osl/security.hxx>
#include <rtl/bootstrap.hxx>
#include <unotools/pathoptions.hxx>
-#include <unotools/localfilehelper.hxx>
#include "svtools/treelistentry.hxx"
#include <officecfg/Office/Recovery.hxx>
#include <boost/scoped_ptr.hpp>
@@ -1337,7 +1336,7 @@ IMPL_LINK_NOARG(BrokenRecoveryDialog, OkButtonHdl)
{
OUString sPhysicalPath = comphelper::string::strip(m_pSaveDirED->GetText(), ' ');
OUString sURL;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPhysicalPath, sURL );
+ osl::FileBase::getFileURLFromSystemPath( sPhysicalPath, sURL );
m_sSavePath = sURL;
while (m_sSavePath.isEmpty())
impl_askForSavePath();
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index f1b8ecac0ef1..e1ad48142975 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -24,12 +24,12 @@
#include <algorithm>
#include <comphelper/processfactory.hxx>
+#include <osl/file.hxx>
#include <tools/urlobj.hxx>
#include <tools/vcompat.hxx>
#include <unotools/streamwrap.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/tempfile.hxx>
-#include <unotools/localfilehelper.hxx>
#include <ucbhelper/content.hxx>
#include <sot/storage.hxx>
#include <sot/formats.hxx>
@@ -1215,7 +1215,7 @@ bool GalleryTheme::InsertTransferable( const uno::Reference< datatransfer::XTran
{
OUString aLocalURL;
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aFile, aLocalURL ) )
+ if( osl::FileBase::getFileURLFromSystemPath( aFile, aLocalURL ) == osl::FileBase::E_None )
aURL = INetURLObject( aLocalURL );
}
@@ -1468,7 +1468,7 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm )
pObj->aURL = INetURLObject( aFileName );
if( ( pObj->aURL.GetProtocol() == INetProtocol::NotValid ) &&
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aFileName, aLocalURL ) )
+ osl::FileBase::getFileURLFromSystemPath( aFileName, aLocalURL ) == osl::FileBase::E_None )
{
pObj->aURL = INetURLObject( aLocalURL );
}
diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx
index a0d8910d960c..dccb9cd7cb80 100644
--- a/svx/source/svdraw/svdotxln.cxx
+++ b/svx/source/svdraw/svdotxln.cxx
@@ -20,9 +20,9 @@
#include "sal/config.h"
#include <comphelper/processfactory.hxx>
+#include <osl/file.hxx>
#include <osl/thread.h>
#include <unotools/ucbstreamhelper.hxx>
-#include <unotools/localfilehelper.hxx>
#include <ucbhelper/content.hxx>
#include <unotools/datetime.hxx>
#include <svx/svdotext.hxx>
@@ -212,7 +212,7 @@ bool SdrTextObj::LoadText(const OUString& rFileName, const OUString& /*rFilterNa
{
OUString aFileURLStr;
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rFileName, aFileURLStr ) )
+ if( osl::FileBase::getFileURLFromSystemPath( rFileName, aFileURLStr ) == osl::FileBase::E_None )
aFileURL = INetURLObject( aFileURLStr );
else
aFileURL.SetSmartURL( rFileName );
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index d6f6017470d7..63b29ea8205e 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -28,8 +28,8 @@
#include <com/sun/star/drawing/PointSequence.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <tools/urlobj.hxx>
-#include <unotools/localfilehelper.hxx>
#include <vcl/svapp.hxx>
+#include <osl/file.hxx>
#include <osl/mutex.hxx>
#include <vcl/fltcall.hxx>
#include <vcl/graphicfilter.hxx>
@@ -1504,7 +1504,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte
{
OUString aValidURL;
- if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aURL, aValidURL ) )
+ if( osl::FileBase::getFileURLFromSystemPath( aURL, aValidURL ) == osl::FileBase::E_None )
aURLObj = INetURLObject( aValidURL );
}
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index b7e0d256cc57..9f2febddb611 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -19,11 +19,11 @@
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <osl/file.hxx>
#include <rtl/ustring.hxx>
#include <sot/stg.hxx>
#include <sfx2/docfile.hxx>
#include <tools/urlobj.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <comphelper/storagehelper.hxx>
@@ -521,7 +521,7 @@ bool SwXMLTextBlocks::IsFileUCBStorage( const OUString & rFileName)
if ( aObj.GetProtocol() == INetProtocol::NotValid )
{
OUString aURL;
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aURL );
+ osl::FileBase::getFileURLFromSystemPath( aName, aURL );
aObj.SetURL( aURL );
aName = aObj.GetMainURL( INetURLObject::NO_DECODE );
}
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index ca9008218a62..80e829d6ac03 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -122,7 +122,6 @@
#include <iostream>
#include <dbgoutsw.hxx>
#endif
-#include <unotools/localfilehelper.hxx>
#include <svx/hlnkitem.hxx>
#include "WW8Sttbf.hxx"
@@ -4743,7 +4742,7 @@ void SwWW8ImplReader::ReadDocInfo()
OUString aURL;
// attempt to convert to url (won't work for obvious reasons on linux)
if ( !sPath.isEmpty() )
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPath, aURL );
+ osl::FileBase::getFileURLFromSystemPath( sPath, aURL );
if (aURL.isEmpty())
xDocProps->setTemplateURL( aURL );
else
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)
diff --git a/uui/source/fltdlg.cxx b/uui/source/fltdlg.cxx
index 9e34f82906ef..13f81bb2ae38 100644
--- a/uui/source/fltdlg.cxx
+++ b/uui/source/fltdlg.cxx
@@ -187,7 +187,6 @@ class StringCalculator : public ::cppu::WeakImplHelper1< ::com::sun::star::util:
@descr We detect type of given URL automatically and build this short name depend on this type ...
If we couldnt make it right we return full given string without any changes ...
- @seealso class LocalFileHelper
@seealso method InetURLObject::getAbbreviated()
@param "sName", file name
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 5bf303e7b2fa..997cc56ea614 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -59,7 +59,6 @@
#include <com/sun/star/xml/sax/Writer.hpp>
#include <com/sun/star/ucb/CommandAbortedException.hpp>
#include <unotools/ucbstreamhelper.hxx>
-#include <unotools/localfilehelper.hxx>
#include <rtl/bootstrap.hxx>
#include <rtl/instance.hxx>
#include <vcl/metaact.hxx>
@@ -1136,7 +1135,7 @@ void GraphicFilter::ImplInit()
{
OUString url("$BRAND_BASE_DIR/" LIBO_LIB_FOLDER);
rtl::Bootstrap::expandMacros(url); //TODO: detect failure
- utl::LocalFileHelper::ConvertURLToPhysicalName(url, aFilterPath);
+ osl::FileBase::getSystemPathFromFileURL(url, aFilterPath);
}
pErrorEx = new FilterErrorEx;