diff options
49 files changed, 146 insertions, 146 deletions
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx index e8e4750db3b3..f64a630cd027 100644 --- a/connectivity/source/drivers/dbase/DIndex.cxx +++ b/connectivity/source/drivers/dbase/DIndex.cxx @@ -393,7 +393,7 @@ void ODbaseIndex::createINFEntry() sCfgFile += m_pTable->getName(); sCfgFile += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".inf")); - String sPhysicalPath; + rtl::OUString sPhysicalPath; LocalFileHelper::ConvertURLToPhysicalName(sCfgFile,sPhysicalPath); Config aInfFile(sPhysicalPath); @@ -436,9 +436,9 @@ sal_Bool ODbaseIndex::DropImpl() sCfgFile += m_pTable->getName(); sCfgFile += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".inf")); - String sPhysicalPath; - String sNDX(sCfgFile); - OSL_VERIFY_RES( LocalFileHelper::ConvertURLToPhysicalName(sNDX,sPhysicalPath),"Can not convert Config Filename into Physical Name!"); + rtl::OUString sPhysicalPath; + OSL_VERIFY_RES( LocalFileHelper::ConvertURLToPhysicalName(sCfgFile, sPhysicalPath), + "Can not convert Config Filename into Physical Name!"); Config aInfFile(sPhysicalPath); aInfFile.SetGroup(dBASE_III_GROUP); diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index e0c7c7aac574..bcf0c6000a40 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -1422,19 +1422,19 @@ IMPL_LINK( SvxEMailTabPage, FileDialogHdl_Impl, PushButton*, pButton ) FileDialogHelper aHelper( com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0 ); - String sPath = aMailerURLED.GetText(); - if ( !sPath.Len() ) - sPath.AppendAscii("/usr/bin"); + rtl::OUString sPath = aMailerURLED.GetText(); + if ( sPath.isEmpty() ) + sPath = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/usr/bin")); - String sUrl; - ::utl::LocalFileHelper::ConvertPhysicalNameToURL(sPath,sUrl); + rtl::OUString sUrl; + ::utl::LocalFileHelper::ConvertPhysicalNameToURL(sPath, sUrl); aHelper.SetDisplayDirectory(sUrl); aHelper.AddFilter( m_sDefaultFilterName, String::CreateFromAscii("*")); if ( ERRCODE_NONE == aHelper.Execute() ) { sUrl = aHelper.GetPath(); - ::utl::LocalFileHelper::ConvertURLToPhysicalName(sUrl,sPath); + ::utl::LocalFileHelper::ConvertURLToPhysicalName(sUrl, sPath); aMailerURLED.SetText(sPath); } } diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index 3a27eaace18b..63700aacfc6e 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -1470,8 +1470,12 @@ IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton ) // convert URL encodings to UI characters (eg %20 for spaces) String aPhysicalName; - if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( *it, aPhysicalName )) + rtl::OUString sTmp; + if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( *it, sTmp )) + { + aPhysicalName = sTmp; pUIName = &aPhysicalName; + } SvxBrushItem* pBrushItem = new SvxBrushItem(*it, aEmptyStr, GPOS_AREA, SID_ATTR_BRUSH); pBrushItem->SetDoneLink(STATIC_LINK(this, SvxLineTabPage, GraphicArrivedHdl_Impl)); diff --git a/dbaccess/source/ext/adabas/AdabasNewDb.cxx b/dbaccess/source/ext/adabas/AdabasNewDb.cxx index 27296c3f808f..c1abf3f46e68 100644 --- a/dbaccess/source/ext/adabas/AdabasNewDb.cxx +++ b/dbaccess/source/ext/adabas/AdabasNewDb.cxx @@ -328,7 +328,7 @@ OAdabasNewDbDlg::OAdabasNewDbDlg( Window* pParent, } - if(m_SYSDEV_File.Len() < 41 && m_TRANSDEV_File.Len() < 41 && m_DATADEV_File.Len() < 41) + if(m_SYSDEV_File.getLength() < 41 && m_TRANSDEV_File.getLength() < 41 && m_DATADEV_File.getLength() < 41) { m_ET_SYSDEVSPACE.SetText(m_SYSDEV_File ); m_ET_TRANSACTIONLOG.SetText(m_TRANSDEV_File); @@ -418,7 +418,7 @@ IMPL_LINK( OAdabasNewDbDlg, ImplOKHdl, OKButton*, /*EMPTYARG*/ ) return 0; } } - else if(m_SYSDEV_File.Len() > 40 || m_TRANSDEV_File.Len() > 40 || m_DATADEV_File.Len() > 40) + else if(m_SYSDEV_File.getLength() > 40 || m_TRANSDEV_File.getLength() > 40 || m_DATADEV_File.getLength() > 40) { InfoBox aInfo(this,ModuleRes(INFO_STR_MAX_FILE_LENGTH)); String aMsg(aInfo.GetMessText()); @@ -433,22 +433,22 @@ IMPL_LINK( OAdabasNewDbDlg, ImplOKHdl, OKButton*, /*EMPTYARG*/ ) { // we need url - String sTemp; + rtl::OUString sTemp; bOk = LocalFileHelper::ConvertPhysicalNameToURL(m_DATADEV_File,sTemp); m_DATADEV_File = sTemp; - sTemp = String(); + sTemp = rtl::OUString(); bOk = LocalFileHelper::ConvertPhysicalNameToURL(m_SYSDEV_File,sTemp); m_SYSDEV_File = sTemp; - sTemp = String(); + sTemp = rtl::OUString(); bOk = LocalFileHelper::ConvertPhysicalNameToURL(m_TRANSDEV_File,sTemp); m_TRANSDEV_File = sTemp; } String aErrorMessage = String(ModuleRes(STR_DEVSPACE_NO_FILE)); - if(!m_SYSDEV_File.Len()) + if(m_SYSDEV_File.isEmpty()) aErrorMessage.SearchAndReplace(String::CreateFromAscii("$name$"),String::CreateFromAscii("SYSDEVSPACE")); - else if(!m_TRANSDEV_File.Len()) + else if(m_TRANSDEV_File.isEmpty()) aErrorMessage.SearchAndReplace(String::CreateFromAscii("$name$"),String::CreateFromAscii("TRANSACTIONLOG")); - else if(!m_DATADEV_File.Len()) + else if(m_DATADEV_File.isEmpty()) aErrorMessage.SearchAndReplace(String::CreateFromAscii("$name$"),String::CreateFromAscii("DATDEVSPACE")); else if(m_ET_SYSUSR.GetText() == m_ET_CONUSR.GetText()) aErrorMessage = String(ModuleRes(STR_NO_SAME_USER)); @@ -479,11 +479,11 @@ IMPL_LINK( OAdabasNewDbDlg, ImplOKHdl, OKButton*, /*EMPTYARG*/ ) aCreateArgs[nPos].Name = PROPERTY_DATABASENAME; aCreateArgs[nPos++].Value <<= ::rtl::OUString(m_ET_DATABASENAME.GetText().ToUpperAscii()); aCreateArgs[nPos].Name = PROPERTY_DATADEVSPACE; - aCreateArgs[nPos++].Value <<= ::rtl::OUString(m_DATADEV_File); + aCreateArgs[nPos++].Value <<= m_DATADEV_File; aCreateArgs[nPos].Name = PROPERTY_SYSDEVSPACE; - aCreateArgs[nPos++].Value <<= ::rtl::OUString(m_SYSDEV_File); + aCreateArgs[nPos++].Value <<= m_SYSDEV_File; aCreateArgs[nPos].Name = PROPERTY_TRANSACTION_LOG; - aCreateArgs[nPos++].Value <<= ::rtl::OUString(m_TRANSDEV_File); + aCreateArgs[nPos++].Value <<= m_TRANSDEV_File; aCreateArgs[nPos].Name = PROPERTY_DATADEVSIZE; aCreateArgs[nPos++].Value <<= sal_Int32(m_NF_DATADEVSPACE_SIZE.GetValue()*256); aCreateArgs[nPos].Name = PROPERTY_LOGDEVSIZE; @@ -587,7 +587,7 @@ IMPL_LINK( OAdabasNewDbDlg, ButtonClickHdl, Button *, pButton ) else if(pButton == &m_PB_DATADEVSPACE) aPath = m_DATADEV_File; - String sUrl; + rtl::OUString sUrl; ::utl::LocalFileHelper::ConvertPhysicalNameToURL(aPath,sUrl); aFileDlg.SetDisplayDirectory(sUrl); @@ -599,7 +599,7 @@ IMPL_LINK( OAdabasNewDbDlg, ButtonClickHdl, Button *, pButton ) if(pButton == &m_PB_SYSDEVSPACE) { m_SYSDEV_File = aUrl.PathToFileName(); - if(m_SYSDEV_File.Len() > 40) + if(m_SYSDEV_File.getLength() > 40) { InfoBox aInfo(this,ModuleRes(INFO_STR_MAX_FILE_LENGTH)); String aMsg(aInfo.GetMessText()); @@ -613,7 +613,7 @@ IMPL_LINK( OAdabasNewDbDlg, ButtonClickHdl, Button *, pButton ) else if(pButton == &m_PB_TRANSACTIONLOG) { m_TRANSDEV_File = aUrl.PathToFileName(); - if(m_TRANSDEV_File.Len() > 40) + if(m_TRANSDEV_File.getLength() > 40) { InfoBox aInfo(this,ModuleRes(INFO_STR_MAX_FILE_LENGTH)); String aMsg(aInfo.GetMessText()); @@ -627,7 +627,7 @@ IMPL_LINK( OAdabasNewDbDlg, ButtonClickHdl, Button *, pButton ) else if(pButton == &m_PB_DATADEVSPACE) { m_DATADEV_File = aUrl.PathToFileName(); - if(m_DATADEV_File.Len() > 40) + if(m_DATADEV_File.getLength() > 40) { InfoBox aInfo(this,ModuleRes(INFO_STR_MAX_FILE_LENGTH)); String aMsg(aInfo.GetMessText()); @@ -731,8 +731,8 @@ sal_Bool OAdabasNewDbDlg::fillEnvironmentVariable(const ::rtl::OUString& _sVaria if(osl_getEnvironment(_sVariableName.pData,&pDbVar) == osl_Process_E_None && pDbVar) { _rsValue = pDbVar; - String sTemp; - LocalFileHelper::ConvertPhysicalNameToURL(_rsValue,sTemp); + rtl::OUString sTemp; + LocalFileHelper::ConvertPhysicalNameToURL(_rsValue, sTemp); _rsValue = sTemp; rtl_uString_release(pDbVar); pDbVar = NULL; diff --git a/dbaccess/source/ext/adabas/AdabasNewDb.hxx b/dbaccess/source/ext/adabas/AdabasNewDb.hxx index 224c175ccd3f..e8e5acc45e51 100644 --- a/dbaccess/source/ext/adabas/AdabasNewDb.hxx +++ b/dbaccess/source/ext/adabas/AdabasNewDb.hxx @@ -99,9 +99,9 @@ namespace adabasui OKButton m_PB_OK; CancelButton m_PB_CANCEL; - String m_SYSDEV_File; - String m_TRANSDEV_File; - String m_DATADEV_File; + rtl::OUString m_SYSDEV_File; + rtl::OUString m_TRANSDEV_File; + rtl::OUString m_DATADEV_File; String m_Backup_File; String m_ConPwd; String m_SysPwd; diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 11c6b177cd0d..24e044cde839 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -277,7 +277,7 @@ DBG_NAME(OConnectionHelper) if(osl_getEnvironment(sEnvVarName.pData,&pDbVar) == osl_Process_E_None && pDbVar) { sAdabasWorkDir = pDbVar; - String sURL; + rtl::OUString sURL; utl::LocalFileHelper::ConvertPhysicalNameToURL(sAdabasWorkDir,sURL); sAdabasWorkDir = sURL; rtl_uString_release(pDbVar); @@ -288,7 +288,7 @@ DBG_NAME(OConnectionHelper) if(osl_getEnvironment(sEnvVarName.pData,&pDbVar) == osl_Process_E_None && pDbVar) { sAdabasConfigDir = pDbVar; - String sURL; + rtl::OUString sURL; utl::LocalFileHelper::ConvertPhysicalNameToURL(sAdabasConfigDir,sURL); sAdabasConfigDir = sURL; rtl_uString_release(pDbVar); @@ -299,7 +299,7 @@ DBG_NAME(OConnectionHelper) if(osl_getEnvironment(sEnvVarName.pData,&pDbVar) == osl_Process_E_None && pDbVar) { sRootDir = pDbVar; - String sURL; + rtl::OUString sURL; utl::LocalFileHelper::ConvertPhysicalNameToURL(sRootDir,sURL); sRootDir = sURL; rtl_uString_release(pDbVar); diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index ffba407621dd..9f73597d6a2a 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -356,7 +356,7 @@ void ODbaseIndexDialog::Init() aURL.SetSmartProtocol(INET_PROT_FILE); for(;pBegin != pEnd;++pBegin) { - String aName; + rtl::OUString aName; ::utl::LocalFileHelper::ConvertURLToPhysicalName(pBegin->getStr(),aName); aURL.SetSmartURL(aName); aExt = aURL.getExtension(); diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 6268bc6a0341..d988171664d9 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -415,7 +415,7 @@ void Desktop::CreateTemporaryDirectory() ::utl::UCBContentHelper::Kill( aOldTempURL ); } - String aRet; + ::rtl::OUString aRet; ::rtl::OUString aTempPath( aTempBaseURL ); // create new current temporary directory diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index f1bfbd2baead..a182a3689cf0 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -766,7 +766,7 @@ XubString SvxExtFileField::GetFormatted() const if( INET_PROT_NOT_VALID == aURLObj.GetProtocol() ) { // invalid? try to interpret string as system file name - String aURLStr; + rtl::OUString aURLStr; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aFile, aURLStr ); diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 86d5b4f064d8..bd6ff45bb7dd 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -4370,7 +4370,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons INetURLObject aAbsURL; if ( !INetURLObject( maBaseURL ).GetNewAbsURL( rtl::OUStringToOString(aFileName, RTL_TEXTENCODING_UTF8), &aAbsURL ) ) { - String aValidURL; + rtl::OUString aValidURL; if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aFileName, aValidURL ) ) aAbsURL = INetURLObject( aValidURL ); } diff --git a/filter/source/msfilter/msfiltertracer.cxx b/filter/source/msfilter/msfiltertracer.cxx index 0bc2ccbbf2c5..e9da59d93d2f 100644 --- a/filter/source/msfilter/msfiltertracer.cxx +++ b/filter/source/msfilter/msfiltertracer.cxx @@ -88,7 +88,7 @@ MSFilterTracer::MSFilterTracer( const ::rtl::OUString& rConfigPath, uno::Sequenc aLogFile = INetURLObject( aPath ); else { - String aURLStr; + rtl::OUString aURLStr; if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( Application::GetAppFileName(), aURLStr ) ) { aLogFile = INetURLObject(aURLStr); diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 8a5869c4c46b..8dd7068a5223 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -394,7 +394,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue if( aURL.GetProtocol() != INET_PROT_FILE ) { - String aTmp; + rtl::OUString aTmp; if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rFile, aTmp ) ) aURL = INetURLObject(aTmp); diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 3743c751e175..2db644bba605 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -249,7 +249,7 @@ namespace INetURLObject aURL( aNewFile ); if ( INET_PROT_NOT_VALID == aURL.GetProtocol() ) { - String sURL; + rtl::OUString sURL; if ( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aNewFile, sURL ) ) aURL = INetURLObject( sURL ); } @@ -344,7 +344,7 @@ namespace { INetURLObject aCurrentURL; - String sURL; + rtl::OUString sURL; if ( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sCurrentToken, sURL ) ) aCurrentURL = INetURLObject( sURL ); else diff --git a/framework/source/classes/droptargetlistener.cxx b/framework/source/classes/droptargetlistener.cxx index 98e159a8add3..c1a422f466f1 100644 --- a/framework/source/classes/droptargetlistener.cxx +++ b/framework/source/classes/droptargetlistener.cxx @@ -219,7 +219,7 @@ sal_Bool DropTargetListener::implts_IsDropFormatSupported( SotFormatStringId nFo void DropTargetListener::implts_OpenFile( const String& rFilePath ) { - String aFileURL; + rtl::OUString aFileURL; if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( rFilePath, aFileURL ) ) aFileURL = rFilePath; diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index 51ec80fd4c49..7ef9502114dc 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -689,17 +689,17 @@ IMPL_LINK( SubstitutePathVariables, implts_ConfigurationNotify, SubstitutePathNo rtl::OUString SubstitutePathVariables::ConvertOSLtoUCBURL( const rtl::OUString& aOSLCompliantURL ) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "SubstitutePathVariables::ConvertOSLtoUCBURL" ); - String aResult; + rtl::OUString aResult; rtl::OUString aTemp; osl::FileBase::getSystemPathFromFileURL( aOSLCompliantURL, aTemp ); utl::LocalFileHelper::ConvertPhysicalNameToURL( aTemp, aResult ); // Not all OSL URL's can be mapped to UCB URL's! - if ( aResult.Len() == 0 ) + if ( aResult.isEmpty() ) return aOSLCompliantURL; else - return rtl::OUString( aResult ); + return aResult; } rtl::OUString SubstitutePathVariables::GetWorkPath() const diff --git a/lingucomponent/source/languageguessing/guesslang.cxx b/lingucomponent/source/languageguessing/guesslang.cxx index 4473dd0f2a97..21fcbe32f6a1 100644 --- a/lingucomponent/source/languageguessing/guesslang.cxx +++ b/lingucomponent/source/languageguessing/guesslang.cxx @@ -145,13 +145,13 @@ void LangGuess_Impl::EnsureInitialized() m_bInitialized = true; // set default fingerprint path to where those get installed - String aPhysPath; - String aURL( SvtPathOptions().GetFingerprintPath() ); + rtl::OUString aPhysPath; + rtl::OUString aURL( SvtPathOptions().GetFingerprintPath() ); utl::LocalFileHelper::ConvertURLToPhysicalName( aURL, aPhysPath ); #ifdef WNT - aPhysPath += '\\'; + aPhysPath = aPhysPath + rtl::OUString(static_cast<sal_Unicode>('\\')); #else - aPhysPath += '/'; + aPhysPath = aPhysPath + rtl::OUString(static_cast<sal_Unicode>('/')); #endif SetFingerPrintsDB( aPhysPath ); diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx index bc71c678a28a..092d117ca43c 100644 --- a/sc/source/core/data/globalx.cxx +++ b/sc/source/core/data/globalx.cxx @@ -70,7 +70,7 @@ void ScGlobal::InitAddIns() { // use LocalFileHelper to convert the path to a URL that always points // to the file on the server - String aUrl; + rtl::OUString aUrl; if ( utl::LocalFileHelper::ConvertPhysicalNameToURL( aPath, aUrl ) ) aPath = aUrl; diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 41a53630a892..c2aec1e395c3 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -3270,7 +3270,7 @@ sal_uLong EasyFile::createFileName( const String& rURL, String& rFileName ) if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) { - String aURLStr; + rtl::OUString aURLStr; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rURL, aURLStr ); aURL = INetURLObject( aURLStr ); } diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 2e8493dbd6e2..203d2f3bfd43 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -1986,12 +1986,12 @@ String ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const String ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef ) const { - String aRetVal; + rtl::OUString aRetVal; DffRecordHeader* pHd( const_cast<ImplSdPPTImport*>(this)->aDocRecManager.GetRecordHeader( PPT_PST_ExObjList, SEEK_FROM_BEGINNING ) ); if ( pHd ) { pHd->SeekToContent( rStCtrl ); - while ( ( rStCtrl.Tell() < pHd->GetRecEndFilePos() ) && !aRetVal.Len() ) + while ( ( rStCtrl.Tell() < pHd->GetRecEndFilePos() ) && aRetVal.isEmpty() ) { DffRecordHeader aHdMovie; rStCtrl >> aHdMovie; diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 84d223773911..54c675c00ffb 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -585,7 +585,7 @@ sal_Bool SdNavigatorWin::InsertFile(const String& rFileName) if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) { - String aURLStr; + rtl::OUString aURLStr; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rFileName, aURLStr ); aURL = INetURLObject( aURLStr ); } diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index f42ad34cbc24..9b686bc0f30f 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -393,7 +393,7 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG ) if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) { - String aURLStr; + rtl::OUString aURLStr; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aCurrentDropFile, aURLStr ); aURL = INetURLObject( aURLStr ); } diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index 62f93ee93050..f05e7e4e01a0 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -89,7 +89,7 @@ class SFX2_DLLPUBLIC SfxMedium : public SvRefBase bTriedStorage; StreamMode nStorOpenMode; INetURLObject* pURLObj; - String aName; + rtl::OUString aName; SvGlobalName aFilterClass; SvStream* pInStream; SvStream* pOutStream; @@ -164,7 +164,7 @@ public: ::com::sun::star::util::DateTime GetInitFileDate( sal_Bool bIgnoreOldValue ); ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent > GetContent() const; - const String& GetPhysicalName() const; + const rtl::OUString& GetPhysicalName() const; sal_Bool IsRemote(); sal_Bool IsOpen() const; // { return aStorage.Is() || pInStream; } void DownLoad( const Link& aLink = Link()); @@ -267,7 +267,7 @@ public: SAL_DLLPRIVATE sal_Bool IsPreview_Impl(); SAL_DLLPRIVATE void ClearBackup_Impl(); SAL_DLLPRIVATE void Done_Impl( ErrCode ); - SAL_DLLPRIVATE void SetPhysicalName_Impl(const String& rName); + SAL_DLLPRIVATE void SetPhysicalName_Impl(const rtl::OUString& rName); SAL_DLLPRIVATE void CanDisposeStorage_Impl( sal_Bool bDisposeStorage ); SAL_DLLPRIVATE sal_Bool WillDisposeStorageOnClose_Impl(); diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index ca9060a89573..2a17778d7039 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -445,7 +445,7 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) { const String aName( SfxResId( CONFIG_PATH_START + nProp ) ); aNames.InsertValue( nProp, aName ); - String aValue; + rtl::OUString aValue; switch ( nProp ) { case SvtPathOptions::PATH_ADDIN: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetAddinPath(), aValue ); break; @@ -816,7 +816,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) { case SvtPathOptions::PATH_ADDIN: { - String aTmp; + rtl::OUString aTmp; if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) ) aPathOptions.SetAddinPath( aTmp ); break; @@ -832,7 +832,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) case SvtPathOptions::PATH_FAVORITES: aPathOptions.SetFavoritesPath( sValue );break; case SvtPathOptions::PATH_FILTER: { - String aTmp; + rtl::OUString aTmp; if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) ) aPathOptions.SetFilterPath( aTmp ); break; @@ -841,7 +841,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) case SvtPathOptions::PATH_GRAPHIC: aPathOptions.SetGraphicPath( sValue );break; case SvtPathOptions::PATH_HELP: { - String aTmp; + rtl::OUString aTmp; if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) ) aPathOptions.SetHelpPath( aTmp ); break; @@ -850,7 +850,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) case SvtPathOptions::PATH_LINGUISTIC: aPathOptions.SetLinguisticPath( sValue );break; case SvtPathOptions::PATH_MODULE: { - String aTmp; + rtl::OUString aTmp; if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) ) aPathOptions.SetModulePath( aTmp ); break; @@ -859,7 +859,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) case SvtPathOptions::PATH_PALETTE: aPathOptions.SetPalettePath( sValue );break; case SvtPathOptions::PATH_PLUGIN: { - String aTmp; + rtl::OUString aTmp; if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) ) aPathOptions.SetPluginPath( aTmp ); break; @@ -867,7 +867,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) case SvtPathOptions::PATH_STORAGE: { - String aTmp; + rtl::OUString aTmp; if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) ) aPathOptions.SetStoragePath( aTmp ); break; diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index 1b982526eafa..7cddda525b5b 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -371,7 +371,7 @@ sal_Bool SvFileObject::GetGraphic_Impl( Graphic& rGrf, SvStream* pStream ) { DBG_WARNING3( "Graphic error [%d] - [%s] URL[%s]", nRes, - xMed->GetPhysicalName().GetBuffer(), + xMed->GetPhysicalName().getStr(), sFileNm.GetBuffer() ); } else diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 2a2fb434f7c7..1f4842035ec1 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -427,7 +427,7 @@ void LinkManager::ReconnectDdeLink(SfxObjectShell& rServer) // DDE connections between OOo apps are always named 'soffice'. continue; - String aTmp; + rtl::OUString aTmp; OUString aURL = aFile; if (utl::LocalFileHelper::ConvertPhysicalNameToURL(aFile, aTmp)) aURL = aTmp; diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 4fe3e04607fa..78768582c1df 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -222,7 +222,7 @@ void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const Stri static ::rtl::OUString DEF_TPL_STR(RTL_CONSTASCII_USTRINGPARAM("/soffice.")); - String sURL; + rtl::OUString sURL; String sPath; sal_Unicode aPathBuffer[nMaxPathSize]; if ( SystemPath::GetUserTemplateLocation( aPathBuffer, nMaxPathSize )) diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 033249394657..250f58606b12 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -516,12 +516,12 @@ Reference < XContent > SfxMedium::GetContent() const else { // TODO: OSL_FAIL("SfxMedium::GetContent()\nCreate Content? This code exists as fallback only. Please clarify, why its used."); - String aURL; - if ( aName.Len() ) + rtl::OUString aURL; + if ( !aName.isEmpty() ) ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aURL ); else if ( aLogicName.Len() ) aURL = GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); - if ( aURL.Len() ) + if (!aURL.isEmpty() ) ::ucbhelper::Content::create( aURL, xEnv, pImp->aContent ); } } @@ -690,9 +690,9 @@ sal_Bool SfxMedium::CloseOutStream_Impl() } //------------------------------------------------------------------ -const String& SfxMedium::GetPhysicalName() const +const rtl::OUString& SfxMedium::GetPhysicalName() const { - if ( !aName.Len() && aLogicName.Len() ) + if ( aName.isEmpty() && aLogicName.Len() ) (( SfxMedium*)this)->CreateFileStream(); // return the name then @@ -749,7 +749,7 @@ sal_Bool SfxMedium::IsStorage() if ( pImp->pTempFile ) { - String aURL; + rtl::OUString aURL; if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aURL ) ) { OSL_FAIL("Physical name not convertable!"); @@ -1366,7 +1366,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( sal_Bool bCreateTempIf nStorOpenMode = SFX_STREAM_READONLY; pImp->xStorage = comphelper::OStorageHelper::GetStorageFromURL( aTmpName, embed::ElementModes::READ ); pImp->bStorageBasedOnInStream = sal_False; - String aTemp; + rtl::OUString aTemp; ::utl::LocalFileHelper::ConvertURLToPhysicalName( aTmpName, aTemp ); SetPhysicalName_Impl( aTemp ); @@ -1560,7 +1560,7 @@ sal_Bool SfxMedium::StorageCommit_Impl() // connect the medium to the temporary file of the storage pImp->aContent = ::ucbhelper::Content(); aName = aBackupExc.TemporaryFileURL; - OSL_ENSURE( aName.Len(), "The exception _must_ contain the temporary URL!\n" ); + OSL_ENSURE( !aName.isEmpty(), "The exception _must_ contain the temporary URL!\n" ); } } @@ -1779,7 +1779,7 @@ sal_Bool SfxMedium::TryDirectTransfer( const ::rtl::OUString& aURL, SfxItemSet& void SfxMedium::Transfer_Impl() { // The transfer is required only in two cases: either if there is a temporary file or if there is a salvage item - String aNameURL; + rtl::OUString aNameURL; if ( pImp->pTempFile ) aNameURL = pImp->pTempFile->GetURL(); else if ( aLogicName.Len() && pImp->m_bSalvageMode ) @@ -1789,7 +1789,7 @@ void SfxMedium::Transfer_Impl() OSL_FAIL( "The medium name is not convertable!\n" ); } - if ( aNameURL.Len() && ( !eError || (eError & ERRCODE_WARNING_MASK) ) ) + if ( !aNameURL.isEmpty() && ( !eError || (eError & ERRCODE_WARNING_MASK) ) ) { RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mv76033) SfxMedium::Transfer_Impl, copying to target" ); @@ -2191,7 +2191,7 @@ void SfxMedium::GetLockingStream_Impl() aMedium[comphelper::MediaDescriptor::PROP_STREAM()] >>= pImp->m_xLockingStream; aMedium[comphelper::MediaDescriptor::PROP_INPUTSTREAM()] >>= xInputStream; - if ( !pImp->pTempFile && !aName.Len() ) + if ( !pImp->pTempFile && aName.isEmpty() ) { // the medium is still based on the original file, it makes sence to initialize the streams if ( pImp->m_xLockingStream.is() ) @@ -2235,8 +2235,8 @@ void SfxMedium::GetMedium_Impl() else { uno::Sequence < beans::PropertyValue > xProps; - String aFileName; - if ( aName.Len() ) + rtl::OUString aFileName; + if (!aName.isEmpty()) { if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aFileName ) ) { @@ -2418,9 +2418,10 @@ 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 ( !aName.Len() ) + if ( aName.isEmpty() ) ::utl::LocalFileHelper::ConvertURLToPhysicalName( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), aName ); - else { + else + { DBG_ASSERT( pSalvageItem, "Suspicious change of logical name!" ); } } @@ -2735,7 +2736,7 @@ const String& SfxMedium::GetOrigURL() const //---------------------------------------------------------------- -void SfxMedium::SetPhysicalName_Impl( const String& rNameP ) +void SfxMedium::SetPhysicalName_Impl( const rtl::OUString& rNameP ) { if ( rNameP != aName ) { @@ -2745,7 +2746,7 @@ void SfxMedium::SetPhysicalName_Impl( const String& rNameP ) pImp->pTempFile = NULL; } - if ( aName.Len() || rNameP.Len() ) + if ( !aName.isEmpty() || !rNameP.isEmpty() ) pImp->aContent = ::ucbhelper::Content(); aName = rNameP; @@ -2909,9 +2910,9 @@ SfxMedium::~SfxMedium() delete pSet; - if( pImp->bIsTemp && aName.Len() ) + if( pImp->bIsTemp && !aName.isEmpty() ) { - String aTemp; + rtl::OUString aTemp; if ( !::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aTemp )) { OSL_FAIL("Physical name not convertable!"); @@ -3053,7 +3054,7 @@ const uno::Sequence < util::RevisionTag >& SfxMedium::GetVersionList( bool _bNoR { // if the medium has no name, then this medium should represent a new document and can have no version info if ( ( !_bNoReload || !pImp->m_bVersionsAlreadyLoaded ) && !pImp->aVersions.getLength() && - ( aName.Len() || aLogicName.Len() ) && GetStorage().is() ) + ( !aName.isEmpty() || aLogicName.Len() ) && GetStorage().is() ) { uno::Reference < document::XDocumentRevisionListPersistence > xReader( comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentRevisionListPersistence")) ), uno::UNO_QUERY ); @@ -3255,7 +3256,7 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace ) pImp->pTempFile->EnableKillingFile( sal_True ); aName = pImp->pTempFile->GetFileName(); ::rtl::OUString aTmpURL = pImp->pTempFile->GetURL(); - if ( !aName.Len() || !aTmpURL.getLength() ) + if ( aName.isEmpty() || aTmpURL.isEmpty() ) { SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); return; @@ -3352,7 +3353,7 @@ void SfxMedium::CreateTempFileNoCopy() pImp->pTempFile = new ::utl::TempFile(); pImp->pTempFile->EnableKillingFile( sal_True ); aName = pImp->pTempFile->GetFileName(); - if ( !aName.Len() ) + if ( aName.isEmpty() ) { SetError( ERRCODE_IO_CANTWRITE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); return; diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index 94e6326ff54b..6938099ae553 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -254,7 +254,7 @@ IMPL_LINK( SfxNewFileDialog_Impl, Update, void *, EMPTYARG ) { // temp. fix until Templates are managed by UCB compatible service // does NOT work with locally cached components ! - String aTemp; + rtl::OUString aTemp; utl::LocalFileHelper::ConvertPhysicalNameToURL( aFileName, aTemp ); aFileName = aTemp; } diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 8355ebd57e6a..20f56e3258b1 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -603,7 +603,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) SFX_ITEMSET_ARG( pSet, pBaseItem, SfxStringItem, SID_BASEURL, sal_False); - String aBaseURL; + rtl::OUString aBaseURL; SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False); if( pBaseItem ) aBaseURL = pBaseItem->GetValue(); @@ -611,7 +611,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) { if ( pSalvageItem ) { - String aName( pMed->GetPhysicalName() ); + rtl::OUString aName( pMed->GetPhysicalName() ); ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aBaseURL ); } else diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 47105d766e68..01087cd39a53 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -409,7 +409,7 @@ SfxObjectShell::~SfxObjectShell() // The removing of the temporary file must be done as the latest step in the document destruction if ( pImp->aTempName.Len() ) { - String aTmp; + rtl::OUString aTmp; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( pImp->aTempName, aTmp ); ::utl::UCBContentHelper::Kill( aTmp ); } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index e55e43ab69be..8e123e3d9d3d 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -445,7 +445,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) // doing - String aTemp; + rtl::OUString aTemp; utl::LocalFileHelper::ConvertPhysicalNameToURL( pMed->GetPhysicalName(), aTemp ); INetURLObject aPhysObj( aTemp ); SFX_ITEMSET_ARG( pSh->GetMedium()->GetItemSet(), diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 897f9fe7a61b..d6a5f53b06d1 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -519,7 +519,7 @@ void SotStorage::CreateStorage( sal_Bool bForceUCBStorage, StreamMode nMode, Sto INetURLObject aObj( m_aName ); if ( aObj.GetProtocol() == INET_PROT_NOT_VALID ) { - String aURL; + rtl::OUString aURL; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( m_aName, aURL ); aObj.SetURL( aURL ); m_aName = aObj.GetMainURL( INetURLObject::NO_DECODE ); @@ -738,7 +738,7 @@ sal_Bool SotStorage::IsStorageFile( const String & rFileName ) INetURLObject aObj( aName ); if ( aObj.GetProtocol() == INET_PROT_NOT_VALID ) { - String aURL; + rtl::OUString aURL; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aURL ); aObj.SetURL( aURL ); aName = aObj.GetMainURL( INetURLObject::NO_DECODE ); diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index bc2f10004955..c1981aa2fc99 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -3217,7 +3217,7 @@ sal_Bool UCBStorage::Equals( const BaseStorage& rStorage ) const sal_Bool UCBStorage::IsStorageFile( const String& rFileName ) { - String aFileURL = rFileName; + rtl::OUString aFileURL = rFileName; INetURLObject aObj( aFileURL ); if ( aObj.GetProtocol() == INET_PROT_NOT_VALID ) { diff --git a/svl/source/misc/folderrestriction.cxx b/svl/source/misc/folderrestriction.cxx index c03999ad4a1b..8de4d294dcab 100644 --- a/svl/source/misc/folderrestriction.cxx +++ b/svl/source/misc/folderrestriction.cxx @@ -54,7 +54,7 @@ static void convertStringListToUrls ( { INetURLObject aCurrentURL; - String sURL; + rtl::OUString sURL; if ( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sCurrentToken, sURL ) ) aCurrentURL = INetURLObject( sURL ); else diff --git a/svl/source/misc/restrictedpaths.cxx b/svl/source/misc/restrictedpaths.cxx index ffdcdc6d51e2..1e6e74b1697d 100644 --- a/svl/source/misc/restrictedpaths.cxx +++ b/svl/source/misc/restrictedpaths.cxx @@ -69,7 +69,7 @@ namespace svt { INetURLObject aCurrentURL; - String sURL; + rtl::OUString sURL; if ( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sCurrentToken, sURL ) ) aCurrentURL = INetURLObject( sURL ); else diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 21547e3389c2..39461a6ff43c 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -260,7 +260,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, ) String sCompletion( *(*pThis->pCompletions)[nPos] ); // convert the file into an URL - String sURL( sCompletion ); + rtl::OUString sURL( sCompletion ); ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sCompletion, sURL ); // note: if this doesn't work, we're not interested in: we're checking the // untouched sCompletion then @@ -273,7 +273,7 @@ IMPL_STATIC_LINK( SvtMatchContext_Impl, Select_Impl, void*, ) continue; } } - if (( sURL.Len() > 0 ) && ( sURL.GetChar(sURL.Len()-1) != '/' )) + if (( sURL.getLength() > 0 ) && ( sURL[sURL.getLength()-1] != '/' )) { String sUpperURL( sURL ); sUpperURL.ToUpperAscii(); diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index eec9b4f241d7..3b4bfc44ff37 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -215,7 +215,7 @@ void GraphicObject::ImplAutoSwapIn() { if( HasLink() ) { - String aURLStr; + rtl::OUString aURLStr; if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( GetLink(), aURLStr ) ) { diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx index c4deeecfd763..c64aa8b3c30f 100644 --- a/svtools/source/misc/templatefoldercache.cxx +++ b/svtools/source/misc/templatefoldercache.cxx @@ -591,7 +591,7 @@ namespace svt aParser.SetURL( _rPath, INetURLObject::WAS_ENCODED ); if ( INET_PROT_NOT_VALID == aParser.GetProtocol() ) { - String sURL; + rtl::OUString sURL; LocalFileHelper::ConvertPhysicalNameToURL( _rPath, sURL ); aParser.SetURL( sURL, INetURLObject::WAS_ENCODED ); } diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index 653c9aefc0b9..84e46885ee66 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -1523,7 +1523,7 @@ sal_Bool BrokenRecoveryDialog::isExecutionNeeded() IMPL_LINK( BrokenRecoveryDialog, OkButtonHdl, void*, EMPTYARG ) { String sPhysicalPath = m_aSaveDirED.GetText().EraseLeadingChars().EraseTrailingChars(); - String sURL; + rtl::OUString sURL; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPhysicalPath, sURL ); m_sSavePath = sURL; while (!m_sSavePath.getLength()) diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 9ce8d48d00e2..c64fbb6938f3 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -1263,7 +1263,7 @@ sal_Bool GalleryTheme::InsertTransferable( const uno::Reference< datatransfer::X if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) { - String aLocalURL; + rtl::OUString aLocalURL; if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aFile, aLocalURL ) ) aURL = INetURLObject( aLocalURL ); @@ -1516,7 +1516,7 @@ SvStream& GalleryTheme::ReadData( SvStream& rIStm ) } else { - String aLocalURL; + rtl::OUString aLocalURL; pObj->aURL = INetURLObject( aFileName ); diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx index 5b0afd807c6b..cc2dfe34cc99 100644 --- a/svx/source/svdraw/svdotxln.cxx +++ b/svx/source/svdraw/svdotxln.cxx @@ -227,7 +227,7 @@ bool SdrTextObj::LoadText(const String& rFileName, const String& /*rFilterName*/ if( aFileURL.GetProtocol() == INET_PROT_NOT_VALID ) { - String aFileURLStr; + rtl::OUString aFileURLStr; if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rFileName, aFileURLStr ) ) aFileURL = INetURLObject( aFileURLStr ); diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index be42afcbfb63..c1cd7b440b05 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1554,7 +1554,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const ::rtl::OUString& rName, const if( aURLObj.GetProtocol() == INET_PROT_NOT_VALID ) { - String aValidURL; + rtl::OUString aValidURL; if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aURL, aValidURL ) ) aURLObj = INetURLObject( aValidURL ); diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index 360376dd5407..5a19bc612bad 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -529,11 +529,11 @@ sal_Bool SwXMLTextBlocks::IsOnlyTextBlock( sal_uInt16 nIdx ) const sal_Bool SwXMLTextBlocks::IsFileUCBStorage( const String & rFileName) { - String aName( rFileName ); + rtl::OUString aName( rFileName ); INetURLObject aObj( aName ); if ( aObj.GetProtocol() == INET_PROT_NOT_VALID ) { - String aURL; + rtl::OUString aURL; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( 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 0ab1cf6e175a..c14e189f93db 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4251,11 +4251,11 @@ void SwWW8ImplReader::ReadDocInfo() aSttb.Print( stderr ); #endif String sPath = aSttb.getStringAtIndex( 0x1 ); - String aURL; + rtl::OUString aURL; // attempt to convert to url ( won't work for obvious reasons on linux if ( sPath.Len() ) ::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPath, aURL ); - if ( aURL.Len() ) + if (!aURL.getLength()) xDocProps->setTemplateURL( aURL ); else xDocProps->setTemplateURL( sPath ); diff --git a/unotools/inc/unotools/localfilehelper.hxx b/unotools/inc/unotools/localfilehelper.hxx index ebccc43d090c..9feed581d46e 100644 --- a/unotools/inc/unotools/localfilehelper.hxx +++ b/unotools/inc/unotools/localfilehelper.hxx @@ -44,7 +44,7 @@ namespace utl 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 sal_Bool ConvertPhysicalNameToURL( const String& rName, String& rReturn ); + static bool ConvertPhysicalNameToURL(const rtl::OUString& rName, rtl::OUString& rReturn); static sal_Bool ConvertSystemPathToURL( const String& rName, const String& rBaseURL, String& rReturn ); /** @@ -53,12 +53,11 @@ namespace utl 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 sal_Bool ConvertURLToPhysicalName( const String& rName, String& rReturn ); - static bool ConvertURLToPhysicalName( const rtl::OUString& rName, rtl::OUString& rReturn ); + static bool ConvertURLToPhysicalName( const rtl::OUString& rName, rtl::OUString& rReturn ); static sal_Bool ConvertURLToSystemPath( const String& rName, String& rReturn ); - static sal_Bool IsLocalFile( const String& rName ); - static sal_Bool IsFileContent( const String& rName ); + static sal_Bool IsLocalFile(const rtl::OUString& rName); + static sal_Bool IsFileContent(const rtl::OUString& rName); static ::com::sun::star::uno::Sequence< ::rtl::OUString > GetFolderContents( const ::rtl::OUString& rFolder, sal_Bool bFolder ); diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx index eb8c60068604..1b9d386c1bc1 100644 --- a/unotools/source/config/defaultoptions.cxx +++ b/unotools/source/config/defaultoptions.cxx @@ -199,7 +199,7 @@ void SvtDefaultOptions_Impl::Commit() String SvtDefaultOptions_Impl::GetDefaultPath( sal_uInt16 nId ) const { - String aRet; + rtl::OUString aRet; sal_uInt16 nIdx = 0; while ( PathMap_Impl[nIdx]._ePath <= SvtPathOptions::PATH_WORK ) @@ -213,7 +213,7 @@ String SvtDefaultOptions_Impl::GetDefaultPath( sal_uInt16 nId ) const nId == SvtPathOptions::PATH_MODULE || nId == SvtPathOptions::PATH_PLUGIN ) { - String aTmp; + rtl::OUString aTmp; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aRet, aTmp ); aRet = aTmp; } diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 74f19ddaeef3..3be2d1ccea02 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -255,7 +255,7 @@ const String& SvtPathOptions_Impl::GetPath( SvtPathOptions::Pathes ePath ) try { OUString aPathValue; - String aResult; + OUString aResult; sal_Int32 nHandle = m_aMapEnumToPropHandle[ (sal_Int32)ePath ]; // Substitution is done by the service itself using the substition service @@ -290,7 +290,7 @@ void SvtPathOptions_Impl::SetPath( SvtPathOptions::Pathes ePath, const String& r if ( ePath < SvtPathOptions::PATH_COUNT ) { - String aResult; + OUString aResult; OUString aNewValue; Any a; @@ -413,7 +413,7 @@ OUString SvtPathOptions_Impl::SubstVar( const OUString& rVar ) const if ( bConvertLocal ) { // Convert the URL to a system path for special path variables - String aReturn; + rtl::OUString aReturn; utl::LocalFileHelper::ConvertURLToPhysicalName( aWorkText, aReturn ); return aReturn; } @@ -949,7 +949,7 @@ sal_Bool SvtPathOptions::SearchFile( String& rIniFile, Pathes ePath ) if ( aObj.HasError() ) { bIsURL = sal_False; - String aURL; + rtl::OUString aURL; if ( LocalFileHelper::ConvertPhysicalNameToURL( aPathToken, aURL ) ) aObj.SetURL( aURL ); } @@ -978,8 +978,12 @@ sal_Bool SvtPathOptions::SearchFile( String& rIniFile, Pathes ePath ) if ( bRet ) { if ( !bIsURL ) + { + rtl::OUString sTmp(rIniFile); ::utl::LocalFileHelper::ConvertURLToPhysicalName( - aObj.GetMainURL( INetURLObject::NO_DECODE ), rIniFile ); + aObj.GetMainURL( INetURLObject::NO_DECODE ), sTmp ); + rIniFile = sTmp; + } else rIniFile = aObj.GetMainURL( INetURLObject::NO_DECODE ); break; diff --git a/unotools/source/ucbhelper/localfilehelper.cxx b/unotools/source/ucbhelper/localfilehelper.cxx index b2c14cf268af..2d28dac1adc8 100644 --- a/unotools/source/ucbhelper/localfilehelper.cxx +++ b/unotools/source/ucbhelper/localfilehelper.cxx @@ -100,7 +100,7 @@ sal_Bool LocalFileHelper::ConvertURLToSystemPath( const String& rName, String& r return ( rReturn.Len() != 0 ); } -sal_Bool LocalFileHelper::ConvertPhysicalNameToURL( const String& rName, String& rReturn ) +bool LocalFileHelper::ConvertPhysicalNameToURL(const rtl::OUString& rName, rtl::OUString& rReturn) { rReturn = ::rtl::OUString(); ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get(); @@ -120,23 +120,15 @@ sal_Bool LocalFileHelper::ConvertPhysicalNameToURL( const String& rName, String& rtl::OUString aBase( ::ucbhelper::getLocalFileURL( xManager ) ); rReturn = ::ucbhelper::getFileURLFromSystemPath( xManager, aBase, rName ); } - catch ( ::com::sun::star::uno::RuntimeException& ) + catch (const ::com::sun::star::uno::RuntimeException&) { } } - return ( rReturn.Len() != 0 ); -} - -bool LocalFileHelper::ConvertURLToPhysicalName( const rtl::OUString& rName, rtl::OUString& rReturn ) -{ - String aReturn; - bool bReturn = ConvertURLToPhysicalName( rName, aReturn ); - rReturn = rtl::OUString( aReturn ); - return bReturn; + return !rReturn.isEmpty(); } -sal_Bool LocalFileHelper::ConvertURLToPhysicalName( const String& rName, String& rReturn ) +bool LocalFileHelper::ConvertURLToPhysicalName(const rtl::OUString& rName, rtl::OUString& rReturn) { rReturn = ::rtl::OUString(); ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get(); @@ -157,24 +149,24 @@ sal_Bool LocalFileHelper::ConvertURLToPhysicalName( const String& rName, String& if ( aObj.GetProtocol() == aLocal.GetProtocol() ) rReturn = ::ucbhelper::getSystemPathFromFileURL( xManager, rName ); } - catch ( ::com::sun::star::uno::RuntimeException& ) + catch (const ::com::sun::star::uno::RuntimeException&) { } } - return ( rReturn.Len() != 0 ); + return !rReturn.isEmpty(); } -sal_Bool LocalFileHelper::IsLocalFile( const String& rName ) +sal_Bool LocalFileHelper::IsLocalFile(const rtl::OUString& rName) { - String aTmp; - return ConvertURLToPhysicalName( rName, aTmp ); + rtl::OUString aTmp; + return ConvertURLToPhysicalName(rName, aTmp); } -sal_Bool LocalFileHelper::IsFileContent( const String& rName ) +sal_Bool LocalFileHelper::IsFileContent(const rtl::OUString& rName) { String aTmp; - return ConvertURLToSystemPath( rName, aTmp ); + return ConvertURLToSystemPath(rName, aTmp); } typedef ::std::vector< ::rtl::OUString* > StringList_Impl; diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 74c3c53db259..cc70904f55d4 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -411,7 +411,7 @@ String TempFile::GetURL() const { if ( !pImp->aURL.Len() ) { - String aTmp; + rtl::OUString aTmp; LocalFileHelper::ConvertPhysicalNameToURL( GetFileName(), aTmp ); pImp->aURL = aTmp; } |