summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-11-22 14:08:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-11-23 14:00:08 +0100
commitec1c4c49301758c54394f9943252e192ad54638b (patch)
treeb53af3cb9154a388495b1af35c3f8ff41d6ebe1f /sd
parentdb0f2c29bf3a6ad5a08f8524ea0e65aa90792bb2 (diff)
O[U]String::replaceAt overloads that take string_view
which results in lots of nice string_view improvements picked up by the plugins Change-Id: Ib0ec3887816b3d4436d003b739d9814f83e244b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/drawdoc2.cxx10
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx2
-rw-r--r--sd/source/ui/dlg/custsdlg.cxx2
-rw-r--r--sd/source/ui/docshell/docshel3.cxx8
4 files changed, 11 insertions, 11 deletions
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index 2f6fbfaccb47..c17910d686e3 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -286,7 +286,7 @@ void SdDrawDocument::UpdatePageRelativeURLs(const OUString& rOldName, std::u16st
{
if (aURL.getLength() == rOldName.getLength() + 1) // standard page name
{
- aURL = aURL.replaceAt(1, aURL.getLength() - 1, "") +
+ aURL = aURL.replaceAt(1, aURL.getLength() - 1, u"") +
rNewName;
pURLField->SetURL(aURL);
}
@@ -296,7 +296,7 @@ void SdDrawDocument::UpdatePageRelativeURLs(const OUString& rOldName, std::u16st
if (aURL.getLength() == rOldName.getLength() + 2 + sNotes.getLength()
&& aURL.indexOf(sNotes, rOldName.getLength() + 2) == rOldName.getLength() + 2)
{
- aURL = aURL.replaceAt(1, aURL.getLength() - 1, "") +
+ aURL = aURL.replaceAt(1, aURL.getLength() - 1, u"") +
rNewName + " " + sNotes;
pURLField->SetURL(aURL);
}
@@ -333,7 +333,7 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage const * pPage, sal_uInt16 nPo
OUString aURLCopy = aURL;
const OUString sNotes(SdResId(STR_NOTES));
- aURLCopy = aURLCopy.replaceAt(0, aHashSlide.getLength(), "");
+ aURLCopy = aURLCopy.replaceAt(0, aHashSlide.getLength(), u"");
bool bNotesLink = ( aURLCopy.getLength() >= sNotes.getLength() + 3
&& aURLCopy.endsWith(sNotes) );
@@ -342,7 +342,7 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage const * pPage, sal_uInt16 nPo
continue; // no compatible link and page
if (bNotes)
- aURLCopy = aURLCopy.replaceAt(aURLCopy.getLength() - sNotes.getLength(), sNotes.getLength(), "");
+ aURLCopy = aURLCopy.replaceAt(aURLCopy.getLength() - sNotes.getLength(), sNotes.getLength(), u"");
sal_Int32 number = aURLCopy.toInt32();
sal_uInt16 realPageNumber = (nPos + 1)/ 2;
@@ -351,7 +351,7 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage const * pPage, sal_uInt16 nPo
{
// update link page number
number += nIncrement;
- aURL = aURL.replaceAt(aHashSlide.getLength() + 1, aURL.getLength() - aHashSlide.getLength() - 1, "") +
+ aURL = aURL.replaceAt(aHashSlide.getLength() + 1, aURL.getLength() - aHashSlide.getLength() - 1, u"") +
OUString::number(number);
if (bNotes)
{
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index ec7a16e045e9..59f2e879b06f 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2266,7 +2266,7 @@ void PowerPointExport::embedEffectAudio(const FSHelperPtr& pFS, const OUString&
sRelId = addRelation(pFS->getOutputStream(),
oox::getRelationship(Relationship::AUDIO), sPath);
- uno::Reference<io::XOutputStream> xOutputStream = openFragmentStream(sPath.replaceAt(0, 2, "/ppt"),
+ uno::Reference<io::XOutputStream> xOutputStream = openFragmentStream(sPath.replaceAt(0, 2, u"/ppt"),
"audio/x-wav");
comphelper::OStorageHelper::CopyInputToOutput(xAudioStream, xOutputStream);
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index fc8e774d82e9..78274f3f4492 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -199,7 +199,7 @@ void SdCustomShowDlg::SelectHdl(void const *p)
const CharClass* pCharClass = rDoc.GetCharClass();
while( pCharClass->isDigit( aStr, nStrPos ) )
- aStr = aStr.replaceAt( nStrPos, 1, "" );
+ aStr = aStr.replaceAt( nStrPos, 1, u"" );
aStr = aStr.subView( 0, nStrPos) + OUString::number( ++nNum ) + aStr.subView( nStrPos);
}
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
index b3c142d06750..5ed24657d9f1 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -308,7 +308,7 @@ void DrawDocShell::Execute( SfxRequest& rReq )
sal_Int32 nPos = -1;
if (-1 != (nPos = aNewLangTxt.indexOf( aDocumentLangPrefix )))
{
- aNewLangTxt = aNewLangTxt.replaceAt( nPos, aDocumentLangPrefix.getLength(), "" );
+ aNewLangTxt = aNewLangTxt.replaceAt( nPos, aDocumentLangPrefix.getLength(), u"" );
if (aNewLangTxt == "LANGUAGE_NONE")
lcl_setLanguage( pDoc, u"", true );
@@ -320,12 +320,12 @@ void DrawDocShell::Execute( SfxRequest& rReq )
else if (-1 != (nPos = aNewLangTxt.indexOf( aSelectionLangPrefix )))
{
bSelection = true;
- aNewLangTxt = aNewLangTxt.replaceAt( nPos, aSelectionLangPrefix.getLength(), "" );
+ aNewLangTxt = aNewLangTxt.replaceAt( nPos, aSelectionLangPrefix.getLength(), u"" );
}
else if (-1 != (nPos = aNewLangTxt.indexOf( aParagraphLangPrefix )))
{
bParagraph = true;
- aNewLangTxt = aNewLangTxt.replaceAt( nPos, aParagraphLangPrefix.getLength(), "" );
+ aNewLangTxt = aNewLangTxt.replaceAt( nPos, aParagraphLangPrefix.getLength(), u"" );
}
if (bSelection || bParagraph)
@@ -410,7 +410,7 @@ void DrawDocShell::Execute( SfxRequest& rReq )
sal_Int32 nPos = 0;
if(-1 != (nPos = sApplyText.indexOf( sSpellingRule )))
{
- sApplyText = sApplyText.replaceAt(nPos, sSpellingRule.getLength(), "");
+ sApplyText = sApplyText.replaceAt(nPos, sSpellingRule.getLength(), u"");
rEditView.InsertText( sApplyText );
}
}