summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-10-11 14:55:53 +0200
committerMichael Stahl <michael.stahl@cib.de>2019-10-23 13:00:23 +0200
commit7f2e61f884949ab27bcb7e1a02ece9a5cb4354b9 (patch)
tree9e95c5b657140edf6b38bedecb6024dccfa87802
parent1332cf210803215857b81e8ca9c029aa3d6c49c2 (diff)
sw: WW8: fix the separator position
WW8 inserts the fieldmark at the end of the result, so separator should be at the start; writerfilter inserts fieldmark at the end of command so separator should be at the end. Change-Id: I44c9811139a34f529c553dd2fd46fdaccd554732 Reviewed-on: https://gerrit.libreoffice.org/80674 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx6
2 files changed, 5 insertions, 3 deletions
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index 43c3252953f5..b2523b822370 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -312,7 +312,7 @@ DECLARE_WW8EXPORT_TEST(testTdf104334, "tdf104334.doc")
// This failed with a container::NoSuchElementException: STYLEREF was
// mapped to SwChapterField, and the field result was "This is a Heading 1"
// instead of just "1".
- CPPUNIT_ASSERT_EQUAL(OUString("1"), getRun(getParagraph(2), 3)->getString());
+ CPPUNIT_ASSERT_EQUAL(OUString("1"), getRun(getParagraph(2), 4)->getString());
}
DECLARE_WW8EXPORT_TEST(testTdf108072, "tdf108072.doc")
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 1c27d73c3021..1ddbb49c3823 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -541,7 +541,8 @@ sal_uInt16 SwWW8ImplReader::End_Field()
SwPaM aFieldPam( m_aFieldStack.back().GetPtNode(), m_aFieldStack.back().GetPtContent(), aEndPos.nNode, aEndPos.nContent.GetIndex());
IDocumentMarkAccess* pMarksAccess = m_rDoc.getIDocumentMarkAccess( );
IFieldmark *pFieldmark = pMarksAccess->makeFieldBookmark(
- aFieldPam, m_aFieldStack.back().GetBookmarkName(), ODF_FORMTEXT );
+ aFieldPam, m_aFieldStack.back().GetBookmarkName(), ODF_FORMTEXT,
+ aFieldPam.Start() /*same pos as start!*/ );
OSL_ENSURE(pFieldmark!=nullptr, "hmmm; why was the bookmark not created?");
if (pFieldmark!=nullptr) {
// adapt redline positions to inserted field mark start
@@ -640,7 +641,8 @@ sal_uInt16 SwWW8ImplReader::End_Field()
IFieldmark* pFieldmark = pMarksAccess->makeFieldBookmark(
aFieldPam,
m_aFieldStack.back().GetBookmarkName(),
- ODF_UNHANDLED );
+ ODF_UNHANDLED,
+ aFieldPam.Start() /*same pos as start!*/ );
if ( pFieldmark )
{
// adapt redline positions to inserted field mark start