summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2018-03-13 16:03:01 +0100
committerLászló Németh <nemeth@numbertext.org>2018-03-14 15:26:15 +0100
commitaab440c768b64b9d2ffa72223b6d843a84c2d061 (patch)
tree8e28de3461954d58a333e9735be3572c1f6ad83b
parentb203e78a69acf5d84cc245ce7232ffee4a6edcd4 (diff)
tdf#69416 don't remove field content in proofreading,
only the requested footnote numbers, allowing grammar checking of automatic references with affixes, articles etc. Expanded fields get also a starting ZWSP character for more precise grammar checking. (Partial revert of commit d477ff4a81ecba8a77ead5ff1a33d3e3ceed622e) Change-Id: I78ab02cc8cf98d665e7f9ddc740879c203f2f7e4 Reviewed-on: https://gerrit.libreoffice.org/51228 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r--sw/source/core/txtnode/modeltoviewhelper.cxx7
1 files changed, 4 insertions, 3 deletions
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<SwTextField const*>(pAttr)->
+ // add a ZWSP before the expanded field in replace mode
+ aFieldResult.m_sExpand = ((eMode & ExpandMode::ReplaceMode)
+ ? OUString(CHAR_ZWSP) : OUString("")) +
+ static_txtattr_cast<SwTextField const*>(pAttr)->
GetFormatField().GetField()->ExpandField(true);
aFieldResult.m_eType = FieldResult::FIELD;
}