summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/text/txtfrm.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index ec89c9fc7735..3ee2bc80a7ed 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -2184,8 +2184,16 @@ void SwTxtFrm::CalcAdditionalFirstLineOffset()
if ( pTxtNode && pTxtNode->IsNumbered() && pTxtNode->IsCountedInList() &&
pTxtNode->GetNumRule() )
{
+ int nListLevel = pTxtNode->GetActualListLevel();
+
+ if (nListLevel < 0)
+ nListLevel = 0;
+
+ if (nListLevel >= MAXLEVEL)
+ nListLevel = MAXLEVEL - 1;
+
const SwNumFmt& rNumFmt =
- pTxtNode->GetNumRule()->Get( static_cast<sal_uInt16>(pTxtNode->GetActualListLevel()) );
+ pTxtNode->GetNumRule()->Get( static_cast<sal_uInt16>(nListLevel) );
if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
// keep current paragraph portion and apply dummy paragraph portion