coverity#1190356 Dereference null return value

Change-Id: I9a857423cd190b2da9f535e8897a9c9baba40b73
This commit is contained in:
Caolán McNamara
2014-03-06 13:47:17 +00:00
parent cfb2d0fe2f
commit ca789f8ea4

View File

@@ -814,11 +814,21 @@ void SvxNumRule::SetLevel( sal_uInt16 i, const SvxNumberFormat& rNumFmt, bool bI
{
DBG_ASSERT(i < SVX_MAX_NUM, "Wrong Level" );
if( (i < SVX_MAX_NUM) && (!aFmtsSet[i] || !(rNumFmt == *Get( i ))) )
if( (i < SVX_MAX_NUM) )
{
delete aFmts[ i ];
aFmts[ i ] = new SvxNumberFormat( rNumFmt );
aFmtsSet[i] = bIsValid;
bool bReplace = !aFmtsSet[i];
if (!bReplace)
{
const SvxNumberFormat *pFmt = Get(i);
bReplace = pFmt ? rNumFmt != *pFmt : true;
}
if (bReplace)
{
delete aFmts[i];
aFmts[i] = new SvxNumberFormat(rNumFmt);
aFmtsSet[i] = bIsValid;
}
}
}