sw/qa/extras/ww8export/data/tdf112517_maxSprms.doc |binary
 sw/qa/extras/ww8export/ww8export2.cxx              |    8 ++++++++
 sw/source/filter/ww8/wrtww8.cxx                    |    2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 189b5559b1091a4b72703a79c2e6da41e24f85c6
Author: Justin Luth <[email protected]>
Date:   Wed Sep 20 19:49:39 2017 -0400

    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 <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

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
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf112517_maxSprms.doc 
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
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to