From 94cf7e6de57cb413db39f719b4a5108708897a5c Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 16 Jan 2017 21:07:44 +0100 Subject: vcl: Edit::ImplGetCharPos() no calling iterateCodePoints on empty string (regression from 018beb38848fbd93889f29969f7ca5c68d0ac546) Change-Id: I4783d3de09eddbd00f5f91574fae1afde38f2bc6 --- vcl/source/control/edit.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vcl') 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 ); -- cgit