coverity#1190356 Dereference null return value
Change-Id: I9a857423cd190b2da9f535e8897a9c9baba40b73
This commit is contained in:
@@ -814,12 +814,22 @@ 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)
|
||||||
|
{
|
||||||
|
const SvxNumberFormat *pFmt = Get(i);
|
||||||
|
bReplace = pFmt ? rNumFmt != *pFmt : true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bReplace)
|
||||||
|
{
|
||||||
|
delete aFmts[i];
|
||||||
|
aFmts[i] = new SvxNumberFormat(rNumFmt);
|
||||||
aFmtsSet[i] = bIsValid;
|
aFmtsSet[i] = bIsValid;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SvxNumRule::SetLevel(sal_uInt16 nLevel, const SvxNumberFormat* pFmt)
|
void SvxNumRule::SetLevel(sal_uInt16 nLevel, const SvxNumberFormat* pFmt)
|
||||||
|
Reference in New Issue
Block a user