summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-04-27 18:08:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-28 15:41:02 +0200
commit39c3574b799690d4405d9318a5ba221b5feaccbe (patch)
tree40cacd124e11dd71b23affec3713c6f0fef27906 /sc
parent9658115370bf33c2fdb68a3b759cf2f9d9e7c6c1 (diff)
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>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/dataproviders_test.cxx8
-rw-r--r--sc/qa/unit/filters-test.cxx2
-rw-r--r--sc/qa/unit/helper/qahelper.cxx4
-rw-r--r--sc/qa/unit/helper/qahelper.hxx2
-rw-r--r--sc/source/filter/lotus/lotus.cxx2
-rw-r--r--sc/source/ui/docshell/docsh.cxx4
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx4
7 files changed, 13 insertions, 13 deletions
diff --git a/sc/qa/unit/dataproviders_test.cxx b/sc/qa/unit/dataproviders_test.cxx
index 9dfda0efaa6c..2692671837dc 100644
--- a/sc/qa/unit/dataproviders_test.cxx
+++ b/sc/qa/unit/dataproviders_test.cxx
@@ -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);
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 0595f0be8841..1a888725154c 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -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);
}
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 4091a75ef6dd..3774f6b5a27c 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -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);
}
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index 14b7b3b02aca..3533cf82cfa0 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -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);
diff --git a/sc/source/filter/lotus/lotus.cxx b/sc/source/filter/lotus/lotus.cxx
index 7d7dc17f88a3..2ddc7a5d28f9 100644
--- a/sc/source/filter/lotus/lotus.cxx
+++ b/sc/source/filter/lotus/lotus.cxx
@@ -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 )
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index ec6b1a3b35e5..055f2fdf727a 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -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
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 176e65836b25..f7e3822b77d7 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -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);
}