https://bugs.documentfoundation.org/show_bug.cgi?id=164712

--- Comment #21 from Armin Le Grand (allotropia) <[email protected]> ---
Made some progress, 1st stripped the basic script to directly create the
problem without having to answer three more dialogs, that also makes debugging
easier. I added
    if (rPropertyName == OUString("CharBackColor"))
to be able to break there. The 2nd call is the problematic.
SW merges all attributes for the text segments in SwTextNode::GetParaAttr in a
complicated way. All seems to happen the same, but at the end when the result
is applied to aFormatSet using
            aFormatSet.Differentiate( rSet );
whereby in rSet [21] is set correctly to invalid, it is set to
- nullptr in the old version (Item deleted from set)
- stays at the existing item in the new version.

That means the error is in SfxItemSet::Differentiate which I indeed had to
adapt when doing the item changes. The old version was hard to understand, see
my comments in new version:

    // CAUTION: In the former impl, the
    // - version for different ranges checked for SfxItemState::SET
    //   in rSet
    // - version for same ranges checked for
    //   nullptr != local && nullptr != rSet.
    // All together I think also using the text
    // "Delete all Items contained in rSet" leads to
    // locally delete all Items that *are *not* set in rSet
    // -> ==SfxItemState::SET

And here we seem to have a case that needs to act differently for
SfxItemState::DISABLED. Have to check tomorrow.

NOTE: SfxItemSet::Intersect is *very* similar to SfxItemSet::Differentiate, so
that one might be affected, too.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to