[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - vcl/source
Caolán McNamara
caolanm at redhat.com
Fri Mar 2 08:54:48 UTC 2018
vcl/source/helper/strhelper.cxx | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 31deb001ab1d06832caf9439c6b1c061fc20e3d9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 1 21:14:15 2018 +0000
forcepoint #14 check to see if we incremented at all
Change-Id: Ia4670adbddcc8501cf522be296b3061a3529f880
Reviewed-on: https://gerrit.libreoffice.org/50607
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index 545f30c491d7..4a5446aabf60 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -300,9 +300,12 @@ OUString WhitespaceToSpace( const OUString& rLine, bool bProtect )
*pLeap = 0;
// there might be a space at beginning or end
- pLeap--;
- if( *pLeap == ' ' )
- *pLeap = 0;
+ if (pLeap > pBuffer)
+ {
+ pLeap--;
+ if( *pLeap == ' ' )
+ *pLeap = 0;
+ }
return OUString(*pBuffer == ' ' ? pBuffer+1 : pBuffer);
}
More information about the Libreoffice-commits
mailing list