diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf81100.docx | bin | 19329 -> 29760 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 29 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableManager.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/dmapper/TblStylePrHandler.cxx | 1 |
6 files changed, 38 insertions, 14 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf81100.docx b/sw/qa/extras/ooxmlexport/data/tdf81100.docx Binary files differindex 61038d190c7e..cd46100f0556 100644 --- a/sw/qa/extras/ooxmlexport/data/tdf81100.docx +++ b/sw/qa/extras/ooxmlexport/data/tdf81100.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 47d5500a76f4..835e991f5651 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -974,6 +974,17 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf81100, "tdf81100.docx") CPPUNIT_ASSERT(pXmlDoc); // keep "repeat table header" setting of table styles assertXPath(pXmlDoc, "/w:styles/w:style/w:tblStylePr/w:trPr/w:tblHeader", 4); + + xmlDocPtr pDump = parseLayoutDump(); + CPPUNIT_ASSERT_EQUAL(3, 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]", 1); + assertXPath(pDump, "/root/page[2]/body/tab[1]/row", 2); + assertXPath(pDump, "/root/page[3]/body/tab", 1); + if (!mbExported) // TODO export tblHeader=false + assertXPath(pDump, "/root/page[3]/body/tab/row", 1); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121597TrackedDeletionOfMultipleParagraphs, "tdf121597.odt") diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index cab57300c1da..eec9e5039519 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3540,7 +3540,7 @@ void DocxAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t c // Header row: tblHeader const SwTable *pTable = pTableTextNodeInfoInner->getTable( ); if ( pTable->GetRowsToRepeat( ) > pTableTextNodeInfoInner->getRow( ) ) - m_pSerializer->singleElementNS(XML_w, XML_tblHeader, FSNS(XML_w, XML_val), "true"); + m_pSerializer->singleElementNS(XML_w, XML_tblHeader, FSNS(XML_w, XML_val), "true"); // TODO to overwrite table style may need explicit false TableRowRedline( pTableTextNodeInfoInner ); TableHeight( pTableTextNodeInfoInner ); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 90cb75dbbd5a..859c8c4415c5 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -50,6 +50,18 @@ using namespace ::com::sun::star; using namespace ::std; #define DEF_BORDER_DIST 190 //0,19cm +#define CNF_FIRST_ROW 0x800 +#define CNF_LAST_ROW 0x400 +#define CNF_FIRST_COLUMN 0x200 +#define CNF_LAST_COLUMN 0x100 +#define CNF_ODD_VBAND 0x080 +#define CNF_EVEN_VBAND 0x040 +#define CNF_ODD_HBAND 0x020 +#define CNF_EVEN_HBAND 0x010 +#define CNF_FIRST_ROW_LAST_COLUMN 0x008 +#define CNF_FIRST_ROW_FIRST_COLUMN 0x004 +#define CNF_LAST_ROW_LAST_COLUMN 0x002 +#define CNF_LAST_ROW_FIRST_COLUMN 0x001 DomainMapperTableHandler::DomainMapperTableHandler( css::uno::Reference<css::text::XTextAppendAndConvert> const& xText, @@ -427,6 +439,10 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo m_aTableProperties->dumpXml(); TagLogger::getInstance().endElement(); #endif + // apply tblHeader setting of the table style + PropertyMapPtr pHeaderStyleProps = pTableStyle->GetProperties(CNF_FIRST_ROW); + if ( pHeaderStyleProps->getProperty(PROP_HEADER_ROW_COUNT) ) + m_aTableProperties->Insert(PROP_HEADER_ROW_COUNT, uno::makeAny( sal_Int32(1)), false); } } @@ -630,19 +646,6 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo return pTableStyle; } -#define CNF_FIRST_ROW 0x800 -#define CNF_LAST_ROW 0x400 -#define CNF_FIRST_COLUMN 0x200 -#define CNF_LAST_COLUMN 0x100 -#define CNF_ODD_VBAND 0x080 -#define CNF_EVEN_VBAND 0x040 -#define CNF_ODD_HBAND 0x020 -#define CNF_EVEN_HBAND 0x010 -#define CNF_FIRST_ROW_LAST_COLUMN 0x008 -#define CNF_FIRST_ROW_FIRST_COLUMN 0x004 -#define CNF_LAST_ROW_LAST_COLUMN 0x002 -#define CNF_LAST_ROW_FIRST_COLUMN 0x001 - CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(TableInfo & rInfo, std::vector<HorizontallyMergedCell>& rMerges) { #ifdef DBG_UTIL diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 13a14fb2c3d0..6adbcdc075f7 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -225,7 +225,16 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) insertTableProps(pPropMap); } else + { + if ( nIntValue == 0 && m_nRow == 0 ) + { + // explicit tblHeader=0 in the first row must overwrite table style + TablePropertyMapPtr pPropMap( new TablePropertyMap ); + pPropMap->Insert( PROP_HEADER_ROW_COUNT, uno::makeAny(sal_Int32(0))); + insertTableProps(pPropMap); + } m_nHeaderRepeat = -1; + } if (nIntValue) { // Store the info that this is a header, we'll need that when we apply table styles. diff --git a/writerfilter/source/dmapper/TblStylePrHandler.cxx b/writerfilter/source/dmapper/TblStylePrHandler.cxx index c47042f30b53..674bb5bd2250 100644 --- a/writerfilter/source/dmapper/TblStylePrHandler.cxx +++ b/writerfilter/source/dmapper/TblStylePrHandler.cxx @@ -162,6 +162,7 @@ void TblStylePrHandler::lcl_sprm(Sprm & rSprm) break; case NS_ooxml::LN_CT_TrPrBase_tblHeader: { + m_pProperties->Insert( PROP_HEADER_ROW_COUNT, uno::makeAny(sal_Int32(1))); beans::PropertyValue aValue; aValue.Name = "tblHeader"; aValue.Value <<= true; |