diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-06-15 21:25:27 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-06-20 00:34:38 +0200 |
commit | 6db39dbd7378351f6476f6db25eb7110c9cfb291 (patch) | |
tree | 0f9321d40740e87e80d8ed05a7c7f474d5310afd /sw/inc/swtypes.hxx | |
parent | e012f326c1c32c053304998a6826cb322f2c7728 (diff) |
fdo#52028: sw: let text formatting ignore RSID in automatic styles
A suprising regression from 062eaeffe7cb986255063bb9b0a5f3fb3fc8e34c:
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
Diffstat (limited to 'sw/inc/swtypes.hxx')
-rw-r--r-- | sw/inc/swtypes.hxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx index 187e070e8da8..f5ba633310ab 100644 --- a/sw/inc/swtypes.hxx +++ b/sw/inc/swtypes.hxx @@ -192,6 +192,8 @@ namespace nsSetAttrMode const SetAttrMode SETATTR_DONTREPLACE = 0x0002; // Don't replace another text attribute. const SetAttrMode SETATTR_NOTXTATRCHR = 0x0004; // Don't insert 0xFF at attributes with no end. + /// attention: NOHINTADJUST prevents MergePortions! + /// when using this need to pay attention to ignore start/end flags of hint const SetAttrMode SETATTR_NOHINTADJUST = 0x0008; // No merging of ranges. const SetAttrMode SETATTR_NOFORMATATTR = 0x0010; // Do not change into format attribute. const SetAttrMode SETATTR_DONTCHGNUMRULE = 0x0020; // Do not change NumRule. |