I am trying to correct a bug when the user changes paragraph style.
Presently, all font properties and character styles are removed from
the paragraph until the first footnote (or endnote), while after the
footnote, none of these things are cleared. There are a few issues:
1) the behavior needs to be same before and after the footnote
2) clearing character styles affects the font properties of footnote
references (i.e. they are no longer in superscript)
3) clearing font properties is a mix bag. If the user has a word in
italic or in bold, he likely does not want it to be affected by the
paragraph style change. However, abiword tends to explicitly set a
large number of properties that are defined in the paragraph style
(for example if the user sets the font to bold, type a word, and then
unsets it, a font property font-weight:normal will be added to every
text fragment afterward). These extraneous properties will likely
cause undesirable effects during the paragraph style change (that is,
keep a number of the old paragraph style properties).
I would like to implement the following algorithm:
1) clear all the font properties that were not necessary with the old
paragraph style
2) do not touch character style
3) and change the block strux style attribute to its new value.
The reason I am putting that on the mailing list is that I found the
following unresolved discussion in file pt_PT_ChangeStrux.cpp. Does
anybody object to my plan?
// when applying a block-level style, we also need to clear
// any props at the frag level, which might trigger coalescing,
// thus this version of the loop is more complex.
//
// OK for styles we expand out all defined properties including BasedOn styles
// Then we use these to eliminate any specfic properties in the current strux
// Then properties in the current strux will resolve to those defined in the
// style (they exist there) to specifc values in strux (if not overridden by
// the style) then finally to default value.
//
// TODO this is not right; first of all, paragraph style should be applied
// to the block Strux only and nothing else -- no Spans, Fmt marks, etc.
// Second, when applying paragraph style, we should clear the existing
// strux of all its properties inherited from any previous style
// not just the ones defined explicitely, by this style, because what
// is not defined is assumed to default, not to be inherited from a style
// we are trying to get rid off.
//
// NO. We want to remove all character level properties that clash
with properties
// defined in th strux level style. -MES
//
Simon
Received on Sun May 20 18:33:38 2012
This archive was generated by hypermail 2.1.8 : Sun May 20 2012 - 18:33:38 CEST