diff --git a/sw/qa/extras/ooxmlexport/data/testTcBorders.docx b/sw/qa/extras/ooxmlexport/data/testTcBorders.docx new file mode 100644 index 000000000000..b7fb81ad4c1a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/testTcBorders.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index cafd9ea87684..d13bb70314fb 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -1344,6 +1344,21 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar2, "calendar2.docx") assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar2']/w:tblPr/w:tblBorders/w:insideV", "themeTint", "99"); } +DECLARE_OOXMLEXPORT_TEST(testTcBorders, "testTcBorders.docx") +{ + //fdo#76635 : Table borders are not getting preserved. + + xmlDocPtr pXmlDocument = parseExport("word/document.xml"); + if (!pXmlDocument) + return; + + assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:val = 'single']",1); + assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:sz = 4]", 1); + assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:space = 0]", 1); + assertXPath(pXmlDocument, "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:tc[1]/w:tcPr[1]/w:tcBorders[1]/w:bottom[1][@w:color = 808080]", 1); + +} + DECLARE_OOXMLEXPORT_TEST(testQuicktables, "quicktables.docx") { xmlDocPtr pXmlStyles = parseExport("word/styles.xml"); @@ -1384,6 +1399,10 @@ DECLARE_OOXMLEXPORT_TEST(testFdo71302, "fdo71302.docx") assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Strong']", 1); } + + + + DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx") { uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 08d1919dd345..336514b78438 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -545,7 +545,6 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo sal_Int32 nHoriOrient = text::HoriOrientation::LEFT_AND_WIDTH; m_aTableProperties->getValue( TablePropertyMap::HORI_ORIENT, nHoriOrient ) ; m_aTableProperties->Insert( PROP_HORI_ORIENT, uno::makeAny( sal_Int16(nHoriOrient) ) ); - //fill default value - if not available const PropertyMap::const_iterator aRepeatIter = m_aTableProperties->find(PROP_HEADER_ROW_COUNT); @@ -695,12 +694,17 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl } // Remove properties from style/row that aren't allowed in cells - const PropertyMap::iterator aDefaultRepeatIt = pAllCellProps->find(PROP_HEADER_ROW_COUNT); + PropertyMap::iterator aDefaultRepeatIt = pAllCellProps->find(PROP_HEADER_ROW_COUNT); if ( aDefaultRepeatIt != pAllCellProps->end( ) ) pAllCellProps->erase( aDefaultRepeatIt ); - const PropertyMap::iterator aDefaultRepeatIt2 = pAllCellProps->find(PROP_PARA_LINE_SPACING); - if ( aDefaultRepeatIt2 != pAllCellProps->end( ) ) - pAllCellProps->erase( aDefaultRepeatIt2 ); + + aDefaultRepeatIt = pAllCellProps->find(PROP_PARA_LINE_SPACING); + if ( aDefaultRepeatIt != pAllCellProps->end( ) ) + pAllCellProps->erase( aDefaultRepeatIt ); + + aDefaultRepeatIt = pAllCellProps->find(PROP_TBL_HEADER); + if ( aDefaultRepeatIt != pAllCellProps->end( ) ) + pAllCellProps->erase( aDefaultRepeatIt ); // Then add the cell properties pAllCellProps->InsertProps(*aCellIterator);