[Libreoffice-commits] core.git: desktop/source libreofficekit/source
Noel Grandin
noel.grandin at collabora.co.uk
Mon Oct 24 09:07:49 UTC 2016
desktop/source/lib/init.cxx | 2 +-
libreofficekit/source/gtk/lokdocview.cxx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 610f59651563205564a0f4818b5c1d347ca02132
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Oct 24 10:56:08 2016 +0200
fix "cppcheck:stlIfStrFind"
in commit 5c1bb338ef0d781648d5b33ffc9d64c2be6d9926, compare does not do
a startswith
Change-Id: If518b3f6880848a5b5463c09fb73974d972010fd
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8ce8443..29a9bfe 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -356,7 +356,7 @@ struct RectangleAndPart
static RectangleAndPart Create(const std::string& rPayload)
{
RectangleAndPart aRet;
- if (rPayload.compare("EMPTY") == 0) // payload starts with "EMPTY"
+ if (rPayload.rfind("EMPTY") == 0) // payload starts with "EMPTY"
{
if (comphelper::LibreOfficeKit::isPartInInvalidation())
aRet.m_nPart = std::stol(rPayload.substr(6));
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index fd67264..8f23995 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1136,7 +1136,7 @@ callback (gpointer pData)
{
case LOK_CALLBACK_INVALIDATE_TILES:
{
- if (pCallback->m_aPayload.compare("EMPTY") != 0) // payload doesn't start with "EMPTY"
+ if (pCallback->m_aPayload.rfind("EMPTY") != 0) // payload doesn't start with "EMPTY"
{
GdkRectangle aRectangle = payloadToRectangle(pDocView, pCallback->m_aPayload.c_str());
setTilesInvalid(pDocView, aRectangle);
More information about the Libreoffice-commits
mailing list