Kaydet (Commit) 1e70464c authored tarafından Michael Stahl's avatar Michael Stahl

tdf#114396 sw: overly strict assertions in SwFrameFormat::Modify()

It's only a problem if the style contains an anchor position;
the anchor type by itself is fine, and the wrong assertion is
particularly stupid considering that
DocumentStylePoolManager::GetFormatFromPool() inits various
built-in styles with anchor types.

(regression from eed04643)

Change-Id: If8ac000b7f888686725d6bf0ef8e5fb38198c889
üst 6315b8cb
......@@ -2615,8 +2615,9 @@ void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
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();
assert(newAnchorPosition == nullptr || // style's set must not contain position!
static_cast<SwAttrSetChg const*>(pNew)->GetTheChgdSet() == &m_aSet);
}
}
if( pNew && pNew->Which() == RES_ANCHOR )
......@@ -2627,8 +2628,9 @@ void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
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();
assert(oldAnchorPosition == nullptr || // style's set must not contain position!
static_cast<SwAttrSetChg const*>(pOld)->GetTheChgdSet() == &m_aSet);
}
}
if( pOld && pOld->Which() == RES_ANCHOR )
......
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