diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-13 08:47:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-14 08:26:14 +0200 |
commit | 9b5dad13b56bdde7c40970351af3da3a2c3c9350 (patch) | |
tree | abfd4b02743a0e6a93c51c026f4c53f0e21100bc /sfx2/source/view | |
parent | fa71320329999c968feb16ff65be328b5b8ff5e4 (diff) |
loplugin:stringadd look for unnecessary temporaries
which defeat the *StringConcat optimisation.
Also make StringConcat conversions treat a nullptr as an empty string,
to match the O*String(char*) constructors.
Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b
Reviewed-on: https://gerrit.libreoffice.org/80724
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/view')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 4224c54a3df7..5d72a583d67b 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -161,7 +161,7 @@ static OString lcl_escapeQuotes(const OString &rStr) void SfxLokHelper::notifyOtherView(SfxViewShell* pThisView, SfxViewShell const* pOtherView, int nType, const OString& rKey, const OString& rPayload) { - OString aPayload = OString("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView(pThisView)) + + OString aPayload = OStringLiteral("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView(pThisView)) + "\", \"part\": \"" + OString::number(pThisView->getPart()) + "\", \"" + rKey + "\": \"" + lcl_escapeQuotes(rPayload) + "\" }"; @@ -236,7 +236,7 @@ void SfxLokHelper::notifyDocumentSizeChanged(SfxViewShell const* pThisView, cons for (int i = 0; i < pDoc->getParts(); ++i) { tools::Rectangle aRectangle(0, 0, 1000000000, 1000000000); - OString sPayload = aRectangle.toString() + OString(", ") + OString::number(i); + OString sPayload = aRectangle.toString() + ", " + OString::number(i); pThisView->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_TILES, sPayload.getStr()); } } @@ -261,7 +261,7 @@ void SfxLokHelper::notifyVisCursorInvalidation(OutlinerViewShell const* pThisVie OString sPayload; if (comphelper::LibreOfficeKit::isViewIdForVisCursorInvalidation()) { - sPayload = OString("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView()) + + sPayload = OStringLiteral("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView()) + "\", \"rectangle\": \"" + rRectangle + "\" }"; } else |