summaryrefslogtreecommitdiff
path: root/svx
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 /svx
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 'svx')
-rw-r--r--svx/qa/unit/gallery/test_gallery.cxx8
-rw-r--r--svx/source/gallery2/gallery1.cxx6
-rw-r--r--svx/source/gallery2/gallerybinaryengine.cxx4
-rw-r--r--svx/source/gallery2/gallerybinaryengineentry.cxx6
-rw-r--r--svx/source/gallery2/gallerybinarystoragelocations.cxx8
-rw-r--r--svx/source/sidebar/nbdtmg.cxx12
6 files changed, 22 insertions, 22 deletions
diff --git a/svx/qa/unit/gallery/test_gallery.cxx b/svx/qa/unit/gallery/test_gallery.cxx
index 072361232dc7..da224b439f3b 100644
--- a/svx/qa/unit/gallery/test_gallery.cxx
+++ b/svx/qa/unit/gallery/test_gallery.cxx
@@ -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),
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 6b5ab0acfdf5..b6b5b00d9a0f 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -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
{
diff --git a/svx/source/gallery2/gallerybinaryengine.cxx b/svx/source/gallery2/gallerybinaryengine.cxx
index 16334e719623..c093d899d756 100644
--- a/svx/source/gallery2/gallerybinaryengine.cxx
+++ b/svx/source/gallery2/gallerybinaryengine.cxx
@@ -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))
diff --git a/svx/source/gallery2/gallerybinaryengineentry.cxx b/svx/source/gallery2/gallerybinaryengineentry.cxx
index e50e8e605d08..86989271231f 100644
--- a/svx/source/gallery2/gallerybinaryengineentry.cxx
+++ b/svx/source/gallery2/gallerybinaryengineentry.cxx
@@ -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)));
}
}
diff --git a/svx/source/gallery2/gallerybinarystoragelocations.cxx b/svx/source/gallery2/gallerybinarystoragelocations.cxx
index e8aaf88b1fee..dc896f6c3811 100644
--- a/svx/source/gallery2/gallerybinarystoragelocations.cxx
+++ b/svx/source/gallery2/gallerybinarystoragelocations.cxx
@@ -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);
}
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index f786738902e0..06a7ea4d207f 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -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)