summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode/ndtxt.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-09 15:59:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-09 16:59:49 +0100
commita6baaa652a591c6aa5b2f86ce1908191c5be2c50 (patch)
treeec8535db06678161bc89feec16a732a1914d248e /sw/source/core/txtnode/ndtxt.cxx
parent125f9bb308059696af5452c34eea1e8ee6af638c (diff)
CID#736200 out of bounds
Change-Id: I8ef64d3eac9430fba5b5eef55b8391f351225f2e
Diffstat (limited to 'sw/source/core/txtnode/ndtxt.cxx')
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 7c53f655b18f..b273f06d2cb9 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2873,7 +2873,15 @@ void SwTxtNode::ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpac
const SwNumRule* pRule = GetNumRule();
if ( pRule && GetActualListLevel() >= 0 )
{
- const SwNumFmt& rFmt = pRule->Get(static_cast<sal_uInt16>(GetActualListLevel()));
+ int nLevel = GetActualListLevel();
+
+ if (nLevel < 0)
+ nLevel = 0;
+
+ if (nLevel >= MAXLEVEL)
+ nLevel = MAXLEVEL - 1;
+
+ const SwNumFmt& rFmt = pRule->Get(static_cast<sal_uInt16>(nLevel));
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
SvxLRSpaceItem aLR( RES_LR_SPACE );