diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2022-03-08 14:13:28 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-03-09 10:45:53 +0100 |
commit | bc9eaec36f2fcc9f9263da84480856cfbdca0c99 (patch) | |
tree | 9a85d583c883d1b04a9f08efd8817b656843e5a2 /sw | |
parent | e07b9c5142af838648a4d03a0bdce76612cf7535 (diff) |
sw: ModelToViewHelper: replace RES_TXTATR_ANNOTATION with nothing
It's a field but unlike other fields uses CH_TXTATR_INWORD so it
probably shouldn't break words.
Change-Id: If14ac24ec3e7eee15d67f91a0e2b17ab2c2637cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131216
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/modeltoviewhelper.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/modeltoviewhelper.cxx b/sw/source/core/txtnode/modeltoviewhelper.cxx index 0ddcbcd8e545..fa9b8f790860 100644 --- a/sw/source/core/txtnode/modeltoviewhelper.cxx +++ b/sw/source/core/txtnode/modeltoviewhelper.cxx @@ -253,10 +253,16 @@ ModelToViewHelper::ModelToViewHelper(const SwTextNode &rNode, FieldResult aFieldResult(nDummyCharPos); switch (pAttr->Which()) { - case RES_TXTATR_FIELD: case RES_TXTATR_ANNOTATION: if (eMode & ExpandMode::ExpandFields) { + // this uses CH_TXTATR_INWORD so replace with nothing + aFieldResult.m_eType = FieldResult::FIELD; + } + break; + case RES_TXTATR_FIELD: + if (eMode & ExpandMode::ExpandFields) + { // add a ZWSP before the expanded field in replace mode aFieldResult.m_sExpand = ((eMode & ExpandMode::ReplaceMode) ? OUString(CHAR_ZWSP) : OUString("")) + |