diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-01-16 21:07:44 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-01-16 23:15:50 +0100 |
commit | 94cf7e6de57cb413db39f719b4a5108708897a5c (patch) | |
tree | 33b0c6f558582a258a79b9604550437a2dba21f8 /vcl/source/control | |
parent | aef7612b0c75f4cec32aa2f5ec4bc1e382554429 (diff) |
vcl: Edit::ImplGetCharPos() no calling iterateCodePoints on empty string
(regression from 018beb38848fbd93889f29969f7ca5c68d0ac546)
Change-Id: I4783d3de09eddbd00f5f91574fae1afde38f2bc6
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/edit.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index a2f700c125ef..ade6d7b48b21 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1240,7 +1240,10 @@ sal_Int32 Edit::ImplGetCharPos( const Point& rWindowPos ) const sal_Int32 nFinalIndex = 0; long nDiff = std::abs( pDX[0]-nX ); sal_Int32 i = 0; - aText.iterateCodePoints(&i); //skip the first character + if (!aText.isEmpty()) + { + aText.iterateCodePoints(&i); //skip the first character + } while (i < aText.getLength()) { long nNewDiff = std::abs( pDX[2*i]-nX ); |