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

coverity#704902 Dereference after null check

Change-Id: Ib0c590f452b0fd2df042a200015c935b46070fde
üst 349b218a
......@@ -919,17 +919,20 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
getRootFrm()->InvalidateBrowseWidth();
SwRect aNew( GetObjRectWithSpaces() );
SwRect aOld( maFrm );
if ( RES_UL_SPACE == nWhich )
{
const SvxULSpaceItem &rUL = *(SvxULSpaceItem*)pNew;
aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) );
aOld.SSize().Height()+= rUL.GetLower();
}
else
if (pNew)
{
const SvxLRSpaceItem &rLR = *(SvxLRSpaceItem*)pNew;
aOld.Left ( std::max( aOld.Left() - long(rLR.GetLeft()), 0L ) );
aOld.SSize().Width() += rLR.GetRight();
if ( RES_UL_SPACE == nWhich )
{
const SvxULSpaceItem &rUL = *(SvxULSpaceItem*)pNew;
aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) );
aOld.SSize().Height()+= rUL.GetLower();
}
else
{
const SvxLRSpaceItem &rLR = *(SvxLRSpaceItem*)pNew;
aOld.Left ( std::max( aOld.Left() - long(rLR.GetLeft()), 0L ) );
aOld.SSize().Width() += rLR.GetRight();
}
}
aNew.Union( aOld );
NotifyBackground( FindPageFrm(), aNew, PREP_CLEAR );
......
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