summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docbm.cxx
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-10-11 14:57:04 +0200
committerMichael Stahl <michael.stahl@cib.de>2019-10-23 13:00:51 +0200
commitbc5e4104e281b89c08df102851e5693f35772c40 (patch)
tree45370b9e55cabb3a3563d45a69663655b4898c04 /sw/source/core/doc/docbm.cxx
parent7f2e61f884949ab27bcb7e1a02ece9a5cb4354b9 (diff)
sw: DateFieldmark separator position: hack to put it at the start
DateFieldmark isn't created for an actual field with a command but for a SDT (Date Picker Content Control), so it's somewhat pointless to insert a separator for it in the first place; but better have an invariant that every pair of FIELDSTART/FIELDEND has a FIELDSEP. TODO: maybe add another pair of distinct START/END for this thing. Change-Id: I37301b578c668ecbf9408a48c227db5991c33f9e Reviewed-on: https://gerrit.libreoffice.org/80675 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw/source/core/doc/docbm.cxx')
-rw-r--r--sw/source/core/doc/docbm.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 4f13bea2d79f..88a6019251b4 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1341,7 +1341,10 @@ namespace sw { namespace mark
SwPosition aPos (aPaM.GetPoint()->nNode, aPaM.GetPoint()->nContent);
SwPaM aNewPaM(pFieldmark->GetMarkStart(), pFieldmark->GetMarkEnd());
deleteFieldmarkAt(aPos);
- return makeFieldBookmark(aNewPaM, sName, rNewType);
+ // HACK: hard-code the separator position here at the start because
+ // writerfilter put it in the wrong place (at the end) on attach()
+ SwPosition const sepPos(*aNewPaM.Start());
+ return makeFieldBookmark(aNewPaM, sName, rNewType, &sepPos);
}
return nullptr;
}