summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-10-06 15:27:37 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-10-06 15:28:27 +0100
commit946ea643185af680508a0333f63c086ed3f454a3 (patch)
treea2a6e918d2ef22b3ff911b7bceacd2284e39e627
parentde78b2ca3c24a822ad9b8456323b9d2210ae0487 (diff)
Resolves: fdo#84649 can have negative values from ConvertToModelPosition
Change-Id: I570ee54e15a4cd4b11da26004164d9e6a1d8cdb9
-rw-r--r--sw/source/core/bastyp/breakit.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx
index 0e3aeea60f62..f3b229c66c02 100644
--- a/sw/source/core/bastyp/breakit.cxx
+++ b/sw/source/core/bastyp/breakit.cxx
@@ -103,6 +103,9 @@ sal_uInt16 SwBreakIt::GetRealScriptOfText( const OUString& rTxt, sal_Int32 nPos
{
if( nPos && nPos == rTxt.getLength() )
--nPos;
+ else if( nPos < 0)
+ nPos = 0;
+
nScript = xBreak->getScriptType( rTxt, nPos );
sal_Int32 nChgPos = 0;
if ( i18n::ScriptType::WEAK == nScript && nPos + 1 < rTxt.getLength() )