summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/flycnt.cxx25
-rw-r--r--sw/source/core/layout/flylay.cxx25
2 files changed, 28 insertions, 22 deletions
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 20c891af939a..7924e788b621 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -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 )
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 8a3af6c27006..92342f5928f6 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -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 )