summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/edit/acorrect.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index ce1004df364c..f0f88cc4243a 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -164,7 +164,7 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const
// text attributes with dummy characters must not be replaced!
bool bDoReplace = true;
sal_Int32 const nLen = rText.getLength();
- for ( sal_Int32 n = 0; n < nLen; ++n )
+ for ( sal_Int32 n = 0; n < nLen && n + nPos < pNd->GetText().getLength(); ++n )
{
sal_Unicode const Char = pNd->GetText()[n + nPos];
if ( ( CH_TXTATR_BREAKWORD == Char || CH_TXTATR_INWORD == Char )