summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-12-12 22:47:15 +0100
committerMichael Stahl <mstahl@redhat.com>2017-12-12 22:54:07 +0100
commit1e70464c380ecc0756ea29098632c503a60aec71 (patch)
tree3a6f9d749d4f07aaaaa804cecf33452838f7bdfc
parent6315b8cbbd7b7e67d824e1dba4414bdf61e3e061 (diff)
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 eed046433a847d3005e52c38963fb883322a39e6) Change-Id: If8ac000b7f888686725d6bf0ef8e5fb38198c889
-rw-r--r--sw/source/core/layout/atrfrm.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 207cb77d1954..2b15de1ffcd3 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -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 )