diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-16 09:45:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-16 11:59:50 +0100 |
commit | 9ad3316530c1bf55b6864013d7e4fb539eaef296 (patch) | |
tree | 9e636c19c5dfa746a6f1d9e4b48605cb684b8958 /sw | |
parent | 8df4f86d27df14d22eec4894aba86e551ea9c4a1 (diff) |
CID#736195 out of bounds
Change-Id: I9a644a52146eb33248762c65c71fbd9a187490b7
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/txtfrm.cxx | 10 |
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 |