• Michael Stahl's avatar
    fdo#52028: sw: let text formatting ignore RSID in automatic styles · 6db39dbd
    Michael Stahl yazdı
    A suprising regression from 062eaeff:
    The RSID text attributes that are inserted for every user-inserted text
    cause the text formatting (SwAttrIter) to create a lot more text portions,
    and the portion breaks make font kerning impossible.
    
    This is the only way i can think of to fix this problem; alternatives that
    don't work are splitting the RSID out of the AUTOFMT hint into a separate
    one and combining them in the sw UNO wrappers (fails because
    SwXAutoStylesEnumerator actually does need to enumerate every AUTOFMT
    including RSID), trying to detect and ignore them just in the text
    formatting (the SwAttrIter cannot easily/cheaply detect when it's allowed
    to skip), and having an internal subdivision inside the AUTOFMT hint (one
    subsection for every RSID change) (which does not work because it cannot
    ignore RSID-only AUTOFMTs completely).
    
    Solve the problem with 2 additional flags on AUTOFMT and CHARFMT
    attributes: FormatIgnoreStart and FormatIgnoreEnd, which indicate to
    SwAttrIter::GetNextAttr() that the start or end of the hint should be
    ignored, so that effectively it is merged with the preceding/subsequent
    hint.  Of course the UNO API does not respect the flags so we can store
    the RSIDs in automatic styles.
    
    The flags are maintained in SwpHints::MergePortions, which detects both
    RSID-only AUTOFMT hints (which can be ignored completely), and the
    situation of N CHARFMT hints + AUTOFMT hint vs. N CHARFMT hints +
    AUTOFMT hint where the AUTOFMT hints differ only in their RSID attribute.
    
    This means that MergePortions needs to be called more often now, in cases
    where the ignore flags may have been invalidated, such as:
    - insertion of text with possible DontExpand flag set on hints
    - deletion of hints
    - SETATTR_NOHINTADJUST mode
    
    Change-Id: I1fb95a87c654c67d114f6f7f2c43b847c50b0ffa
    6db39dbd
txatbase.hxx 8.01 KB