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

coverity#1426169 refactor to be less obscure

and coverity#1426166

no logic changes intended

Change-Id: I241f3f09c6a4ab143b67eb9341e8a52acbae64e3
a026f03980fdf1c80d1c6cffbd8ad0325c8f5d02
Reviewed-on: https://gerrit.libreoffice.org/46619Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 2f9360b5
......@@ -77,20 +77,23 @@ SwFlyAtContentFrame::SwFlyAtContentFrame( SwFlyFrameFormat *pFormat, SwFrame* pS
void SwFlyAtContentFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
const sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
const SwFormatAnchor *pAnch = nullptr;
if( RES_ATTRSET_CHG == nWhich && SfxItemState::SET ==
static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_ANCHOR, false,
reinterpret_cast<const SfxPoolItem**>(&pAnch) ))
; // The anchor pointer is set at GetItemState!
else if( RES_ANCHOR == nWhich )
if (pNew)
{
//Change anchor, I move myself to a new place.
//The anchor type must not change, this is only possible using
//SwFEShell.
pAnch = static_cast<const SwFormatAnchor*>(pNew);
const sal_uInt16 nWhich = pNew->Which();
if( RES_ATTRSET_CHG == nWhich && SfxItemState::SET ==
static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_ANCHOR, false,
reinterpret_cast<const SfxPoolItem**>(&pAnch) ))
; // The anchor pointer is set at GetItemState!
else if( RES_ANCHOR == nWhich )
{
//Change anchor, I move myself to a new place.
//The anchor type must not change, this is only possible using
//SwFEShell.
pAnch = static_cast<const SwFormatAnchor*>(pNew);
}
}
if( pAnch )
......
......@@ -713,20 +713,23 @@ SwFlyLayFrame::SwFlyLayFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame
void SwFlyLayFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
const sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
const SwFormatAnchor *pAnch = nullptr;
if( RES_ATTRSET_CHG == nWhich && SfxItemState::SET ==
static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_ANCHOR, false,
reinterpret_cast<const SfxPoolItem**>(&pAnch) ))
; // GetItemState sets the anchor pointer!
else if( RES_ANCHOR == nWhich )
if (pNew)
{
// Change of anchor. I'm attaching myself to the new place.
// It's not allowed to change the anchor type. This is only
// possible via SwFEShell.
pAnch = static_cast<const SwFormatAnchor*>(pNew);
const sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
if( RES_ATTRSET_CHG == nWhich && SfxItemState::SET ==
static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_ANCHOR, false,
reinterpret_cast<const SfxPoolItem**>(&pAnch) ))
; // GetItemState sets the anchor pointer!
else if( RES_ANCHOR == nWhich )
{
// Change of anchor. I'm attaching myself to the new place.
// It's not allowed to change the anchor type. This is only
// possible via SwFEShell.
pAnch = static_cast<const SwFormatAnchor*>(pNew);
}
}
if( pAnch )
......
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