summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-09-26 17:00:25 +0200
committerMichael Stahl <mstahl@redhat.com>2017-09-26 17:27:16 +0200
commiteed046433a847d3005e52c38963fb883322a39e6 (patch)
treeb466e74f97a9fb0bed46ff1add973bba33850e95
parent17fe1e19e01f8b23bcd23cc7c1789e8f7064d06e (diff)
tdf#112574 sw: assert if a frame style contains a RES_ANCHOR
... in SwFrameFormat::Modify(). Change-Id: I3b7ea1493277d8d705bdf77c50fdff49872bac05
-rw-r--r--sw/source/core/layout/atrfrm.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 9dfe0f870a2f..1c806bb9527b 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2614,7 +2614,10 @@ void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
const SfxPoolItem* tmp = nullptr;
static_cast< const SwAttrSetChg* >(pNew)->GetChgSet()->GetItemState( RES_ANCHOR, false, &tmp );
if( tmp )
+ {
+ assert(static_cast<SwAttrSetChg const*>(pNew)->GetTheChgdSet() == &m_aSet); // must not be style's set!
newAnchorPosition = static_cast< const SwFormatAnchor* >( tmp )->GetContentAnchor();
+ }
}
if( pNew && pNew->Which() == RES_ANCHOR )
newAnchorPosition = static_cast< const SwFormatAnchor* >( pNew )->GetContentAnchor();
@@ -2623,7 +2626,10 @@ void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
const SfxPoolItem* tmp = nullptr;
static_cast< const SwAttrSetChg* >(pOld)->GetChgSet()->GetItemState( RES_ANCHOR, false, &tmp );
if( tmp )
+ {
+ assert(static_cast<SwAttrSetChg const*>(pOld)->GetTheChgdSet() == &m_aSet); // must not be style's set!
oldAnchorPosition = static_cast< const SwFormatAnchor* >( tmp )->GetContentAnchor();
+ }
}
if( pOld && pOld->Which() == RES_ANCHOR )
oldAnchorPosition = static_cast< const SwFormatAnchor* >( pOld )->GetContentAnchor();