From 9ad3316530c1bf55b6864013d7e4fb539eaef296 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 16 Oct 2013 09:45:18 +0100 Subject: CID#736195 out of bounds Change-Id: I9a644a52146eb33248762c65c71fbd9a187490b7 --- sw/source/core/text/txtfrm.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sw') 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(pTxtNode->GetActualListLevel()) ); + pTxtNode->GetNumRule()->Get( static_cast(nListLevel) ); if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) { // keep current paragraph portion and apply dummy paragraph portion -- cgit