[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sw/qa sw/source
Michael Stahl
mstahl at redhat.com
Wed Feb 22 08:59:11 UTC 2017
sw/qa/extras/ww8export/data/ooo92948-1.doc |binary
sw/qa/extras/ww8export/ww8export.cxx | 19 +++++++++++++++++++
sw/source/filter/ww8/ww8par2.cxx | 1 +
3 files changed, 20 insertions(+)
New commits:
commit 31cd8dbada7527629c559a6ff50014a3959c01ef
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Feb 16 18:17:53 2017 +0100
i#92948 sw: WW8 import: fix table in Apo in header
The document contains a table inside of a frame anchored in the header.
In WW8TabDesc::WW8TabDesc() the update to nOrigPos makes a mess of
things because the new nOrigPos value contains the value of nCpOfs (93)
already, so later on when SwWW8ImplReader::TestApo() calls
WW8PLCFxDesc::Save() / WW8PLCFxDesc::Restore(), the call to SeekPos()
positions it on CP 325 instead of 232 and the subsequent call to
GetSprms() finds nothing on the wrong position; thus TestApo() concludes
that the paragraph has different Apo properties than the previous one
and a new fly frame is created.
(regression from 4bd341e2c8a1f3a4f4677eb879a60a4ffc3369db)
(cherry picked from commit d4620d535bd5a8e73bdb9d556933b9ae22800a7d)
sw: use the stupid line-ends for WNT
(cherry picked from commit d1a8ca4951c076c605a47aadf6bdcac79d2bee8e)
Change-Id: I697c4526c7c3a12119947ff5659c11ea9ee7fff8
Reviewed-on: https://gerrit.libreoffice.org/34360
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/qa/extras/ww8export/data/ooo92948-1.doc b/sw/qa/extras/ww8export/data/ooo92948-1.doc
new file mode 100644
index 0000000..f355eaa
Binary files /dev/null and b/sw/qa/extras/ww8export/data/ooo92948-1.doc differ
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index f5fffee..8af8713 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -328,6 +328,25 @@ DECLARE_WW8EXPORT_TEST(testListNolevel, "list-nolevel.doc")
CPPUNIT_ASSERT_EQUAL(OUString("1."), aText);
}
+DECLARE_WW8EXPORT_TEST(testHeaderApoTable, "ooo92948-1.doc")
+{
+ // the problem was that a table anchored in the header was split across
+ // 3 text frames and quite messed up
+
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ uno::Reference<text::XText> xFrame(xIndexAccess->getByIndex(1), uno::UNO_QUERY);
+
+ uno::Reference<text::XTextContent> xTable(getParagraphOrTable(1, xFrame));
+ getCell(xTable, "A1", "Aan" SAL_NEWLINE_STRING "Recipient" SAL_NEWLINE_STRING "Recipient" SAL_NEWLINE_STRING);
+ getCell(xTable, "A2", "Kopie aan" SAL_NEWLINE_STRING);
+ getCell(xTable, "A3", "Datum" SAL_NEWLINE_STRING "31 juli 2008");
+ getCell(xTable, "A4", "Locatie" SAL_NEWLINE_STRING "Locationr");
+ getCell(xTable, "A5", "Van" SAL_NEWLINE_STRING "Sender ");
+ getCell(xTable, "A6", "Directie" SAL_NEWLINE_STRING "Department");
+ getCell(xTable, "A7", "Telefoon" SAL_NEWLINE_STRING "Phone");
+}
+
DECLARE_WW8EXPORT_TEST(testBnc821208, "bnc821208.doc")
{
// WW8Num1z0 earned a Symbol font, turning numbers into rectangles.
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 1ec8199..41e0657 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2020,6 +2020,7 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) :
// PlcxMan currently points too far ahead so we need to bring
// it back to where we are trying to make a table
m_pIo->m_pPlcxMan->GetPap()->nOrigStartPos = aRes.nStartPos;
+ m_pIo->m_pPlcxMan->GetPap()->nCpOfs = aRes.nCpOfs;
if (!(pPap->SeekPos(aRes.nStartPos)))
{
aRes.nEndPos = WW8_CP_MAX;
More information about the Libreoffice-commits
mailing list