diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-01 21:14:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-02 09:48:51 +0100 |
commit | 75a5034da9a9f628c90ca17f873361cf4ee03380 (patch) | |
tree | 57dd5beb75411bb59f6e3bd9afe0b28f5a7c5f6f /vcl/source | |
parent | f927fc06b8160c6db134b29dab510e2cd567e3f3 (diff) |
forcepoint #14 check to see if we incremented at all
Change-Id: Ia4670adbddcc8501cf522be296b3061a3529f880
Reviewed-on: https://gerrit.libreoffice.org/50605
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/helper/strhelper.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx index 648c579ac4c2..4d0f1d993cd6 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); } |