To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=108345





------- Additional comments from m...@openoffice.org Sat Apr  3 16:23:37 +0000 
2010 -------
@ dtardon:

unfortunately i also forgot something, which just occurred to me:
i had implicitly assumed that RES_TXTATR_AUTOFMT hints would be merged when
they are inserted; well, they are merged, but not in the way i thought.
SwpHints::MergePortions() merges adjacent hints that have the same items;
it does not merge hints at the same position with different items.
SwpHints::BuildPortions() merges hints at the same position
(the items in the new hint overwrite existing ones).
but FmtToTxtAttr does not call BuildPortions, it inserts its hints directly
into the array!
that is a very bad idea:
in fact, it is an error if there are 2 RES_TXTATR_AUTOFMT hints covering the
same position, leading exactly to the behavior described in this issue:
the text formatter and the UNO API (used for ODF export) have differing
opinions about what attributes are in the text.

so, FmtToTxtAttr should not just simply insert a single hint that spans the
paragraph.  because the existing CHARFMT/AUTOFMT hints override the paragraph
attributes, it should instead insert, at each range covered by an existing
CHARFMT/AUTOFMT hint, an AUTOFMT with the specific items from the paragraph
that are not overridden by the existing CHARFMT/AUTOFMT hint.

but unfortunately BuildPortions does it the other way around:
if we call BuildPortions (of course indirectly via TryInsertHint)
with an AUTOFMT with all the paragraph attributes, they would override
the existing hints!

hmmm... this starts to look a lot more difficult now.
so either there should be a new function with loops over the hints array
to insert the specific AUTOFMT portions, or there should be a new mode flag
for BuildPortions to tell it to do its merging and overriding differently.
the latter is obviously challenging because BuildPortions is already
a 400-line monstrosity.


---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@sw.openoffice.org
For additional commands, e-mail: issues-h...@sw.openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org
For additional commands, e-mail: allbugs-h...@openoffice.org

Reply via email to