summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-09-20 19:49:39 -0400
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-10-16 10:31:24 +0200
commit189b5559b1091a4b72703a79c2e6da41e24f85c6 (patch)
tree525b43117408e597468a0d36e37f00d30789d293 /sw
parent0e9c841aa2d5ed3112aacd4a483dcd6cb6a801cb (diff)
tdf#112517 ww8export: fix max PAP Fkps
Since we are appending an Fkp, the current length MUST be smaller than the maximum of 488. If it is already the maximum size, then start creating a HugePapx. Change-Id: I698a0f79e90f8ac644c1e7e77acbd662df69d7c1 Reviewed-on: https://gerrit.libreoffice.org/42572 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ww8export/data/tdf112517_maxSprms.docbin0 -> 49152 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx8
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx2
3 files changed, 9 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf112517_maxSprms.doc b/sw/qa/extras/ww8export/data/tdf112517_maxSprms.doc
new file mode 100644
index 000000000000..95de03d3b016
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf112517_maxSprms.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index 191d4b940e10..88509caf81d6 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -189,6 +189,14 @@ DECLARE_WW8EXPORT_TEST(testBnc863018b, "bnc863018b.doc")
CPPUNIT_ASSERT_EQUAL( 1, getPages() );
}
+DECLARE_WW8EXPORT_TEST(testTdf112517_maxSprms, "tdf112517_maxSprms.doc")
+{
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL( sal_Int32(28), xTable->getRows()->getCount() );
+}
+
DECLARE_WW8EXPORT_TEST(testTdf108448_endNote, "tdf108448_endNote.odt")
{
uno::Reference<text::XEndnotesSupplier> xEndnotesSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index bc2e526d51f1..ea0152abefdd 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -998,7 +998,7 @@ void WW8_WrPlcPn::AppendFkpEntry(WW8_FC nEndFc,short nVarLen,const sal_uInt8* pS
// big sprm? build the sprmPHugePapx
sal_uInt8* pNewSprms = const_cast<sal_uInt8*>(pSprms);
sal_uInt8 aHugePapx[ 8 ];
- if (PAP == ePlc && 488 < nVarLen)
+ if (PAP == ePlc && 488 <= nVarLen)
{
sal_uInt8* p = aHugePapx;
*p++ = *pSprms++; // set style Id