summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-29 12:20:23 +0100
committerStephan Bergmann <sbergman@redhat.com>2021-01-04 15:29:54 +0100
commitc34e8bd71384326184baac7dea31f7ddf9bae6bc (patch)
tree0914b24023030781b3a74a768be9df4d2873b4b9 /sdext
parenta1cdde17aa27902ee162d5b40860f05c592c4de8 (diff)
loplugin:stringviewparam: operator +=
Change-Id: I30ce1b5bd8fb168da7067c1967c5af2569df2653 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108512 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/presenter/PresenterHelpView.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx
index 18fcb3d3c21b..d6b625e53183 100644
--- a/sdext/source/presenter/PresenterHelpView.cxx
+++ b/sdext/source/presenter/PresenterHelpView.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/util/Color.hpp>
#include <algorithm>
#include <numeric>
+#include <string_view>
#include <vector>
using namespace ::com::sun::star;
@@ -50,7 +51,7 @@ namespace {
public:
LineDescriptor();
void AddPart (
- const OUString& rsLine,
+ std::u16string_view rsLine,
const css::uno::Reference<css::rendering::XCanvasFont>& rxFont);
bool IsEmpty() const;
@@ -503,7 +504,7 @@ LineDescriptor::LineDescriptor()
}
void LineDescriptor::AddPart (
- const OUString& rsLine,
+ std::u16string_view rsLine,
const css::uno::Reference<css::rendering::XCanvasFont>& rxFont)
{
msLine += rsLine;
@@ -689,7 +690,7 @@ void LineDescriptorList::FormatText (
nIndex = nLength;
}
- aLineDescriptor.AddPart(iPart->copy(nStart, nIndex-nStart), rxFont);
+ aLineDescriptor.AddPart(iPart->subView(nStart, nIndex-nStart), rxFont);
if (nIndex != nLength)
{
mpLineDescriptors->push_back(aLineDescriptor);
@@ -706,14 +707,14 @@ void LineDescriptorList::FormatText (
else if (PresenterCanvasHelper::GetTextSize(
rxFont, aLineDescriptor.msLine+", "+*iPart).Width > nMaximalWidth)
{
- aLineDescriptor.AddPart(",", rxFont);
+ aLineDescriptor.AddPart(u",", rxFont);
mpLineDescriptors->push_back(aLineDescriptor);
aLineDescriptor = LineDescriptor();
continue;
}
else
{
- aLineDescriptor.AddPart(", "+*iPart, rxFont);
+ aLineDescriptor.AddPart(OUString(", "+*iPart), rxFont);
}
++iPart;
}