diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf64264.docx | bin | 0 -> 13501 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 17 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableManager.cxx | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf64264.docx b/sw/qa/extras/ooxmlexport/data/tdf64264.docx Binary files differnew file mode 100644 index 000000000000..e2fea64dada7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf64264.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 1849d05cb008..7aa03eb79cc2 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -743,6 +743,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf118691, "tdf118691.docx") CPPUNIT_ASSERT_EQUAL(OUString("Before\nAfter"), xCell->getString()); } +DECLARE_OOXMLEXPORT_TEST(testTdf64264, "tdf64264.docx") +{ + // DOCX table rows with tblHeader setting mustn't modify the count of the + // repeated table header rows, when there is rows before them without tblHeader settings. + xmlDocPtr pDump = parseLayoutDump(); + CPPUNIT_ASSERT_EQUAL(2, getPages()); + + // table starts on page 1 and finished on page 2 + // and it has got only a single repeating header line + assertXPath(pDump, "/root/page[2]/body/tab", 1); + assertXPath(pDump, "/root/page[2]/body/tab/row", 47); + CPPUNIT_ASSERT_EQUAL(OUString("Repeating Table Header"), + parseDump("/root/page[2]/body/tab/row[1]/cell[1]/txt/text()")); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), + parseDump("/root/page[2]/body/tab/row[2]/cell[1]/txt/text()")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 37f07f21a556..ed7dfebe97c4 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -200,7 +200,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) case NS_ooxml::LN_CT_TrPrBase_tblHeader: // if nIntValue == 1 then the row is a repeated header line // to prevent later rows from increasing the repeating m_nHeaderRepeat is set to NULL when repeating stops - if( nIntValue > 0 && m_nHeaderRepeat >= 0 ) + if( nIntValue > 0 && m_nHeaderRepeat == static_cast<int>(m_nRow) ) { ++m_nHeaderRepeat; TablePropertyMapPtr pPropMap( new TablePropertyMap ); |