diff --git a/sw/source/core/txtnode/modeltoviewhelper.cxx b/sw/source/core/txtnode/modeltoviewhelper.cxx index 5018bf128474..e6f5b1885f56 100644 --- a/sw/source/core/txtnode/modeltoviewhelper.cxx +++ b/sw/source/core/txtnode/modeltoviewhelper.cxx @@ -147,9 +147,10 @@ ModelToViewHelper::ModelToViewHelper(const SwTextNode &rNode, ExpandMode eMode) case RES_TXTATR_ANNOTATION: if (eMode & ExpandMode::ExpandFields) { - aFieldResult.m_sExpand = (eMode & ExpandMode::ReplaceMode) - ? OUString(CHAR_ZWSP) - : static_txtattr_cast(pAttr)-> + // add a ZWSP before the expanded field in replace mode + aFieldResult.m_sExpand = ((eMode & ExpandMode::ReplaceMode) + ? OUString(CHAR_ZWSP) : OUString("")) + + static_txtattr_cast(pAttr)-> GetFormatField().GetField()->ExpandField(true); aFieldResult.m_eType = FieldResult::FIELD; }