summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/edit/autofmt.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 5c3e22aaed4a..5e806d73ea38 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -2184,7 +2184,7 @@ void SwAutoFormat::AutoCorrect(TextFrameIndex nPos)
continue; // do not check further
}
- if ( m_aFlags.bAddNonBrkSpace )
+ if ( m_aFlags.bAddNonBrkSpace && nPos < TextFrameIndex(pText->getLength()) )
{
SetRedlineText( STR_AUTOFMTREDL_NON_BREAK_SPACE );
pATst->FnAddNonBrkSpace(aACorrDoc, *pText, sal_Int32(nPos), eLang, bNbspRunNext);