summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-09-23 20:35:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-09-24 10:04:48 +0100
commit705a8c226aee3e68db492083b7cf8b704335328b (patch)
treec701b3a13f48f6d5a4c226bcf4f67e1e91a41049
parent6332c643016ce4c4d254c8429a5eceae6664bf5c (diff)
WW8PLCFMan::AdjustEnds deeply flawed concept wrt change tracking
The whole idea of clipping the char attributes to before the cr that word uses as the end of para marker is flawed from especially the perspective of redlining which is a char property in word. If the redline encompasses the newline in order to state that it is deleted, then if the prop is clipped to before that newline then the end-of-para doesn't get marked as deleted For now just remove the character attributes clipping from here to be as conservative as possible. Hopefully the ordering of processing start pap before start chp and end chp before end pap and the other million improvements in the parser that came about after AdjustEnds was created avoids whatever problems were trying to be worked around here. Change-Id: I5a72e462db2fff60f52b12c2125ea6ac363de695
-rw-r--r--sw/qa/extras/ww8export/data/redline-export-2.odtbin0 -> 10363 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export.cxx9
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx9
3 files changed, 10 insertions, 8 deletions
diff --git a/sw/qa/extras/ww8export/data/redline-export-2.odt b/sw/qa/extras/ww8export/data/redline-export-2.odt
new file mode 100644
index 000000000000..2aca5eee4cd3
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/redline-export-2.odt
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index 184815d080e5..cefd0db11fea 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -349,7 +349,7 @@ DECLARE_WW8EXPORT_TEST(testRedlineExport1, "redline-export-1.odt")
uno::Reference<text::XTextRange> xParagraph = getParagraph(1);
uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParagraph, uno::UNO_QUERY);
uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration();
- //there must be no redline information on the first line before or after reloading
+ //there must be no redline information on the first line before and after reloading
while (xRunEnum->hasMoreElements())
{
uno::Reference<text::XTextRange> xRun(xRunEnum->nextElement(), uno::UNO_QUERY);
@@ -357,6 +357,13 @@ DECLARE_WW8EXPORT_TEST(testRedlineExport1, "redline-export-1.odt")
}
}
+DECLARE_WW8EXPORT_TEST(testRedlineExport2, "redline-export-2.odt")
+{
+ //there must be redline information on the first portion of the third paragraph before and after reloading
+ CPPUNIT_ASSERT_EQUAL(true, hasProperty(getRun(getParagraph(3), 1), "RedlineType"));
+}
+
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index d1898fec2bb1..9c3d2665bae0 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4235,20 +4235,15 @@ void WW8PLCFMan::AdjustEnds( WW8PLCFxDesc& rDesc )
nLineEnd = pPap->nEndPos;// nLineEnd zeigt *hinter* das <CR>
pPap->nEndPos--; // Absatzende um 1 Zeichen verkuerzen
- // gibt es bereits ein CharAttr-Ende das auf das jetzige
- // Absatzende zeigt ? ... dann auch um 1 Zeichen verkuerzen
- if (pChp->nEndPos == nLineEnd)
- pChp->nEndPos--;
-
// gibt es bereits ein Sep-Ende, das auf das jetzige Absatzende
// zeigt ? ... dann auch um 1 Zeichen verkuerzen
if( pSep->nEndPos == nLineEnd )
pSep->nEndPos--;
}
}
- else if ( (&rDesc == pChp) || (&rDesc == pSep) )
+ else if (&rDesc == pSep)
{
- // Char Adjust oder Sep Adjust Wenn Ende Char-Attr == Absatzende ...
+ // Sep Adjust Wenn Ende Char-Attr == Absatzende ...
if( (rDesc.nEndPos == nLineEnd) && (rDesc.nEndPos > rDesc.nStartPos) )
rDesc.nEndPos--; // ... dann um 1 Zeichen verkuerzen
}