summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-16 09:39:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-16 11:59:50 +0100
commit557de68e965a5d1b0fb56270d5c5f46ebb9cd0fc (patch)
tree936c34d52f878de6d19177fe262c88664c1ed02c /sw
parent5d6fc7d3fb9652185b2528188d4d8f56c1a4aa9e (diff)
CID#982805 out of bounds
Change-Id: I58b6a1738c2039e863f1446cbfa17d1138523694
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/itrcrsr.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 1e9818928222..fa3fa081807e 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -143,8 +143,16 @@ namespace {
if ( rTxtNode.AreListLevelIndentsApplicable() )
{
+ int nListLevel = rTxtNode.GetActualListLevel();
+
+ if (nListLevel < 0)
+ nListLevel = 0;
+
+ if (nListLevel >= MAXLEVEL)
+ nListLevel = MAXLEVEL - 1;
+
const SwNumFmt& rNumFmt =
- rTxtNode.GetNumRule()->Get( static_cast<sal_uInt16>(rTxtNode.GetActualListLevel()) );
+ rTxtNode.GetNumRule()->Get( static_cast<sal_uInt16>(nListLevel) );
if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
bRet = true;