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

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
üst fecffa63
...@@ -2782,10 +2782,9 @@ bool SwpHints::MergePortions( SwTextNode& rNode ) ...@@ -2782,10 +2782,9 @@ bool SwpHints::MergePortions( SwTextNode& rNode )
pItem1 = iter1.NextItem(), pItem1 = iter1.NextItem(),
pItem2 = iter2.NextItem()) pItem2 = iter2.NextItem())
{ {
if (pItem1 != pItem2 || if (pItem1 != pItem2) // all are poolable
pItem1->Which() != pItem2->Which() ||
*pItem1 != *pItem2)
{ {
assert(IsInvalidItem(pItem1) || IsInvalidItem(pItem2) || pItem1->Which() != pItem2->Which() || *pItem1 != *pItem2);
eMerge = DIFFER; eMerge = DIFFER;
break; break;
} }
......
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