summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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() )