use string_view in INetURLObject::encode
Change-Id: Ib686c6872388b02c8939d3b65f6bd25cda348bc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114754 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -1038,7 +1038,7 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
|
||||
Sequence< OUString > aFiles = xFP->getSelectedFiles();
|
||||
INetURLObject aURL( aFiles[0] );
|
||||
if( aURL.getExtension().isEmpty() )
|
||||
aURL.setExtension( "oxt" );
|
||||
aURL.setExtension( u"oxt" );
|
||||
|
||||
OUString aPackageURL( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
|
||||
|
||||
@@ -1071,7 +1071,7 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
|
||||
OUString(), NameClash::OVERWRITE );
|
||||
|
||||
INetURLObject aMetaInfInetObj( aTmpPath );
|
||||
aMetaInfInetObj.insertName( "META-INF",
|
||||
aMetaInfInetObj.insertName( u"META-INF",
|
||||
true, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All );
|
||||
OUString aMetaInfFolder = aMetaInfInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
if( xSFA->exists( aMetaInfFolder ) )
|
||||
@@ -1095,7 +1095,7 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
|
||||
xPipe, Sequence< Sequence<beans::PropertyValue> >(
|
||||
manifest.data(), manifest.size() ) );
|
||||
|
||||
aMetaInfInetObj.insertName( "manifest.xml",
|
||||
aMetaInfInetObj.insertName( u"manifest.xml",
|
||||
true, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All );
|
||||
|
||||
// write buffered pipe data to content:
|
||||
|
||||
@@ -227,12 +227,12 @@ protected:
|
||||
} meInitMode;
|
||||
|
||||
void implStoreLibrary( SfxLibrary* pLib,
|
||||
const OUString& rName,
|
||||
std::u16string_view rName,
|
||||
const css::uno::Reference< css::embed::XStorage >& rStorage );
|
||||
|
||||
// New variant for library export
|
||||
void implStoreLibrary( SfxLibrary* pLib,
|
||||
const OUString& rName,
|
||||
std::u16string_view rName,
|
||||
const css::uno::Reference< css::embed::XStorage >& rStorage,
|
||||
const OUString& rTargetURL,
|
||||
const css::uno::Reference< css::ucb::XSimpleFileAccess3 >& rToUseSFI,
|
||||
@@ -302,7 +302,7 @@ protected:
|
||||
|
||||
// Interface to get the BasicManager (Hack for password implementation)
|
||||
BasicManager* getBasicManager();
|
||||
OUString createAppLibraryFolder( SfxLibrary* pLib, const OUString& aName );
|
||||
OUString createAppLibraryFolder( SfxLibrary* pLib, std::u16string_view aName );
|
||||
|
||||
void init( const OUString& rInitialDocumentURL,
|
||||
const css::uno::Reference< css::embed::XStorage >& _rxInitialStorage );
|
||||
|
||||
@@ -552,8 +552,8 @@ void SAL_CALL SfxLibraryContainer::storeLibraries( )
|
||||
|
||||
static void checkAndCopyFileImpl( const INetURLObject& rSourceFolderInetObj,
|
||||
const INetURLObject& rTargetFolderInetObj,
|
||||
const OUString& rCheckFileName,
|
||||
const OUString& rCheckExtension,
|
||||
std::u16string_view rCheckFileName,
|
||||
std::u16string_view rCheckExtension,
|
||||
const Reference< XSimpleFileAccess3 >& xSFI )
|
||||
{
|
||||
INetURLObject aTargetFolderInetObj( rTargetFolderInetObj );
|
||||
@@ -755,7 +755,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
|
||||
pLibInfoInetObj.reset(new INetURLObject( maLibraryPath.getToken(1, ';') ));
|
||||
}
|
||||
pLibInfoInetObj->insertName( maInfoFileName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All );
|
||||
pLibInfoInetObj->setExtension( "xlc" );
|
||||
pLibInfoInetObj->setExtension( u"xlc" );
|
||||
aFileName = pLibInfoInetObj->GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
}
|
||||
|
||||
@@ -774,7 +774,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
|
||||
{
|
||||
INetURLObject aLibInfoInetObj( maLibraryPath.getToken(1, ';') );
|
||||
aLibInfoInetObj.insertName( maOldInfoFileName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All );
|
||||
aLibInfoInetObj.setExtension( "xli" );
|
||||
aLibInfoInetObj.setExtension( u"xli" );
|
||||
aFileName = aLibInfoInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
|
||||
try
|
||||
@@ -993,8 +993,8 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
|
||||
INetURLObject aPrevUserBasicInetObj_1( aUserBasicInetObj );
|
||||
aPrevUserBasicInetObj_1.removeSegment();
|
||||
INetURLObject aPrevUserBasicInetObj_2 = aPrevUserBasicInetObj_1;
|
||||
aPrevUserBasicInetObj_1.Append( "__basic_80" );
|
||||
aPrevUserBasicInetObj_2.Append( "__basic_80_2" );
|
||||
aPrevUserBasicInetObj_1.Append( u"__basic_80" );
|
||||
aPrevUserBasicInetObj_2.Append( u"__basic_80_2" );
|
||||
|
||||
// #i93163
|
||||
bool bCleanUp = false;
|
||||
@@ -1033,7 +1033,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
|
||||
aCheckFileName = "Module1";
|
||||
checkAndCopyFileImpl( aUserBasicStandardInetObj,
|
||||
aPrevUserBasicStandardInetObj,
|
||||
aCheckFileName, "xba", mxSFI );
|
||||
aCheckFileName, u"xba", mxSFI );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1057,7 +1057,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
|
||||
OUString aFolderUserBasic = aUserBasicInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
INetURLObject aUserBasicTmpInetObj( aUserBasicInetObj );
|
||||
aUserBasicTmpInetObj.removeSegment();
|
||||
aUserBasicTmpInetObj.Append( "__basic_tmp" );
|
||||
aUserBasicTmpInetObj.Append( u"__basic_tmp" );
|
||||
OUString aFolderTmp = aUserBasicTmpInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
|
||||
mxSFI->move( aFolderUserBasic, aFolderTmp );
|
||||
@@ -1081,7 +1081,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
|
||||
INetURLObject aPrevUserBasicLibInfoInetObj( aUserBasicInetObj );
|
||||
aPrevUserBasicLibInfoInetObj.insertName( maInfoFileName, false, INetURLObject::LAST_SEGMENT,
|
||||
INetURLObject::EncodeMechanism::All );
|
||||
aPrevUserBasicLibInfoInetObj.setExtension( "xlc");
|
||||
aPrevUserBasicLibInfoInetObj.setExtension( u"xlc");
|
||||
OUString aLibInfoFileName = aPrevUserBasicLibInfoInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
Sequence<Any> aInitSeq( 1 );
|
||||
aInitSeq.getArray()[0] <<= aLibInfoFileName;
|
||||
@@ -1181,7 +1181,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
|
||||
|
||||
INetURLObject aPrevUserBasicInetObj_Err( aUserBasicInetObj );
|
||||
aPrevUserBasicInetObj_Err.removeSegment();
|
||||
aPrevUserBasicInetObj_Err.Append( "__basic_80_err" );
|
||||
aPrevUserBasicInetObj_Err.Append( u"__basic_80_err" );
|
||||
OUString aPrevFolder_Err = aPrevUserBasicInetObj_Err.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
|
||||
bool bSaved = false;
|
||||
@@ -1285,7 +1285,7 @@ void SfxLibraryContainer::checkStorageURL( const OUString& aSourceURL,
|
||||
// URL to library folder
|
||||
aStorageURL = aExpandedSourceURL;
|
||||
aInetObj.insertName( maInfoFileName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All );
|
||||
aInetObj.setExtension( "xlb" );
|
||||
aInetObj.setExtension( u"xlb" );
|
||||
aLibInfoFileURL = aInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
}
|
||||
}
|
||||
@@ -1330,7 +1330,7 @@ bool SfxLibraryContainer::implLoadPasswordLibrary(
|
||||
return true;
|
||||
}
|
||||
|
||||
OUString SfxLibraryContainer::createAppLibraryFolder( SfxLibrary* pLib, const OUString& aName )
|
||||
OUString SfxLibraryContainer::createAppLibraryFolder( SfxLibrary* pLib, std::u16string_view aName )
|
||||
{
|
||||
OUString aLibDirPath = pLib->maStorageURL;
|
||||
if( aLibDirPath.isEmpty() )
|
||||
@@ -1357,7 +1357,7 @@ OUString SfxLibraryContainer::createAppLibraryFolder( SfxLibrary* pLib, const OU
|
||||
|
||||
// Storing
|
||||
void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
|
||||
const OUString& aName,
|
||||
std::u16string_view aName,
|
||||
const uno::Reference< embed::XStorage >& xStorage )
|
||||
{
|
||||
Reference< XSimpleFileAccess3 > xDummySFA;
|
||||
@@ -1367,7 +1367,7 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
|
||||
|
||||
// New variant for library export
|
||||
void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
|
||||
const OUString& aName,
|
||||
std::u16string_view aName,
|
||||
const uno::Reference< embed::XStorage >& xStorage,
|
||||
const OUString& aTargetURL,
|
||||
const Reference< XSimpleFileAccess3 >& rToUseSFI,
|
||||
@@ -1580,7 +1580,7 @@ void SfxLibraryContainer::implStoreLibraryIndexFile( SfxLibrary* pLib,
|
||||
xSFI->createFolder( aLibDirPath );
|
||||
}
|
||||
aInetObj.insertName( maInfoFileName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All );
|
||||
aInetObj.setExtension( "xlb" );
|
||||
aInetObj.setExtension( u"xlb" );
|
||||
aLibInfoPath = aInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
}
|
||||
else
|
||||
@@ -2070,7 +2070,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
|
||||
// Create Output stream
|
||||
INetURLObject aLibInfoInetObj( maLibraryPath.getToken(1, ';') );
|
||||
aLibInfoInetObj.insertName( maInfoFileName, false, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All );
|
||||
aLibInfoInetObj.setExtension( "xlc" );
|
||||
aLibInfoInetObj.setExtension( u"xlc" );
|
||||
OUString aLibInfoPath( aLibInfoInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
|
||||
|
||||
try
|
||||
|
||||
@@ -505,7 +505,7 @@ void SAL_CALL SfxScriptLibraryContainer::changeLibraryPassword( const OUString&
|
||||
}
|
||||
else
|
||||
{
|
||||
aElementInetObj.setExtension( "pba" );
|
||||
aElementInetObj.setExtension( u"pba" );
|
||||
}
|
||||
OUString aElementPath( aElementInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
|
||||
|
||||
@@ -700,7 +700,7 @@ bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, cons
|
||||
aElementInetObj.insertName( aElementName, false,
|
||||
INetURLObject::LAST_SEGMENT,
|
||||
INetURLObject::EncodeMechanism::All );
|
||||
aElementInetObj.setExtension( "pba" );
|
||||
aElementInetObj.setExtension( u"pba" );
|
||||
OUString aElementPath = aElementInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
|
||||
if( !isLibraryElementValid( pLib->getByName( aElementName ) ) )
|
||||
@@ -966,7 +966,7 @@ bool SfxScriptLibraryContainer::implLoadPasswordLibrary
|
||||
INetURLObject aElementInetObj( aLibDirPath );
|
||||
aElementInetObj.insertName( aElementName, false,
|
||||
INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All );
|
||||
aElementInetObj.setExtension( "pba" );
|
||||
aElementInetObj.setExtension( u"pba" );
|
||||
OUString aElementPath = aElementInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
|
||||
uno::Reference< embed::XStorage > xElementRootStorage;
|
||||
|
||||
@@ -493,9 +493,9 @@ void ODbaseTable::construct()
|
||||
// nyi: Ugly for Unix and Mac!
|
||||
|
||||
if ( m_aHeader.type == FoxProMemo || m_aHeader.type == VisualFoxPro || m_aHeader.type == VisualFoxProAuto) // foxpro uses another extension
|
||||
aURL.SetExtension("fpt");
|
||||
aURL.SetExtension(u"fpt");
|
||||
else
|
||||
aURL.SetExtension("dbt");
|
||||
aURL.SetExtension(u"dbt");
|
||||
|
||||
// If the memo file isn't found, the data will be displayed anyhow.
|
||||
// However, updates can't be done
|
||||
@@ -656,7 +656,7 @@ void ODbaseTable::refreshIndexes()
|
||||
INetURLObject aURL;
|
||||
aURL.SetURL(getEntry(m_pConnection,m_Name));
|
||||
|
||||
aURL.setExtension("inf");
|
||||
aURL.setExtension(u"inf");
|
||||
Config aInfFile(aURL.getFSysPath(FSysStyle::Detect));
|
||||
aInfFile.SetGroup(dBASE_III_GROUP);
|
||||
sal_uInt16 nKeyCnt = aInfFile.GetKeyCount();
|
||||
@@ -1047,7 +1047,7 @@ bool ODbaseTable::CreateImpl()
|
||||
if (bMemoFile)
|
||||
{
|
||||
OUString aExt = aURL.getExtension();
|
||||
aURL.setExtension("dbt"); // extension for memo file
|
||||
aURL.setExtension(u"dbt"); // extension for memo file
|
||||
|
||||
bool bMemoAlreadyExists = false;
|
||||
try
|
||||
@@ -1394,7 +1394,7 @@ bool ODbaseTable::Drop_Static(const OUString& _sUrl, bool _bHasMemoFields, OColl
|
||||
{
|
||||
if (_bHasMemoFields)
|
||||
{ // delete the memo fields
|
||||
aURL.setExtension("dbt");
|
||||
aURL.setExtension(u"dbt");
|
||||
bDropped = ::utl::UCBContentHelper::Kill(aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE));
|
||||
}
|
||||
|
||||
@@ -1414,7 +1414,7 @@ bool ODbaseTable::Drop_Static(const OUString& _sUrl, bool _bHasMemoFields, OColl
|
||||
{
|
||||
}
|
||||
}
|
||||
aURL.setExtension("inf");
|
||||
aURL.setExtension(u"inf");
|
||||
|
||||
// as the inf file does not necessarily exist, we aren't allowed to use UCBContentHelper::Kill
|
||||
try
|
||||
@@ -2272,7 +2272,7 @@ void SAL_CALL ODbaseTable::rename( const OUString& newName )
|
||||
namespace
|
||||
{
|
||||
void renameFile(file::OConnection const * _pConnection,std::u16string_view oldName,
|
||||
const OUString& newName,const OUString& _sExtension)
|
||||
const OUString& newName, std::u16string_view _sExtension)
|
||||
{
|
||||
OUString aName = ODbaseTable::getEntry(_pConnection,oldName);
|
||||
if(aName.isEmpty())
|
||||
@@ -2319,7 +2319,7 @@ void ODbaseTable::renameImpl( const OUString& newName )
|
||||
renameFile(m_pConnection,m_Name,newName,m_pConnection->getExtension());
|
||||
if ( HasMemoFields() )
|
||||
{ // delete the memo fields
|
||||
renameFile(m_pConnection,m_Name,newName,"dbt");
|
||||
renameFile(m_pConnection,m_Name,newName,u"dbt");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
|
||||
|
||||
namespace
|
||||
{
|
||||
sal_Int16 isCaseSensitiveParentFolder( const OUString& _rFolderOrDoc, const OUString& _rDocName )
|
||||
sal_Int16 isCaseSensitiveParentFolder( const OUString& _rFolderOrDoc, std::u16string_view _rDocName )
|
||||
{
|
||||
sal_Int16 nIsCS = 1;
|
||||
try
|
||||
|
||||
@@ -101,7 +101,7 @@ void SvxHyperlinkInternetTp::FillDlgFields(const OUString& rStrURL)
|
||||
|
||||
//do not show password and user in url
|
||||
if(!aURL.GetUser().isEmpty() || !aURL.GetPass().isEmpty() )
|
||||
aURL.SetUserAndPass("", "");
|
||||
aURL.SetUserAndPass(u"", u"");
|
||||
}
|
||||
|
||||
// set URL-field
|
||||
|
||||
@@ -56,7 +56,7 @@ OUString CreateUiNameFromURL( const OUString& aStrURL )
|
||||
{
|
||||
//remove password from name
|
||||
INetURLObject aTmpURL(aURLObj);
|
||||
aTmpURL.SetPass("");
|
||||
aTmpURL.SetPass(u"");
|
||||
aStrUiURL = aTmpURL.GetMainURL( INetURLObject::DecodeMechanism::Unambiguous );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -322,7 +322,7 @@ IMPL_LINK_NOARG(ScreenshotAnnotationDlg_Impl, saveButtonHandler, weld::Button&,
|
||||
|
||||
if (aCurrentExtension.isEmpty())
|
||||
{
|
||||
aConfirmedURL.setExtension("png");
|
||||
aConfirmedURL.setExtension(u"png");
|
||||
}
|
||||
|
||||
// open stream
|
||||
|
||||
@@ -759,7 +759,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickSaveHdl_Impl, weld::Button&, void)
|
||||
aFile.Append( pDashList->GetName() );
|
||||
|
||||
if( aFile.getExtension().isEmpty() )
|
||||
aFile.SetExtension( "sod" );
|
||||
aFile.SetExtension( u"sod" );
|
||||
}
|
||||
|
||||
aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
|
||||
|
||||
@@ -579,7 +579,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl, weld::Button&, void)
|
||||
aFile.Append( pLineEndList->GetName() );
|
||||
|
||||
if( aFile.getExtension().isEmpty() )
|
||||
aFile.SetExtension( "soe" );
|
||||
aFile.SetExtension( u"soe" );
|
||||
}
|
||||
|
||||
aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
|
||||
|
||||
@@ -276,7 +276,7 @@ void ODbaseIndexDialog::Init()
|
||||
OTableInfo& rTabInfo = m_aTableInfoList.back();
|
||||
|
||||
// open the INF file
|
||||
aURL.setExtension("inf");
|
||||
aURL.setExtension(u"inf");
|
||||
OFileNotation aTransformer(aURL.GetURLNoPass(), OFileNotation::N_URL);
|
||||
Config aInfFile( aTransformer.get(OFileNotation::N_SYSTEM) );
|
||||
aInfFile.SetGroup( aGroupIdent );
|
||||
@@ -363,7 +363,7 @@ void OTableInfo::WriteInfFile( const OUString& rDSN ) const
|
||||
}
|
||||
aURL.SetSmartURL(aDsn);
|
||||
aURL.Append(aTableName);
|
||||
aURL.setExtension("inf");
|
||||
aURL.setExtension(u"inf");
|
||||
|
||||
OFileNotation aTransformer(aURL.GetURLNoPass(), OFileNotation::N_URL);
|
||||
Config aInfFile( aTransformer.get(OFileNotation::N_SYSTEM) );
|
||||
|
||||
@@ -816,7 +816,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
|
||||
if (bFolderExists)
|
||||
{
|
||||
i++;
|
||||
pURL->setName(sLastSegmentName + OUString::number(i));
|
||||
pURL->setName(OUString(sLastSegmentName + OUString::number(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -834,7 +834,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
|
||||
bElementExists = xSimpleFileAccess->exists( aExistenceCheck.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
|
||||
if ( bElementExists )
|
||||
{
|
||||
aExistenceCheck.setBase( BaseName + OUString::number( i ) );
|
||||
aExistenceCheck.setBase( OUString(BaseName + OUString::number( i ) ));
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ void batchPrint( const OUString &rPrinterName, const Reference< XPrintable > &xD
|
||||
aPrinterName=rPrinterName.copy( 0, nPathIndex );
|
||||
|
||||
INetURLObject aOutFilename( aObj );
|
||||
aOutFilename.SetExtension( "pdf" );
|
||||
aOutFilename.SetExtension( u"pdf" );
|
||||
FileBase::getFileURLFromSystemPath( aFilterOut, aFilterOut );
|
||||
OUString aOutFile = aFilterOut + "/" + aOutFilename.getName();
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ SvxAutoCorrCfg::SvxAutoCorrCfg() :
|
||||
for( OUString* pS : { &sSharePath, &sUserPath } )
|
||||
{
|
||||
INetURLObject aPath( *pS );
|
||||
aPath.insertName("acor");
|
||||
aPath.insertName(u"acor");
|
||||
*pS = aPath.GetMainURL(INetURLObject::DecodeMechanism::ToIUri);
|
||||
}
|
||||
pAutoCorrect.reset( new SvxAutoCorrect( sSharePath, sUserPath ) );
|
||||
|
||||
@@ -2530,7 +2530,7 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl()
|
||||
aDest = INetURLObject ( sUserAutoCorrFile );
|
||||
if ( SotStorage::IsOLEStorage ( sShareAutoCorrFile ) )
|
||||
{
|
||||
aDest.SetExtension ( "bak" );
|
||||
aDest.SetExtension ( u"bak" );
|
||||
bConvert = true;
|
||||
}
|
||||
bCopy = true;
|
||||
@@ -2539,7 +2539,7 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl()
|
||||
{
|
||||
aSource = INetURLObject ( sUserAutoCorrFile );
|
||||
aDest = INetURLObject ( sUserAutoCorrFile );
|
||||
aDest.SetExtension ( "bak" );
|
||||
aDest.SetExtension ( u"bak" );
|
||||
bCopy = bConvert = true;
|
||||
}
|
||||
if (bCopy)
|
||||
|
||||
@@ -639,7 +639,7 @@ void SubstitutePathVariables::SetPredefinedPathVariables()
|
||||
// Set $(prog), $(progpath), $(progurl)
|
||||
INetURLObject aProgObj(
|
||||
m_aPreDefVars.m_FixedVar[PREDEFVAR_BRANDBASEURL] );
|
||||
if ( !aProgObj.HasError() && aProgObj.insertName( LIBO_BIN_FOLDER ) )
|
||||
if ( !aProgObj.HasError() && aProgObj.insertName( u"" LIBO_BIN_FOLDER ) )
|
||||
{
|
||||
m_aPreDefVars.m_FixedVar[ PREDEFVAR_PROGPATH ] = aProgObj.GetMainURL(INetURLObject::DecodeMechanism::NONE);
|
||||
m_aPreDefVars.m_FixedVar[ PREDEFVAR_PROGURL ] = m_aPreDefVars.m_FixedVar[ PREDEFVAR_PROGPATH ];
|
||||
|
||||
@@ -101,8 +101,8 @@ void lcl_ParserHelper(INetURLObject& _rParser, css::util::URL& _rURL,bool _bUseI
|
||||
if ( _bUseIntern )
|
||||
_rURL.Complete = _rURL.Complete.intern();
|
||||
|
||||
_rParser.SetMark ( OUString() );
|
||||
_rParser.SetParam( OUString() );
|
||||
_rParser.SetMark( u"" );
|
||||
_rParser.SetParam( u"" );
|
||||
|
||||
_rURL.Main = _rParser.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ std::vector< OUString > GetDictionaryPaths();
|
||||
|
||||
/// @returns a URL for a new and writable dictionary rDicName.
|
||||
/// The URL will point to the path given by 'GetDictionaryWriteablePath'
|
||||
LNG_DLLPUBLIC OUString GetWritableDictionaryURL( const OUString &rDicName );
|
||||
LNG_DLLPUBLIC OUString GetWritableDictionaryURL( std::u16string_view rDicName );
|
||||
|
||||
LNG_DLLPUBLIC sal_Int32 GetPosInWordToCheck( const OUString &rTxt, sal_Int32 nPos );
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ public:
|
||||
OUString GetPath(sal_uInt16 nRegion, sal_uInt16 nIdx) const;
|
||||
|
||||
// Allows to retrieve the target template URL from the UCB
|
||||
OUString GetTemplateTargetURLFromComponent( const OUString& aGroupName,
|
||||
const OUString& aTitle );
|
||||
OUString GetTemplateTargetURLFromComponent(std::u16string_view aGroupName,
|
||||
std::u16string_view aTitle );
|
||||
|
||||
// Convert a resource string - a template name - to its localised pair
|
||||
// if it exists in sfx2/inc/strings.hxx
|
||||
|
||||
@@ -140,8 +140,8 @@ class SVX_DLLPUBLIC NBOTypeMgrBase
|
||||
const OUString& GetNumCharFmtName() const { return aNumCharFmtName;}
|
||||
MapUnit GetMapUnit() const { return eCoreUnit;}
|
||||
protected:
|
||||
void ImplLoad(const OUString& filename);
|
||||
void ImplStore(const OUString& filename);
|
||||
void ImplLoad(std::u16string_view filename);
|
||||
void ImplStore(std::u16string_view filename);
|
||||
|
||||
};
|
||||
|
||||
|
||||
+40
-40
@@ -295,8 +295,8 @@ public:
|
||||
EncodeMechanism eMechanism = EncodeMechanism::WasEncoded,
|
||||
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
|
||||
|
||||
bool ConcatData(INetProtocol eTheScheme, OUString const & rTheUser,
|
||||
OUString const & rThePassword,
|
||||
bool ConcatData(INetProtocol eTheScheme, std::u16string_view rTheUser,
|
||||
std::u16string_view rThePassword,
|
||||
OUString const & rTheHost, sal_uInt32 nThePort,
|
||||
OUString const & rThePath);
|
||||
|
||||
@@ -359,14 +359,14 @@ public:
|
||||
|
||||
OUString getExternalURL() const;
|
||||
|
||||
static inline bool translateToExternal(OUString const & rTheIntURIRef,
|
||||
static inline bool translateToExternal(std::u16string_view rTheIntURIRef,
|
||||
OUString & rTheExtURIRef,
|
||||
DecodeMechanism eDecodeMechanism
|
||||
= DecodeMechanism::ToIUri,
|
||||
rtl_TextEncoding eCharset
|
||||
= RTL_TEXTENCODING_UTF8);
|
||||
|
||||
static inline bool translateToInternal(OUString const & rTheExtURIRef,
|
||||
static inline bool translateToInternal(std::u16string_view rTheExtURIRef,
|
||||
OUString & rTheIntURIRef,
|
||||
DecodeMechanism eDecodeMechanism
|
||||
= DecodeMechanism::ToIUri,
|
||||
@@ -423,13 +423,13 @@ public:
|
||||
= RTL_TEXTENCODING_UTF8) const
|
||||
{ return decode(m_aAuth, eMechanism, eCharset); }
|
||||
|
||||
bool SetUser(OUString const & rTheUser)
|
||||
bool SetUser(std::u16string_view rTheUser)
|
||||
{ return setUser(rTheUser, RTL_TEXTENCODING_UTF8); }
|
||||
|
||||
inline bool SetPass(OUString const & rThePassword);
|
||||
inline bool SetPass(std::u16string_view rThePassword);
|
||||
|
||||
inline bool SetUserAndPass(OUString const & rTheUser,
|
||||
OUString const & rThePassword);
|
||||
inline bool SetUserAndPass(std::u16string_view rTheUser,
|
||||
std::u16string_view rThePassword);
|
||||
|
||||
// Host and Port:
|
||||
|
||||
@@ -541,7 +541,7 @@ public:
|
||||
the specified place to insert the new segment does not exist, false is
|
||||
returned. If false is returned, the object is not modified.
|
||||
*/
|
||||
bool insertName(OUString const & rTheName,
|
||||
bool insertName(std::u16string_view rTheName,
|
||||
bool bAppendFinalSlash = false,
|
||||
sal_Int32 nIndex = LAST_SEGMENT,
|
||||
EncodeMechanism eMechanism = EncodeMechanism::WasEncoded,
|
||||
@@ -583,7 +583,7 @@ public:
|
||||
a last segment does not exist, false is returned. If false is
|
||||
returned, the object is not modified.
|
||||
*/
|
||||
bool setName(OUString const& rTheName,
|
||||
bool setName(std::u16string_view rTheName,
|
||||
EncodeMechanism eMechanism = EncodeMechanism::WasEncoded,
|
||||
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
|
||||
|
||||
@@ -627,7 +627,7 @@ public:
|
||||
the specified segment does not exist, false is returned. If false is
|
||||
returned, the object is not modified.
|
||||
*/
|
||||
bool setBase(OUString const & rTheBase,
|
||||
bool setBase(std::u16string_view rTheBase,
|
||||
sal_Int32 nIndex = LAST_SEGMENT,
|
||||
EncodeMechanism eMechanism = EncodeMechanism::WasEncoded,
|
||||
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
|
||||
@@ -680,7 +680,7 @@ public:
|
||||
the specified segment does not exist, false is returned. If false is
|
||||
returned, the object is not modified.
|
||||
*/
|
||||
bool setExtension(OUString const & rTheExtension,
|
||||
bool setExtension(std::u16string_view rTheExtension,
|
||||
sal_Int32 nIndex = LAST_SEGMENT,
|
||||
bool bIgnoreFinalSlash = true,
|
||||
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
|
||||
@@ -736,7 +736,7 @@ public:
|
||||
= RTL_TEXTENCODING_UTF8) const
|
||||
{ return decode(m_aQuery, DecodeMechanism::NONE, eCharset); }
|
||||
|
||||
inline bool SetParam(OUString const & rTheQuery,
|
||||
inline bool SetParam(std::u16string_view rTheQuery,
|
||||
EncodeMechanism eMechanism = EncodeMechanism::WasEncoded,
|
||||
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
|
||||
|
||||
@@ -749,7 +749,7 @@ public:
|
||||
= RTL_TEXTENCODING_UTF8) const
|
||||
{ return decode(m_aFragment, eMechanism, eCharset); }
|
||||
|
||||
inline bool SetMark(OUString const & rTheFragment,
|
||||
inline bool SetMark(std::u16string_view rTheFragment,
|
||||
EncodeMechanism eMechanism = EncodeMechanism::WasEncoded,
|
||||
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
|
||||
|
||||
@@ -823,7 +823,7 @@ public:
|
||||
@return The text, encoded according to the given mechanism and
|
||||
charset ('forbidden' characters replaced by escape sequences).
|
||||
*/
|
||||
static inline OUString encode(OUString const & rText, Part ePart,
|
||||
static inline OUString encode(std::u16string_view rText, Part ePart,
|
||||
EncodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset
|
||||
= RTL_TEXTENCODING_UTF8);
|
||||
@@ -889,7 +889,7 @@ public:
|
||||
*/
|
||||
OUString GetFileExtension() const;
|
||||
|
||||
bool Append(OUString const & rTheSegment,
|
||||
bool Append(std::u16string_view rTheSegment,
|
||||
EncodeMechanism eMechanism = EncodeMechanism::WasEncoded,
|
||||
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
|
||||
|
||||
@@ -903,11 +903,11 @@ public:
|
||||
|
||||
OUString GetPath() const;
|
||||
|
||||
void SetBase(OUString const & rTheBase);
|
||||
void SetBase(std::u16string_view rTheBase);
|
||||
|
||||
OUString GetBase() const;
|
||||
|
||||
void SetExtension(OUString const & rTheExtension);
|
||||
void SetExtension(std::u16string_view rTheExtension);
|
||||
|
||||
OUString CutExtension();
|
||||
|
||||
@@ -994,12 +994,12 @@ private:
|
||||
// External URLs:
|
||||
|
||||
static bool convertIntToExt(
|
||||
OUString const & rTheIntURIRef,
|
||||
std::u16string_view rTheIntURIRef,
|
||||
OUString & rTheExtURIRef, DecodeMechanism eDecodeMechanism,
|
||||
rtl_TextEncoding eCharset);
|
||||
|
||||
static bool convertExtToInt(
|
||||
OUString const & rTheExtURIRef,
|
||||
std::u16string_view rTheExtURIRef,
|
||||
OUString & rTheIntURIRef, DecodeMechanism eDecodeMechanism,
|
||||
rtl_TextEncoding eCharset);
|
||||
|
||||
@@ -1024,13 +1024,13 @@ private:
|
||||
// User Info:
|
||||
|
||||
bool setUser(
|
||||
OUString const & rTheUser,
|
||||
std::u16string_view rTheUser,
|
||||
rtl_TextEncoding eCharset);
|
||||
|
||||
bool clearPassword();
|
||||
|
||||
bool setPassword(
|
||||
OUString const & rThePassword,
|
||||
std::u16string_view rThePassword,
|
||||
rtl_TextEncoding eCharset);
|
||||
|
||||
// Host and Port:
|
||||
@@ -1074,7 +1074,7 @@ private:
|
||||
void clearQuery();
|
||||
|
||||
bool setQuery(
|
||||
OUString const & rTheQuery,
|
||||
std::u16string_view rTheQuery,
|
||||
EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
|
||||
|
||||
// Fragment:
|
||||
@@ -1082,7 +1082,7 @@ private:
|
||||
bool clearFragment();
|
||||
|
||||
bool setFragment(
|
||||
OUString const & rTheMark,
|
||||
std::u16string_view rTheMark,
|
||||
EncodeMechanism eMechanism, rtl_TextEncoding eCharset);
|
||||
|
||||
// FILE URLs:
|
||||
@@ -1100,7 +1100,7 @@ private:
|
||||
bool bKeepVisibleEscapes);
|
||||
|
||||
static inline OUString encodeText(
|
||||
OUString const & rTheText, Part ePart,
|
||||
std::u16string_view rTheText, Part ePart,
|
||||
EncodeMechanism eMechanism, rtl_TextEncoding eCharset,
|
||||
bool bKeepVisibleEscapes);
|
||||
|
||||
@@ -1119,14 +1119,14 @@ private:
|
||||
};
|
||||
|
||||
// static
|
||||
inline OUString INetURLObject::encodeText(OUString const & rTheText,
|
||||
inline OUString INetURLObject::encodeText(std::u16string_view rTheText,
|
||||
Part ePart,
|
||||
EncodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset,
|
||||
bool bKeepVisibleEscapes)
|
||||
{
|
||||
return encodeText(rTheText.getStr(),
|
||||
rTheText.getStr() + rTheText.getLength(), ePart,
|
||||
return encodeText(rTheText.data(),
|
||||
rTheText.data() + rTheText.size(), ePart,
|
||||
eMechanism, eCharset, bKeepVisibleEscapes);
|
||||
}
|
||||
|
||||
@@ -1224,7 +1224,7 @@ inline OUString INetURLObject::GetRelURL(OUString const & rTheBaseURIRef,
|
||||
}
|
||||
|
||||
// static
|
||||
inline bool INetURLObject::translateToExternal(OUString const &
|
||||
inline bool INetURLObject::translateToExternal(std::u16string_view
|
||||
rTheIntURIRef,
|
||||
OUString & rTheExtURIRef,
|
||||
DecodeMechanism
|
||||
@@ -1236,7 +1236,7 @@ inline bool INetURLObject::translateToExternal(OUString const &
|
||||
}
|
||||
|
||||
// static
|
||||
inline bool INetURLObject::translateToInternal(OUString const &
|
||||
inline bool INetURLObject::translateToInternal(std::u16string_view
|
||||
rTheExtURIRef,
|
||||
OUString & rTheIntURIRef,
|
||||
DecodeMechanism
|
||||
@@ -1247,27 +1247,27 @@ inline bool INetURLObject::translateToInternal(OUString const &
|
||||
eDecodeMechanism, eCharset);
|
||||
}
|
||||
|
||||
inline bool INetURLObject::SetPass(OUString const & rThePassword)
|
||||
inline bool INetURLObject::SetPass(std::u16string_view rThePassword)
|
||||
{
|
||||
return rThePassword.isEmpty() ?
|
||||
return rThePassword.empty() ?
|
||||
clearPassword() :
|
||||
setPassword(rThePassword, RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
|
||||
inline bool INetURLObject::SetUserAndPass(OUString const & rTheUser,
|
||||
OUString const & rThePassword)
|
||||
inline bool INetURLObject::SetUserAndPass(std::u16string_view rTheUser,
|
||||
std::u16string_view rThePassword)
|
||||
{
|
||||
return setUser(rTheUser, RTL_TEXTENCODING_UTF8)
|
||||
&& (rThePassword.isEmpty() ?
|
||||
&& (rThePassword.empty() ?
|
||||
clearPassword() :
|
||||
setPassword(rThePassword, RTL_TEXTENCODING_UTF8));
|
||||
}
|
||||
|
||||
inline bool INetURLObject::SetParam(OUString const & rTheQuery,
|
||||
inline bool INetURLObject::SetParam(std::u16string_view rTheQuery,
|
||||
EncodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
if (rTheQuery.isEmpty())
|
||||
if (rTheQuery.empty())
|
||||
{
|
||||
clearQuery();
|
||||
return false;
|
||||
@@ -1275,17 +1275,17 @@ inline bool INetURLObject::SetParam(OUString const & rTheQuery,
|
||||
return setQuery(rTheQuery, eMechanism, eCharset);
|
||||
}
|
||||
|
||||
inline bool INetURLObject::SetMark(OUString const & rTheFragment,
|
||||
inline bool INetURLObject::SetMark(std::u16string_view rTheFragment,
|
||||
EncodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
return rTheFragment.isEmpty() ?
|
||||
return rTheFragment.empty() ?
|
||||
clearFragment() :
|
||||
setFragment(rTheFragment, eMechanism, eCharset);
|
||||
}
|
||||
|
||||
// static
|
||||
inline OUString INetURLObject::encode(OUString const & rText, Part ePart,
|
||||
inline OUString INetURLObject::encode(std::u16string_view rText, Part ePart,
|
||||
EncodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
|
||||
@@ -144,7 +144,7 @@ std::vector< OUString > GetDictionaryPaths()
|
||||
return GetMultiPaths_Impl( u"Dictionary", PATH_FLAG_ALL );
|
||||
}
|
||||
|
||||
OUString GetWritableDictionaryURL( const OUString &rDicName )
|
||||
OUString GetWritableDictionaryURL( std::u16string_view rDicName )
|
||||
{
|
||||
// new user writable dictionaries should be created in the 'writable' path
|
||||
OUString aDirName( GetDictionaryWriteablePath() );
|
||||
|
||||
@@ -54,7 +54,7 @@ void ScDataProvidersTest::testCSVImport()
|
||||
CPPUNIT_ASSERT(bInserted);
|
||||
|
||||
OUString aFileURL;
|
||||
createFileURL(u"test1.", "csv", aFileURL);
|
||||
createFileURL(u"test1.", u"csv", aFileURL);
|
||||
sc::ExternalDataSource aDataSource(aFileURL, "org.libreoffice.calc.csv", m_pDoc);
|
||||
aDataSource.setDBData(pDBData->GetName());
|
||||
|
||||
@@ -82,7 +82,7 @@ void ScDataProvidersTest::testDataLargerThanDB()
|
||||
CPPUNIT_ASSERT(bInserted);
|
||||
|
||||
OUString aFileURL;
|
||||
createFileURL(u"test1.", "csv", aFileURL);
|
||||
createFileURL(u"test1.", u"csv", aFileURL);
|
||||
sc::ExternalDataSource aDataSource(aFileURL, "org.libreoffice.calc.csv", m_pDoc);
|
||||
aDataSource.setDBData(pDBData->GetName());
|
||||
|
||||
@@ -110,7 +110,7 @@ void ScDataProvidersTest::testHTMLImport()
|
||||
CPPUNIT_ASSERT(bInserted);
|
||||
|
||||
OUString aFileURL;
|
||||
createFileURL(u"test1.", "html", aFileURL);
|
||||
createFileURL(u"test1.", u"html", aFileURL);
|
||||
sc::ExternalDataSource aDataSource(aFileURL, "org.libreoffice.calc.html", m_pDoc);
|
||||
aDataSource.setID("//table");
|
||||
aDataSource.setDBData(pDBData->GetName());
|
||||
@@ -160,7 +160,7 @@ void ScDataProvidersTest::testXMLImport()
|
||||
aRangeLink.maRowGroups.push_back("/bookstore/book");
|
||||
aParam.maRangeLinks.push_back(aRangeLink);
|
||||
|
||||
createFileURL(u"test1.", "xml", aFileURL);
|
||||
createFileURL(u"test1.", u"xml", aFileURL);
|
||||
sc::ExternalDataSource aDataSource(aFileURL, "org.libreoffice.calc.xml", m_pDoc);
|
||||
aDataSource.setDBData("testDB");
|
||||
aDataSource.setXMLImportParam(aParam);
|
||||
|
||||
@@ -307,7 +307,7 @@ void ScFiltersTest::testContentLotus123()
|
||||
void ScFiltersTest::testContentofz9704()
|
||||
{
|
||||
OUString aFileName;
|
||||
createFileURL(u"ofz9704.", "123", aFileName);
|
||||
createFileURL(u"ofz9704.", u"123", aFileName);
|
||||
SvFileStream aFileStream(aFileName, StreamMode::READ);
|
||||
TestImportWKS(aFileStream);
|
||||
}
|
||||
|
||||
@@ -642,7 +642,7 @@ OUString EnsureSeparator(const OUStringBuffer& rFilePath)
|
||||
}
|
||||
|
||||
void ScBootstrapFixture::createFileURL(
|
||||
std::u16string_view aFileBase, const OUString& aFileExtension, OUString& rFilePath)
|
||||
std::u16string_view aFileBase, std::u16string_view aFileExtension, OUString& rFilePath)
|
||||
{
|
||||
// m_aBaseString and aFileBase may contain multiple segments, so use
|
||||
// GetNewAbsURL instead of insertName for them:
|
||||
@@ -650,7 +650,7 @@ void ScBootstrapFixture::createFileURL(
|
||||
url.setFinalSlash();
|
||||
url.GetNewAbsURL(m_aBaseString, &url);
|
||||
url.insertName(aFileExtension, true);
|
||||
url.GetNewAbsURL(aFileBase + aFileExtension, &url);
|
||||
url.GetNewAbsURL(OUString::Concat(aFileBase) + aFileExtension, &url);
|
||||
rFilePath = url.GetMainURL(INetURLObject::DecodeMechanism::NONE);
|
||||
}
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
explicit ScBootstrapFixture( const OUString& rsBaseString );
|
||||
virtual ~ScBootstrapFixture() override;
|
||||
|
||||
void createFileURL(std::u16string_view aFileBase, const OUString& aFileExtension, OUString& rFilePath);
|
||||
void createFileURL(std::u16string_view aFileBase, std::u16string_view aFileExtension, OUString& rFilePath);
|
||||
void createCSVPath(const char* aFileBase, OUString& rCSVPath);
|
||||
void createCSVPath(std::u16string_view aFileBase, OUString& rCSVPath);
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ ErrCode ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocume
|
||||
{
|
||||
// try to load *.FM3 file
|
||||
INetURLObject aURL( rMedium.GetURLObject() );
|
||||
aURL.setExtension( "FM3" );
|
||||
aURL.setExtension( u"FM3" );
|
||||
SfxMedium aMedium( aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), StreamMode::STD_READ );
|
||||
pStream = aMedium.GetInStream();
|
||||
if ( pStream )
|
||||
|
||||
@@ -2450,7 +2450,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
|
||||
|
||||
INetURLObject aTmpFile( rMed.GetPhysicalName(), INetProtocol::File );
|
||||
if ( bHasMemo )
|
||||
aTmpFile.setExtension("dbt");
|
||||
aTmpFile.setExtension(u"dbt");
|
||||
if ( eError != ERRCODE_NONE && !eError.IsWarning() )
|
||||
{
|
||||
if (!GetError())
|
||||
@@ -2465,7 +2465,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
|
||||
{
|
||||
const SfxStringItem* pNameItem = rMed.GetItemSet()->GetItem<SfxStringItem>( SID_FILE_NAME );
|
||||
INetURLObject aDbtFile( pNameItem->GetValue(), INetProtocol::File );
|
||||
aDbtFile.setExtension("dbt");
|
||||
aDbtFile.setExtension(u"dbt");
|
||||
|
||||
// tdf#40713: don't lose dbt file
|
||||
// if aDbtFile corresponds exactly to aTmpFile, we just have to return
|
||||
|
||||
@@ -2470,7 +2470,7 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
|
||||
{
|
||||
// Generate a relative file path.
|
||||
INetURLObject aBaseURL(getOwnDocumentName());
|
||||
aBaseURL.insertName("content.xml");
|
||||
aBaseURL.insertName(u"content.xml");
|
||||
|
||||
OUString aStr = URIHelper::simpleNormalizedMakeRelative(
|
||||
aBaseURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), aFile);
|
||||
@@ -2657,7 +2657,7 @@ void ScExternalRefManager::SrcFileData::maybeCreateRealFileName(const OUString&
|
||||
// Formulate the absolute file path from the relative path.
|
||||
const OUString& rRelPath = maRelativeName;
|
||||
INetURLObject aBaseURL(rOwnDocName);
|
||||
aBaseURL.insertName("content.xml");
|
||||
aBaseURL.insertName(u"content.xml");
|
||||
bool bWasAbs = false;
|
||||
maRealFileName = aBaseURL.smartRel2Abs(rRelPath, bWasAbs).GetMainURL(INetURLObject::DecodeMechanism::NONE);
|
||||
}
|
||||
|
||||
@@ -1644,9 +1644,9 @@ OUString StringResourcePersistenceImpl::implGetPathForLocaleItem
|
||||
INetURLObject aInetObj( aLocation );
|
||||
aInetObj.insertName( aFileName, true, INetURLObject::LAST_SEGMENT, INetURLObject::EncodeMechanism::All );
|
||||
if( bDefaultFile )
|
||||
aInetObj.setExtension( "default" );
|
||||
aInetObj.setExtension( u"default" );
|
||||
else
|
||||
aInetObj.setExtension( "properties" );
|
||||
aInetObj.setExtension( u"properties" );
|
||||
OUString aCompleteFileName = aInetObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
return aCompleteFileName;
|
||||
}
|
||||
|
||||
@@ -2841,7 +2841,7 @@ bool HtmlExport::CopyScript( std::u16string_view rPath, const OUString& rSource,
|
||||
INetURLObject aURL( SvtPathOptions().GetConfigPath() );
|
||||
OUStringBuffer aScriptBuf;
|
||||
|
||||
aURL.Append( "webcast" );
|
||||
aURL.Append( u"webcast" );
|
||||
aURL.Append( rSource );
|
||||
|
||||
meEC.SetContext( STR_HTMLEXP_ERROR_OPEN_FILE, rSource );
|
||||
|
||||
@@ -1418,7 +1418,7 @@ void SdPublishingDlg::Load()
|
||||
m_bDesignListDirty = false;
|
||||
|
||||
INetURLObject aURL( SvtPathOptions().GetUserConfigPath() );
|
||||
aURL.Append( "designs.sod" );
|
||||
aURL.Append( u"designs.sod" );
|
||||
|
||||
// check if file exists, SfxMedium shows an errorbox else
|
||||
{
|
||||
@@ -1472,7 +1472,7 @@ void SdPublishingDlg::Load()
|
||||
bool SdPublishingDlg::Save()
|
||||
{
|
||||
INetURLObject aURL( SvtPathOptions().GetUserConfigPath() );
|
||||
aURL.Append( "designs.sod" );
|
||||
aURL.Append( u"designs.sod" );
|
||||
SfxMedium aMedium( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::WRITE | StreamMode::TRUNC );
|
||||
|
||||
SvStream* pStream = aMedium.GetOutStream();
|
||||
|
||||
@@ -176,7 +176,7 @@ tools::SvRef<SotStorageStream> SdModule::GetOptionStream( std::u16string_view rO
|
||||
{
|
||||
INetURLObject aURL( SvtPathOptions().GetUserConfigPath() );
|
||||
|
||||
aURL.Append( "drawing.cfg" );
|
||||
aURL.Append( u"drawing.cfg" );
|
||||
|
||||
std::unique_ptr<SvStream> pStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READWRITE );
|
||||
|
||||
|
||||
@@ -422,7 +422,7 @@ bool SfxApplication::InitializeDde()
|
||||
|
||||
// Config path as a topic because of multiple starts
|
||||
INetURLObject aOfficeLockFile( SvtPathOptions().GetUserConfigPath() );
|
||||
aOfficeLockFile.insertName( "soffice.lck" );
|
||||
aOfficeLockFile.insertName( u"soffice.lck" );
|
||||
OUString aService( SfxDdeServiceName_Impl(
|
||||
aOfficeLockFile.GetMainURL(INetURLObject::DecodeMechanism::ToIUri) ) );
|
||||
aService = aService.toAsciiUpperCase();
|
||||
|
||||
@@ -2469,7 +2469,7 @@ void SfxMedium::DoBackup_Impl()
|
||||
// save as ".bak" file
|
||||
INetURLObject aDest( aBakDir );
|
||||
aDest.insertName( aSource.getName() );
|
||||
aDest.setExtension( "bak" );
|
||||
aDest.setExtension( u"bak" );
|
||||
OUString aFileName = aDest.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset );
|
||||
|
||||
// create a content for the source file
|
||||
@@ -3370,7 +3370,7 @@ const INetURLObject& SfxMedium::GetURLObject() const
|
||||
if (!pImpl->m_pURLObj)
|
||||
{
|
||||
pImpl->m_pURLObj.reset( new INetURLObject( pImpl->m_aLogicName ) );
|
||||
pImpl->m_pURLObj->SetMark("");
|
||||
pImpl->m_pURLObj->SetMark(u"");
|
||||
}
|
||||
|
||||
return *pImpl->m_pURLObj;
|
||||
|
||||
@@ -423,8 +423,8 @@ OUString SfxDocumentTemplates::GetPath
|
||||
}
|
||||
|
||||
|
||||
OUString SfxDocumentTemplates::GetTemplateTargetURLFromComponent( const OUString& aGroupName,
|
||||
const OUString& aTitle )
|
||||
OUString SfxDocumentTemplates::GetTemplateTargetURLFromComponent( std::u16string_view aGroupName,
|
||||
std::u16string_view aTitle )
|
||||
{
|
||||
DocTemplLocker_Impl aLocker( *pImp );
|
||||
|
||||
|
||||
@@ -291,15 +291,15 @@ public:
|
||||
bool addTemplate( const OUString& rGroupName,
|
||||
const OUString& rTemplateName,
|
||||
const OUString& rSourceURL );
|
||||
bool removeTemplate( const OUString& rGroupName,
|
||||
const OUString& rTemplateName );
|
||||
bool renameTemplate( const OUString& rGroupName,
|
||||
const OUString& rOldName,
|
||||
bool removeTemplate( std::u16string_view rGroupName,
|
||||
std::u16string_view rTemplateName );
|
||||
bool renameTemplate( std::u16string_view rGroupName,
|
||||
std::u16string_view rOldName,
|
||||
const OUString& rNewName );
|
||||
|
||||
bool addGroup( const OUString& rGroupName );
|
||||
bool removeGroup( const OUString& rGroupName );
|
||||
bool renameGroup( const OUString& rOldName,
|
||||
bool removeGroup( std::u16string_view rGroupName );
|
||||
bool renameGroup( std::u16string_view rOldName,
|
||||
const OUString& rNewName );
|
||||
|
||||
void update();
|
||||
@@ -1197,7 +1197,7 @@ void SfxDocTplService_Impl::doUpdate()
|
||||
std::vector< beans::StringPair > SfxDocTplService_Impl::ReadUINamesForTemplateDir_Impl( const OUString& aUserPath )
|
||||
{
|
||||
INetURLObject aLocObj( aUserPath );
|
||||
aLocObj.insertName( "groupuinames.xml", false,
|
||||
aLocObj.insertName( u"groupuinames.xml", false,
|
||||
INetURLObject::LAST_SEGMENT,
|
||||
INetURLObject::EncodeMechanism::All );
|
||||
Content aLocContent;
|
||||
@@ -1464,7 +1464,7 @@ bool SfxDocTplService_Impl::addGroup( const OUString& rGroupName )
|
||||
}
|
||||
|
||||
|
||||
bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName )
|
||||
bool SfxDocTplService_Impl::removeGroup( std::u16string_view rGroupName )
|
||||
{
|
||||
// remove all the elements that have the prefix aTargetURL
|
||||
// if the group does not have other elements remove it
|
||||
@@ -1570,7 +1570,7 @@ bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName )
|
||||
}
|
||||
|
||||
|
||||
bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName,
|
||||
bool SfxDocTplService_Impl::renameGroup( std::u16string_view rOldName,
|
||||
const OUString& rNewName )
|
||||
{
|
||||
::osl::MutexGuard aGuard( maMutex );
|
||||
@@ -2005,8 +2005,8 @@ OUString SfxDocTplService_Impl::findParentTemplateDir(const OUString& rURL) cons
|
||||
return OUString();
|
||||
}
|
||||
|
||||
bool SfxDocTplService_Impl::removeTemplate( const OUString& rGroupName,
|
||||
const OUString& rTemplateName )
|
||||
bool SfxDocTplService_Impl::removeTemplate( std::u16string_view rGroupName,
|
||||
std::u16string_view rTemplateName )
|
||||
{
|
||||
::osl::MutexGuard aGuard( maMutex );
|
||||
|
||||
@@ -2054,8 +2054,8 @@ bool SfxDocTplService_Impl::removeTemplate( const OUString& rGroupName,
|
||||
}
|
||||
|
||||
|
||||
bool SfxDocTplService_Impl::renameTemplate( const OUString& rGroupName,
|
||||
const OUString& rOldName,
|
||||
bool SfxDocTplService_Impl::renameTemplate( std::u16string_view rGroupName,
|
||||
std::u16string_view rOldName,
|
||||
const OUString& rNewName )
|
||||
{
|
||||
::osl::MutexGuard aGuard( maMutex );
|
||||
|
||||
@@ -620,7 +620,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
|
||||
|
||||
INetURLObject aFilePathObj( aTempDir.GetURL() );
|
||||
aFilePathObj.insertName( aFileName );
|
||||
aFilePathObj.setExtension( "htm" );
|
||||
aFilePathObj.setExtension( u"htm" );
|
||||
|
||||
OUString aFileURL = aFilePathObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
|
||||
|
||||
@@ -1567,8 +1567,8 @@ void UCBStorage_Impl::Init()
|
||||
if ( m_nError == ERRCODE_NONE )
|
||||
{
|
||||
// read the manifest.xml file
|
||||
aObj.Append( "META-INF" );
|
||||
aObj.Append( "manifest.xml" );
|
||||
aObj.Append( u"META-INF" );
|
||||
aObj.Append( u"manifest.xml" );
|
||||
|
||||
// create input stream
|
||||
std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::STD_READ ));
|
||||
|
||||
@@ -73,7 +73,7 @@ OUString LockFileCommon::GenerateOwnLockFileURL(
|
||||
const OUString& aOrigURL, std::u16string_view aPrefix)
|
||||
{
|
||||
INetURLObject aURL = ResolveLinks(INetURLObject(aOrigURL));
|
||||
aURL.setName(aPrefix + aURL.GetLastName() + "%23" /*'#'*/);
|
||||
aURL.setName(OUString(aPrefix + aURL.GetLastName() + "%23" /*'#'*/));
|
||||
return aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ OUString GenerateMSOLockFileURL(const OUString& aOrigURL)
|
||||
else if (nFileNameLength == 7)
|
||||
sFileName = sFileName.copy(1);
|
||||
}
|
||||
aURL.setName("~$" + sFileName);
|
||||
aURL.setName(OUString("~$" + sFileName));
|
||||
return aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,8 +608,8 @@ void SvtMatchContext_Impl::doExecute()
|
||||
aMatch = aCurObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
else
|
||||
{
|
||||
aCurObj.SetMark( "" );
|
||||
aCurObj.SetParam( "" );
|
||||
aCurObj.SetMark( u"" );
|
||||
aCurObj.SetParam( u"" );
|
||||
aCurObj.SetURLPath( "" );
|
||||
aMatch = aCurObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
}
|
||||
@@ -627,8 +627,8 @@ void SvtMatchContext_Impl::doExecute()
|
||||
aMatch = aCurObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
else
|
||||
{
|
||||
aCurObj.SetMark( "" );
|
||||
aCurObj.SetParam( "" );
|
||||
aCurObj.SetMark( u"" );
|
||||
aCurObj.SetParam( u"" );
|
||||
aCurObj.SetURLPath( "" );
|
||||
aMatch = aCurObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
}
|
||||
|
||||
@@ -707,7 +707,7 @@ namespace svt
|
||||
}
|
||||
|
||||
// append our name
|
||||
aStorageURL.Append( ".templdir.cache" );
|
||||
aStorageURL.Append( u".templdir.cache" );
|
||||
|
||||
// open the stream
|
||||
m_pCacheStream = UcbStreamHelper::CreateStream( aStorageURL.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ),
|
||||
|
||||
@@ -261,10 +261,10 @@ void GalleryObjTest::TestGalleryThemeEntry()
|
||||
INetURLObject aURL(aGalleryURL);
|
||||
aURL.Append(myThemeName);
|
||||
INetURLObject aThemeURL(aURL), aSdvURL(aURL), aSdgURL(aURL), aStrURL(aURL);
|
||||
aThemeURL.setExtension("thm");
|
||||
aSdvURL.setExtension("sdv");
|
||||
aSdgURL.setExtension("sdg");
|
||||
aStrURL.setExtension("str");
|
||||
aThemeURL.setExtension(u"thm");
|
||||
aSdvURL.setExtension(u"sdv");
|
||||
aSdgURL.setExtension(u"sdg");
|
||||
aStrURL.setExtension(u"str");
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("Theme URL doesn't match",
|
||||
aGalleryBinaryStorageLocations.GetThmURL().GetMainURL(
|
||||
INetURLObject::DecodeMechanism::Unambiguous),
|
||||
|
||||
@@ -311,7 +311,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO
|
||||
// check readonlyness the very hard way
|
||||
INetURLObject aTestURL( rBaseURL );
|
||||
|
||||
aTestURL.Append( "cdefghij.klm" );
|
||||
aTestURL.Append( u"cdefghij.klm" );
|
||||
std::unique_ptr<SvStream> pTestStm(::utl::UcbStreamHelper::CreateStream( aTestURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::WRITE ));
|
||||
|
||||
if( pTestStm )
|
||||
@@ -352,8 +352,8 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO
|
||||
|
||||
if (aThmURL.GetFileExtension().equalsIgnoreAsciiCase("thm"))
|
||||
{
|
||||
INetURLObject aSdgURL( aThmURL); aSdgURL.SetExtension( "sdg" );
|
||||
INetURLObject aSdvURL( aThmURL ); aSdvURL.SetExtension( "sdv" );
|
||||
INetURLObject aSdgURL( aThmURL); aSdgURL.SetExtension( u"sdg" );
|
||||
INetURLObject aSdvURL( aThmURL ); aSdvURL.SetExtension( u"sdv" );
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -422,10 +422,10 @@ INetURLObject GalleryBinaryEngine::implCreateUniqueURL(SgaObjKind eObjKind,
|
||||
char const* pExt = nullptr;
|
||||
bool bExists;
|
||||
|
||||
aDir.Append("dragdrop");
|
||||
aDir.Append(u"dragdrop");
|
||||
CreateDir(aDir);
|
||||
|
||||
aInfoFileURL.Append("sdddndx1");
|
||||
aInfoFileURL.Append(u"sdddndx1");
|
||||
|
||||
// read next possible number
|
||||
if (FileExists(aInfoFileURL))
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <com/sun/star/ucb/ContentCreationException.hpp>
|
||||
|
||||
static bool FileExists(const INetURLObject& rURL, const OUString& rExt)
|
||||
static bool FileExists(const INetURLObject& rURL, std::u16string_view rExt)
|
||||
{
|
||||
INetURLObject aURL(rURL);
|
||||
aURL.setExtension(rExt);
|
||||
@@ -56,11 +56,11 @@ void GalleryBinaryEngineEntry::CreateUniqueURL(const INetURLObject& rBaseURL, IN
|
||||
INetURLObject aBaseNoCase(GalleryBinaryStorageLocations::ImplGetURLIgnoreCase(rBaseURL));
|
||||
aURL = aBaseNoCase;
|
||||
static sal_Int32 nIdx = 0;
|
||||
while (FileExists(aURL, "thm"))
|
||||
while (FileExists(aURL, u"thm"))
|
||||
{ // create new URLs
|
||||
nIdx++;
|
||||
aURL = aBaseNoCase;
|
||||
aURL.setName(aURL.getName() + OUString::number(nIdx));
|
||||
aURL.setName(OUString(aURL.getName() + OUString::number(nIdx)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,25 +42,25 @@ INetURLObject GalleryBinaryStorageLocations::ImplGetURLIgnoreCase(const INetURLO
|
||||
|
||||
void GalleryBinaryStorageLocations::SetThmExtension(INetURLObject& aURL)
|
||||
{
|
||||
aURL.setExtension("thm");
|
||||
aURL.setExtension(u"thm");
|
||||
maThmURL = ImplGetURLIgnoreCase(aURL);
|
||||
}
|
||||
|
||||
void GalleryBinaryStorageLocations::SetSdgExtension(INetURLObject& aURL)
|
||||
{
|
||||
aURL.setExtension("sdg");
|
||||
aURL.setExtension(u"sdg");
|
||||
maSdgURL = ImplGetURLIgnoreCase(aURL);
|
||||
}
|
||||
|
||||
void GalleryBinaryStorageLocations::SetSdvExtension(INetURLObject& aURL)
|
||||
{
|
||||
aURL.setExtension("sdv");
|
||||
aURL.setExtension(u"sdv");
|
||||
maSdvURL = ImplGetURLIgnoreCase(aURL);
|
||||
}
|
||||
|
||||
void GalleryBinaryStorageLocations::SetStrExtension(INetURLObject& aURL)
|
||||
{
|
||||
aURL.setExtension("str");
|
||||
aURL.setExtension(u"str");
|
||||
maStrURL = ImplGetURLIgnoreCase(aURL);
|
||||
}
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ void NBOTypeMgrBase::SetItems(const SfxItemSet* pArg) {
|
||||
}
|
||||
}
|
||||
|
||||
void NBOTypeMgrBase::ImplLoad(const OUString& filename)
|
||||
void NBOTypeMgrBase::ImplLoad(std::u16string_view filename)
|
||||
{
|
||||
bIsLoading = true;
|
||||
MapUnit eOldCoreUnit=eCoreUnit;
|
||||
@@ -208,7 +208,7 @@ void NBOTypeMgrBase::ImplLoad(const OUString& filename)
|
||||
eCoreUnit = eOldCoreUnit;
|
||||
bIsLoading = false;
|
||||
}
|
||||
void NBOTypeMgrBase::ImplStore(const OUString& filename)
|
||||
void NBOTypeMgrBase::ImplStore(std::u16string_view filename)
|
||||
{
|
||||
if (bIsLoading) return;
|
||||
MapUnit eOldCoreUnit=eCoreUnit;
|
||||
@@ -379,7 +379,7 @@ NumberingTypeMgr::NumberingTypeMgr()
|
||||
{
|
||||
Init();
|
||||
maDefaultNumberSettingsArr = maNumberSettingsArr;
|
||||
ImplLoad("standard.syb");
|
||||
ImplLoad(u"standard.syb");
|
||||
}
|
||||
|
||||
NumberingTypeMgr::~NumberingTypeMgr()
|
||||
@@ -503,7 +503,7 @@ void NumberingTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_
|
||||
if (!_pSet->bIsCustomized) {
|
||||
_pSet->sDescription = GetDescription(nIndex,true);
|
||||
}
|
||||
ImplStore("standard.syb");
|
||||
ImplStore(u"standard.syb");
|
||||
}
|
||||
|
||||
void NumberingTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault, bool isResetSize)
|
||||
@@ -572,7 +572,7 @@ OutlineTypeMgr::OutlineTypeMgr()
|
||||
}
|
||||
//Initial the first time to store the default value. Then do it again for customized value
|
||||
Init();
|
||||
ImplLoad("standard.syc");
|
||||
ImplLoad(u"standard.syc");
|
||||
}
|
||||
|
||||
namespace {
|
||||
@@ -764,7 +764,7 @@ void OutlineTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uI
|
||||
if (!pItemArr->bIsCustomized) {
|
||||
pItemArr->sDescription = GetDescription(nIndex,true);
|
||||
}
|
||||
ImplStore("standard.syc");
|
||||
ImplStore(u"standard.syc");
|
||||
}
|
||||
|
||||
void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 /*mLevel*/, bool isDefault, bool isResetSize)
|
||||
|
||||
@@ -280,8 +280,8 @@ OUString SwHtmlDomExportTest::GetOlePath()
|
||||
OUString aOleSuffix(".ole");
|
||||
CPPUNIT_ASSERT(aOlePath.endsWith(aOleSuffix));
|
||||
INetURLObject aUrl(maTempFile.GetURL());
|
||||
aUrl.setBase(aOlePath.copy(0, aOlePath.getLength() - aOleSuffix.getLength()));
|
||||
aUrl.setExtension("ole");
|
||||
aUrl.setBase(aOlePath.subView(0, aOlePath.getLength() - aOleSuffix.getLength()));
|
||||
aUrl.setExtension(u"ole");
|
||||
return aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE);
|
||||
}
|
||||
|
||||
@@ -853,8 +853,8 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOle2, "reqif-ole2.xhtml")
|
||||
OUString aOleSuffix(".ole");
|
||||
CPPUNIT_ASSERT(aOlePath.endsWith(aOleSuffix));
|
||||
INetURLObject aUrl(maTempFile.GetURL());
|
||||
aUrl.setBase(aOlePath.copy(0, aOlePath.getLength() - aOleSuffix.getLength()));
|
||||
aUrl.setExtension("ole");
|
||||
aUrl.setBase(aOlePath.subView(0, aOlePath.getLength() - aOleSuffix.getLength()));
|
||||
aUrl.setExtension(u"ole");
|
||||
OUString aOleUrl = aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE);
|
||||
|
||||
// Search for \result in the RTF data.
|
||||
|
||||
@@ -106,7 +106,7 @@ bool SwDoc::IsVisitedURL( const OUString& rURL )
|
||||
if( '#' == rURL[0] && mpDocShell && mpDocShell->GetMedium() )
|
||||
{
|
||||
INetURLObject aIObj( mpDocShell->GetMedium()->GetURLObject() );
|
||||
aIObj.SetMark( rURL.copy( 1 ) );
|
||||
aIObj.SetMark( rURL.subView( 1 ) );
|
||||
bRet = pHist->QueryUrl( aIObj );
|
||||
}
|
||||
else
|
||||
|
||||
@@ -87,7 +87,7 @@ SwImpBlocks::SwImpBlocks( const OUString& rFile )
|
||||
FStatHelper::GetModifiedDateTimeOfFile( rFile,
|
||||
&m_aDateModified, &m_aTimeModified );
|
||||
INetURLObject aObj(rFile);
|
||||
aObj.setExtension( OUString() );
|
||||
aObj.setExtension( u"" );
|
||||
m_aName = aObj.GetBase();
|
||||
}
|
||||
|
||||
|
||||
@@ -1874,7 +1874,7 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF
|
||||
aURL.getExtension() + "_" +
|
||||
OUString::number(aGraphic.GetChecksum(), 16);
|
||||
aURL.setBase(aName);
|
||||
aURL.setExtension("ole");
|
||||
aURL.setExtension(u"ole");
|
||||
aFileName = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE);
|
||||
|
||||
SvFileStream aOutStream(aFileName, StreamMode::WRITE);
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace
|
||||
* itself and a wanted extension.
|
||||
*/
|
||||
OUString lcl_CalculateFileName(const OUString* pOrigFileName, const Graphic& rGraphic,
|
||||
const OUString& rExtension)
|
||||
std::u16string_view rExtension)
|
||||
{
|
||||
OUString aFileName;
|
||||
|
||||
@@ -1522,7 +1522,7 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rFrame
|
||||
|
||||
// Calculate the file name, which is meant to be the same as the
|
||||
// replacement image, just with a .ole extension.
|
||||
OUString aFileName = lcl_CalculateFileName(rHTMLWrt.GetOrigFileName(), aGraphic, "ole");
|
||||
OUString aFileName = lcl_CalculateFileName(rHTMLWrt.GetOrigFileName(), aGraphic, u"ole");
|
||||
|
||||
// Write the data.
|
||||
SwOLEObj& rOLEObj = pOLENd->GetOLEObj();
|
||||
@@ -1631,7 +1631,7 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rFrame
|
||||
if (aGraphic.GetType() == GraphicType::NONE)
|
||||
{
|
||||
// The OLE Object has no replacement image, write a stub.
|
||||
aGraphicURL = lcl_CalculateFileName(rHTMLWrt.GetOrigFileName(), aGraphic, "png");
|
||||
aGraphicURL = lcl_CalculateFileName(rHTMLWrt.GetOrigFileName(), aGraphic, u"png");
|
||||
osl::File aFile(aGraphicURL);
|
||||
aFile.open(osl_File_OpenFlag_Create);
|
||||
aFile.close();
|
||||
|
||||
@@ -431,7 +431,7 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, OkHdl_Impl, weld::Button&, void)
|
||||
{
|
||||
m_sURL = xFP->getSelectedFiles().getConstArray()[0];
|
||||
INetURLObject aResult( m_sURL );
|
||||
aResult.setExtension("csv");
|
||||
aResult.setExtension(u"csv");
|
||||
m_sURL = aResult.GetMainURL(INetURLObject::DecodeMechanism::NONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1657,7 +1657,7 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
|
||||
|
||||
// 1. Does the file already exist in the list of all Documents?
|
||||
INetURLObject aTmpObj( rFileName );
|
||||
aTmpObj.SetMark( OUString() );
|
||||
aTmpObj.SetMark( u"" );
|
||||
|
||||
// Iterate over the DocShell and get the ones with the name
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ void SwChapterNumRules::Save()
|
||||
SvtPathOptions aPathOpt;
|
||||
aURL.SetSmartURL( aPathOpt.GetUserConfigPath() );
|
||||
aURL.setFinalSlash();
|
||||
aURL.Append(CHAPTER_FILENAME);
|
||||
aURL.Append(u"" CHAPTER_FILENAME);
|
||||
|
||||
SfxMedium aMedium( aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), StreamMode::WRITE );
|
||||
SvStream* pStream = aMedium.GetOutStream();
|
||||
|
||||
@@ -2761,7 +2761,7 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType type, const uno::Reference
|
||||
}
|
||||
|
||||
// Construct vnd.sun.star.pkg:// URL
|
||||
OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, const OUString& rStreamRelPath)
|
||||
OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, std::u16string_view rStreamRelPath)
|
||||
{
|
||||
auto xContext(comphelper::getProcessComponentContext());
|
||||
auto xUri = css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace toolkit
|
||||
INetURLObject aURL( i_imageURL );
|
||||
if ( aURL.GetProtocol() != INetProtocol::PrivSoffice )
|
||||
{
|
||||
OSL_VERIFY( aURL.insertName( "sifr", false, 0 ) );
|
||||
OSL_VERIFY( aURL.insertName( u"sifr", false, 0 ) );
|
||||
return aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE );
|
||||
}
|
||||
// the private: scheme is not considered to be hierarchical by INetURLObject, so manually insert the
|
||||
|
||||
@@ -249,26 +249,26 @@ namespace tools_urlobj
|
||||
void testSetName() {
|
||||
{
|
||||
INetURLObject obj("file:///");
|
||||
bool ok = obj.setName("foo");
|
||||
bool ok = obj.setName(u"foo");
|
||||
CPPUNIT_ASSERT(!ok);
|
||||
}
|
||||
{
|
||||
INetURLObject obj("file:///foo");
|
||||
bool ok = obj.setName("bar");
|
||||
bool ok = obj.setName(u"bar");
|
||||
CPPUNIT_ASSERT(ok);
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
OUString("file:///bar"), obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
|
||||
}
|
||||
{
|
||||
INetURLObject obj("file:///foo/");
|
||||
bool ok = obj.setName("bar");
|
||||
bool ok = obj.setName(u"bar");
|
||||
CPPUNIT_ASSERT(ok);
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
OUString("file:///bar/"), obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
|
||||
}
|
||||
{
|
||||
INetURLObject obj("file:///foo/bar");
|
||||
bool ok = obj.setName("baz");
|
||||
bool ok = obj.setName(u"baz");
|
||||
CPPUNIT_ASSERT(ok);
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
OUString("file:///foo/baz"),
|
||||
@@ -276,7 +276,7 @@ namespace tools_urlobj
|
||||
}
|
||||
{
|
||||
INetURLObject obj("file:///foo/bar/");
|
||||
bool ok = obj.setName("baz");
|
||||
bool ok = obj.setName(u"baz");
|
||||
CPPUNIT_ASSERT(ok);
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
OUString("file:///foo/baz/"),
|
||||
@@ -287,7 +287,7 @@ namespace tools_urlobj
|
||||
void testSetExtension() {
|
||||
INetURLObject obj("file:///foo/bar.baz/");
|
||||
bool ok = obj.setExtension(
|
||||
"other", INetURLObject::LAST_SEGMENT, false);
|
||||
u"other", INetURLObject::LAST_SEGMENT, false);
|
||||
CPPUNIT_ASSERT(ok);
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
OUString("file:///foo/bar.baz/.other"),
|
||||
|
||||
@@ -2029,7 +2029,7 @@ bool INetURLObject::convertAbsToRel(OUString const & rTheAbsURIRef,
|
||||
}
|
||||
|
||||
// static
|
||||
bool INetURLObject::convertIntToExt(OUString const & rTheIntURIRef,
|
||||
bool INetURLObject::convertIntToExt(std::u16string_view rTheIntURIRef,
|
||||
OUString & rTheExtURIRef,
|
||||
DecodeMechanism eDecodeMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
@@ -2052,7 +2052,7 @@ bool INetURLObject::convertIntToExt(OUString const & rTheIntURIRef,
|
||||
}
|
||||
|
||||
// static
|
||||
bool INetURLObject::convertExtToInt(OUString const & rTheExtURIRef,
|
||||
bool INetURLObject::convertExtToInt(std::u16string_view rTheExtURIRef,
|
||||
OUString & rTheIntURIRef,
|
||||
DecodeMechanism eDecodeMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
@@ -2227,7 +2227,7 @@ INetURLObject::SubString INetURLObject::getAuthority() const
|
||||
return SubString(nBegin, nEnd - nBegin);
|
||||
}
|
||||
|
||||
bool INetURLObject::setUser(OUString const & rTheUser,
|
||||
bool INetURLObject::setUser(std::u16string_view rTheUser,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
if (
|
||||
@@ -2287,7 +2287,7 @@ bool INetURLObject::clearPassword()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool INetURLObject::setPassword(OUString const & rThePassword,
|
||||
bool INetURLObject::setPassword(std::u16string_view rThePassword,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
if (!getSchemeInfo().m_bPassword)
|
||||
@@ -3147,7 +3147,7 @@ bool INetURLObject::checkHierarchical() const {
|
||||
}
|
||||
}
|
||||
|
||||
bool INetURLObject::Append(OUString const & rTheSegment,
|
||||
bool INetURLObject::Append(std::u16string_view rTheSegment,
|
||||
EncodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
@@ -3200,7 +3200,7 @@ INetURLObject::SubString INetURLObject::getSegment(sal_Int32 nIndex,
|
||||
pSegEnd - pSegBegin);
|
||||
}
|
||||
|
||||
bool INetURLObject::insertName(OUString const & rTheName,
|
||||
bool INetURLObject::insertName(std::u16string_view rTheName,
|
||||
bool bAppendFinalSlash, sal_Int32 nIndex,
|
||||
EncodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
@@ -3298,7 +3298,7 @@ void INetURLObject::clearQuery()
|
||||
}
|
||||
}
|
||||
|
||||
bool INetURLObject::setQuery(OUString const & rTheQuery,
|
||||
bool INetURLObject::setQuery(std::u16string_view rTheQuery,
|
||||
EncodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
@@ -3331,7 +3331,7 @@ bool INetURLObject::clearFragment()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool INetURLObject::setFragment(OUString const & rTheFragment,
|
||||
bool INetURLObject::setFragment(std::u16string_view rTheFragment,
|
||||
EncodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
@@ -3689,8 +3689,8 @@ bool INetURLObject::operator ==(INetURLObject const & rObject) const
|
||||
}
|
||||
|
||||
bool INetURLObject::ConcatData(INetProtocol eTheScheme,
|
||||
OUString const & rTheUser,
|
||||
OUString const & rThePassword,
|
||||
std::u16string_view rTheUser,
|
||||
std::u16string_view rThePassword,
|
||||
OUString const & rTheHost,
|
||||
sal_uInt32 nThePort,
|
||||
OUString const & rThePath)
|
||||
@@ -3708,7 +3708,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme,
|
||||
bool bUserInfo = false;
|
||||
if (getSchemeInfo().m_bUser)
|
||||
{
|
||||
if (!rTheUser.isEmpty())
|
||||
if (!rTheUser.empty())
|
||||
{
|
||||
m_aUser.set(m_aAbsURIRef,
|
||||
encodeText(rTheUser, PART_USER_PASSWORD,
|
||||
@@ -3717,12 +3717,12 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme,
|
||||
bUserInfo = true;
|
||||
}
|
||||
}
|
||||
else if (!rTheUser.isEmpty())
|
||||
else if (!rTheUser.empty())
|
||||
{
|
||||
setInvalid();
|
||||
return false;
|
||||
}
|
||||
if (!rThePassword.isEmpty())
|
||||
if (!rThePassword.empty())
|
||||
{
|
||||
if (getSchemeInfo().m_bPassword)
|
||||
{
|
||||
@@ -4004,7 +4004,7 @@ OUString INetURLObject::getName(sal_Int32 nIndex, bool bIgnoreFinalSlash,
|
||||
return decode(pSegBegin, p, eMechanism, eCharset);
|
||||
}
|
||||
|
||||
bool INetURLObject::setName(OUString const& rTheName, EncodeMechanism eMechanism,
|
||||
bool INetURLObject::setName(std::u16string_view rTheName, EncodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
SubString aSegment(getSegment(LAST_SEGMENT, true));
|
||||
@@ -4077,7 +4077,7 @@ OUString INetURLObject::getBase(sal_Int32 nIndex, bool bIgnoreFinalSlash,
|
||||
return decode(pSegBegin, pExtension, eMechanism, eCharset);
|
||||
}
|
||||
|
||||
bool INetURLObject::setBase(OUString const & rTheBase, sal_Int32 nIndex,
|
||||
bool INetURLObject::setBase(std::u16string_view rTheBase, sal_Int32 nIndex,
|
||||
EncodeMechanism eMechanism,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
@@ -4139,7 +4139,7 @@ OUString INetURLObject::getExtension(sal_Int32 nIndex,
|
||||
return decode(pExtension + 1, p, eMechanism, eCharset);
|
||||
}
|
||||
|
||||
bool INetURLObject::setExtension(OUString const & rTheExtension,
|
||||
bool INetURLObject::setExtension(std::u16string_view rTheExtension,
|
||||
sal_Int32 nIndex, bool bIgnoreFinalSlash,
|
||||
rtl_TextEncoding eCharset)
|
||||
{
|
||||
@@ -4740,7 +4740,7 @@ OUString INetURLObject::GetPath() const
|
||||
return aTemp.PathToFileName();
|
||||
}
|
||||
|
||||
void INetURLObject::SetBase(OUString const & rTheBase)
|
||||
void INetURLObject::SetBase(std::u16string_view rTheBase)
|
||||
{
|
||||
setBase(rTheBase, LAST_SEGMENT, EncodeMechanism::All);
|
||||
}
|
||||
@@ -4750,7 +4750,7 @@ OUString INetURLObject::GetBase() const
|
||||
return getBase(LAST_SEGMENT, true, DecodeMechanism::WithCharset);
|
||||
}
|
||||
|
||||
void INetURLObject::SetExtension(OUString const & rTheExtension)
|
||||
void INetURLObject::SetExtension(std::u16string_view rTheExtension)
|
||||
{
|
||||
setExtension(rTheExtension, LAST_SEGMENT, false);
|
||||
}
|
||||
|
||||
@@ -3338,7 +3338,7 @@ we check in the following sequence:
|
||||
else if( aFileExtension.equalsIgnoreAsciiCase( "ods" ) )
|
||||
bChangeFileExtensionToPDF = true;
|
||||
if( bChangeFileExtensionToPDF )
|
||||
aTargetURL.setExtension("pdf" );
|
||||
aTargetURL.setExtension(u"pdf" );
|
||||
}
|
||||
//check if extension is pdf, see if GoToR should be forced
|
||||
bTargetHasPDFExtension = aTargetURL.GetFileExtension().equalsIgnoreAsciiCase( "pdf" );
|
||||
|
||||
@@ -488,7 +488,7 @@ void ImplImageTree::createStyle()
|
||||
INetURLObject aUrl(path);
|
||||
OSL_ASSERT(!aUrl.HasError());
|
||||
|
||||
bool ok = aUrl.Append("images_" + maCurrentStyle, INetURLObject::EncodeMechanism::All);
|
||||
bool ok = aUrl.Append(OUString("images_" + maCurrentStyle), INetURLObject::EncodeMechanism::All);
|
||||
OSL_ASSERT(ok);
|
||||
sThemeUrl = aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE) + ".zip";
|
||||
if (urlExists(sThemeUrl))
|
||||
|
||||
@@ -212,7 +212,7 @@ void PrinterInfoManager::initialize()
|
||||
for (auto const& printDir : aDirList)
|
||||
{
|
||||
INetURLObject aFile( printDir, INetProtocol::File, INetURLObject::EncodeMechanism::All );
|
||||
aFile.Append( PRINT_FILENAME );
|
||||
aFile.Append( u"" PRINT_FILENAME );
|
||||
Config aConfig( aFile.PathToFileName() );
|
||||
if( aConfig.HasGroup( GLOBAL_DEFAULTS_GROUP ) )
|
||||
{
|
||||
@@ -282,7 +282,7 @@ void PrinterInfoManager::initialize()
|
||||
{
|
||||
INetURLObject aDir( printDir, INetProtocol::File, INetURLObject::EncodeMechanism::All );
|
||||
INetURLObject aFile( aDir );
|
||||
aFile.Append( PRINT_FILENAME );
|
||||
aFile.Append( u"" PRINT_FILENAME );
|
||||
|
||||
// check directory validity
|
||||
OUString aUniPath;
|
||||
|
||||
@@ -376,7 +376,7 @@ MSWorksCalcImportFilter::filter(const css::uno::Sequence<css::beans::PropertyVal
|
||||
INetURLObject aTmpUrl(sUrl);
|
||||
sWM3Name = aTmpUrl.getName(INetURLObject::LAST_SEGMENT, true,
|
||||
INetURLObject::DecodeMechanism::WithCharset);
|
||||
aTmpUrl.setExtension("FM3");
|
||||
aTmpUrl.setExtension(u"FM3");
|
||||
const OUString& sTestFM3Name
|
||||
= aTmpUrl.getName(INetURLObject::LAST_SEGMENT, true,
|
||||
INetURLObject::DecodeMechanism::WithCharset);
|
||||
|
||||
@@ -60,7 +60,7 @@ SecurityEnvironmentGpg::SecurityEnvironmentGpg()
|
||||
OUString sPath;
|
||||
osl_getExecutableFile(&sPath.pData);
|
||||
INetURLObject aPathUrl(sPath);
|
||||
aPathUrl.setName("gpgme-w32spawn.exe");
|
||||
aPathUrl.setName(u"gpgme-w32spawn.exe");
|
||||
if (!accessUrl(aPathUrl))
|
||||
{
|
||||
sPath = "$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER "/gpgme-w32spawn.exe";
|
||||
|
||||
Reference in New Issue
Block a user