diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-10-19 14:01:33 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-10-19 14:27:52 +0200 |
commit | c79da868c0b02b1b1333c3b805899bb4ce867f6a (patch) | |
tree | d78e8ed62b7814bb39bcfacde3b4db8a33b67d26 /sw | |
parent | fecffa63ef07a80d5094abcc2ffce5d8f73e54f5 (diff) |
sw: fix odd condition in SwpHints::MergePortions()
All of the RES_CHRATR_* items are poolable, hence we have
(pItem1 != pItem2) == (pItem1->Which() != pItem2->Which() || *pItem1 != *pItem2)
Move the redundant check to an assert() so we notice in case
somebody adds a new non-poolable RES_CHRATR.
Thanks to ccsheller for pointing me to this condition.
Change-Id: I9e0634946b8bede3f483bb8997f69de05beae64c
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/thints.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 71fbe12ba888..3d33f5bf1f5a 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -2782,10 +2782,9 @@ bool SwpHints::MergePortions( SwTextNode& rNode ) pItem1 = iter1.NextItem(), pItem2 = iter2.NextItem()) { - if (pItem1 != pItem2 || - pItem1->Which() != pItem2->Which() || - *pItem1 != *pItem2) + if (pItem1 != pItem2) // all are poolable { + assert(IsInvalidItem(pItem1) || IsInvalidItem(pItem2) || pItem1->Which() != pItem2->Which() || *pItem1 != *pItem2); eMerge = DIFFER; break; } |