summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-12-12 22:47:15 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-12-13 09:25:40 +0100
commit0c8a30ba47c6ed64c45063a060356e61e82a789f (patch)
tree2952579f00a9c4c242aea38a6cb6ed61e4e0d568
parent93dd23d38b5de1d49227f31e1c24c591e509ebab (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 (cherry picked from commit 1e70464c380ecc0756ea29098632c503a60aec71) Reviewed-on: https://gerrit.libreoffice.org/46358 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 37a3b2bd44ae..118f551cbf4c 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2623,8 +2623,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 )
@@ -2635,8 +2636,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 )