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

coverity#1190356 Dereference null return value

Change-Id: I9a857423cd190b2da9f535e8897a9c9baba40b73
üst cfb2d0fe
...@@ -814,11 +814,21 @@ void SvxNumRule::SetLevel( sal_uInt16 i, const SvxNumberFormat& rNumFmt, bool bI ...@@ -814,11 +814,21 @@ void SvxNumRule::SetLevel( sal_uInt16 i, const SvxNumberFormat& rNumFmt, bool bI
{ {
DBG_ASSERT(i < SVX_MAX_NUM, "Wrong Level" ); 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 ]; bool bReplace = !aFmtsSet[i];
aFmts[ i ] = new SvxNumberFormat( rNumFmt ); if (!bReplace)
aFmtsSet[i] = bIsValid; {
const SvxNumberFormat *pFmt = Get(i);
bReplace = pFmt ? rNumFmt != *pFmt : true;
}
if (bReplace)
{
delete aFmts[i];
aFmts[i] = new SvxNumberFormat(rNumFmt);
aFmtsSet[i] = bIsValid;
}
} }
} }
......
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