avmedia/source/framework/modeltools.cxx | 3 - avmedia/source/vlc/vlcframegrabber.cxx | 4 +- avmedia/source/win/framegrabber.cxx | 5 +-- connectivity/source/drivers/dbase/DIndex.cxx | 7 ++-- cui/source/dialogs/hldocntp.cxx | 1 cui/source/dialogs/hldoctp.cxx | 1 cui/source/dialogs/hltpbase.cxx | 3 + cui/source/dialogs/multipat.cxx | 3 + cui/source/options/optinet2.cxx | 9 +++-- cui/source/tabpages/tpline.cxx | 5 +-- dbaccess/source/ui/dlg/dbfindex.cxx | 3 + desktop/source/app/appinit.cxx | 9 +++-- editeng/source/items/flditem.cxx | 5 +-- filter/source/msfilter/msdffimp.cxx | 8 ++--- filter/source/pdf/pdfexport.cxx | 4 +- fpicker/source/office/iodlg.cxx | 14 ++++++--- framework/source/services/substitutepathvars.cxx | 3 - include/unotools/localfilehelper.hxx | 15 --------- lingucomponent/source/languageguessing/guesslang.cxx | 4 +- sc/source/core/data/globalx.cxx | 6 +-- sc/source/ui/collab/sccollaboration.cxx | 3 - sc/source/ui/docshell/externalrefmgr.cxx | 5 +-- sd/source/filter/html/htmlex.cxx | 3 - sd/source/filter/ppt/pptin.cxx | 11 ++++--- sd/source/ui/dlg/navigatr.cxx | 6 ++- sd/source/ui/view/sdview4.cxx | 4 +- sfx2/source/appl/appcfg.cxx | 26 ++++++++--------- sfx2/source/appl/linkmgr2.cxx | 4 +- sfx2/source/doc/docfac.cxx | 3 - sfx2/source/doc/docfile.cxx | 29 ++++++++++++------- sfx2/source/doc/new.cxx | 4 +- sfx2/source/doc/objstor.cxx | 3 - sfx2/source/doc/objxtor.cxx | 4 +- sfx2/source/doc/printhelper.cxx | 1 sfx2/source/inet/inettbc.cxx | 2 - sfx2/source/view/viewfrm.cxx | 5 +-- sot/source/sdstor/storage.cxx | 5 +-- svtools/source/control/inettbc.cxx | 8 +---- svtools/source/graphic/grfmgr.cxx | 4 +- svtools/source/misc/openfiledroptargetlistener.cxx | 3 - svtools/source/misc/templatefoldercache.cxx | 6 ++- svx/source/dialog/docrecovery.cxx | 3 - svx/source/gallery2/galtheme.cxx | 6 +-- svx/source/svdraw/svdotxln.cxx | 4 +- svx/source/unodraw/unoshap2.cxx | 4 +- sw/source/core/swg/SwXMLTextBlocks.cxx | 4 +- sw/source/filter/ww8/ww8par.cxx | 3 - unotools/source/config/defaultoptions.cxx | 4 +- unotools/source/config/pathoptions.cxx | 14 ++++----- unotools/source/ucbhelper/localfilehelper.cxx | 20 ------------- unotools/source/ucbhelper/ucbhelper.cxx | 5 +-- uui/source/fltdlg.cxx | 1 vcl/source/filter/graphicfilter.cxx | 3 - 53 files changed, 150 insertions(+), 172 deletions(-)
New commits: commit 236714e86c1c517d84d38395efabaf6e3793d196 Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Aug 19 10:43:19 2015 +0200 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 diff --git a/avmedia/source/framework/modeltools.cxx b/avmedia/source/framework/modeltools.cxx index c42e4c1..40d48a2 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 bb100c2..e2634f9 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 6330382..9ef4047 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 c904e17..57ee565 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 4581dba..d0aba8f 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 2943637..c1125c6 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 9764400..2107a5c 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 15e9a0b..c1d3bd5 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 59bee66..67d5fed 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 753bb92..1c3266c 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 45dd2c5..2ee6700 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 d510578..7940719 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 5df2649..c2a7e5d 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 aebe275..cd329f4 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 45938fb..455e2bc 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 e4c5637..65c0d44 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 e2e9d12..7a86ef6 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 d53115b..7c1be21 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 2b2da0e..488ce106 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 bd28c54..5430bb8 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 7dd6ef9..c275526 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 ce77550..870947c 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 9bef488..21f210c 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 735ac0f..063c6ec 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 a52c43c..343be42 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 bf55d94..1616d61 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 f7b5414..54cd152 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 6a934f3..3fa3e46 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 ba2ff68..4243181 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 e04b3ce..cb7b20b 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 29561b0..ac71fd7 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 2baa124..73ab864 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 45fd2e8..0a198b6 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 9e5c691..660c521 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 f23ec36..fc85b00 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 d15134e..b693a57 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 00a4801..9a23f5f 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 dbff62a..c0753a6 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 e39ee4c..64c4ee7 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 baec61c..8ea0147 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 4d7d9be..98e6160 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 629e645..c08b4b9 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 f1b8eca..e1ad481 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 a0d8910..dccb9cd 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 d6f60174..63b29ea 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 b7e0d25..9f2febd 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 ca90082..80e829d6 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 b937a10..fab7844 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 46bada4..2f4689c 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 bf46273..9afcd8a 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 98c30d0..ac3f4cf 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 9e34f82..13f81bb 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 5bf303e..997cc56 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits