summaryrefslogtreecommitdiff
path: root/basctl/source/basicide
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-07-07 13:05:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-07-07 15:21:33 +0200
commitadf419792743a4c79b2054e42618dff75bb552ce (patch)
tree18869048ab4255831c5846709ebd522e0bd64ca3 /basctl/source/basicide
parent23f80b26098bcf9a8ae870e8ded878cca6e0c541 (diff)
elide some string copies
Change-Id: I3e0d9f7e5a446689e007b9d01fb1c6bf9bc068e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136880 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl/source/basicide')
-rw-r--r--basctl/source/basicide/baside2b.cxx4
-rw-r--r--basctl/source/basicide/basobj3.cxx4
-rw-r--r--basctl/source/basicide/bastypes.cxx8
3 files changed, 5 insertions, 11 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index df8196570653..fbda4447191e 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -719,9 +719,9 @@ TextSelection EditorWindow::GetLastHighlightPortionTextSelection() const
if( aPortions.empty() )
return TextSelection();
- OUString sStr = aLine.copy( r.nBegin, r.nEnd - r.nBegin );
+ std::u16string_view sStr = aLine.subView( r.nBegin, r.nEnd - r.nBegin );
TextPaM aStart( nLine, r.nBegin );
- TextPaM aEnd( nLine, r.nBegin + sStr.getLength() );
+ TextPaM aEnd( nLine, r.nBegin + sStr.size() );
return TextSelection( aStart, aEnd );
}
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index 26de81e35cb9..a470461be6a7 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -105,9 +105,7 @@ SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName )
aOUSource = aOUSource.copy( 0, nSourceLen-1 );
}
- OUString aSubStr = "Sub " + aMacroName + "\n\nEnd Sub";
-
- aOUSource += aSubStr;
+ aOUSource += "Sub " + aMacroName + "\n\nEnd Sub";
// update module in library
StarBASIC* pBasic = dynamic_cast<StarBASIC*>(pModule->GetParent());
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 4ebe985804d9..8d26fc4cacc8 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -584,9 +584,7 @@ void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines )
else
nEndPos++;
- OUString aEndStr = rStr.copy( nEndPos );
- rStr = rStr.copy( 0, nStartPos );
- rStr += aEndStr;
+ rStr = OUString::Concat(rStr.subView( 0, nStartPos )) + rStr.subView( nEndPos );
// erase trailing empty lines
{
@@ -600,9 +598,7 @@ void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines )
if ( n > nStartPos )
{
- aEndStr = rStr.copy( n );
- rStr = rStr.copy( 0, nStartPos );
- rStr += aEndStr;
+ rStr = OUString::Concat(rStr.subView( 0, nStartPos )) + rStr.subView( n );
}
}
}