Kaydet (Commit) 71e71d4b authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1202830 Out-of-bounds access

Change-Id: I25edea176b69c1c1f87bdbff790a39298a813660
üst 63582369
......@@ -798,12 +798,25 @@ void SwEditShell::SetNumberingRestart()
SwTxtNode* pTxtNd( static_cast<SwTxtNode*>(pNd) );
SwNumRule* pNumRule( pTxtNd->GetNumRule() );
if ( pNumRule && pTxtNd->GetNum() &&
bool bIsNodeNum =
( pNumRule && pTxtNd->GetNum() &&
( pTxtNd->HasNumber() || pTxtNd->HasBullet() ) &&
pTxtNd->IsCountedInList() &&
!pTxtNd->IsListRestart() &&
pTxtNd->GetNum()->GetNumber() ==
pNumRule->Get( static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()) ).GetStart() )
!pTxtNd->IsListRestart() );
if (bIsNodeNum)
{
int nListLevel = pTxtNd->GetActualListLevel();
if (nListLevel < 0)
nListLevel = 0;
if (nListLevel >= MAXLEVEL)
nListLevel = MAXLEVEL - 1;
bIsNodeNum = pTxtNd->GetNum()->GetNumber() ==
pNumRule->Get( static_cast<sal_uInt16>(nListLevel) ).GetStart();
}
if (bIsNodeNum)
{
// now set a the start value as attribute
SwPosition aCurrentNode(*pNd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment