sw/source/core/txtnode/modeltoviewhelper.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit bc9eaec36f2fcc9f9263da84480856cfbdca0c99
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Mar 8 14:13:28 2022 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed Mar 9 10:45:53 2022 +0100

    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.st...@allotropia.de>

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,8 +253,14 @@ 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

Reply via email to