diff options
author | Rajashri <rajashri.udhoji@synerzip.com> | 2014-04-04 09:00:27 +0530 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2014-04-11 12:30:45 +0000 |
commit | 07f90c89ef78484a422ca4536ba587217147e80a (patch) | |
tree | 7a6255a5c961858641130687f2e1e799b991b206 | |
parent | 11545b91d539b5c354c1423755be2a3809794bb6 (diff) |
fdo#76635 : Table borders not preserved after RT
The document containing a custom table is getting crashed.
In the document the user has created his own costume table styles and
in the created custom table style the user has set repeat first row as header property.
The corresponding tag for this property is 'tblHeader'
LO was adding this property as a part of cellProperties in DomainMapperTableHandler.cxx.
But it is a part of a Row Property. That is why there was a crash @ open.
In DomainMapperTableHandler.cxx : 'endTableGetCellProperties' tblHeader property is removed from
style as it is not allowed for a cell.
Change-Id: I83cd369aa4497ec3f4b567174f23ddee9be2864e
Reviewed-on: https://gerrit.libreoffice.org/8848
Tested-by: David Tardon <dtardon@redhat.com>
Reviewed-by: David Tardon <dtardon@redhat.com>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/testTcBorders.docx | bin | 0 -> 55225 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 19 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 14 |
3 files changed, 28 insertions, 5 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/testTcBorders.docx b/sw/qa/extras/ooxmlexport/data/testTcBorders.docx Binary files differnew file mode 100644 index 000000000000..b7fb81ad4c1a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/testTcBorders.docx 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<text::XTextDocument> 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 ); + + aDefaultRepeatIt = pAllCellProps->find(PROP_PARA_LINE_SPACING); 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_TBL_HEADER); + if ( aDefaultRepeatIt != pAllCellProps->end( ) ) + pAllCellProps->erase( aDefaultRepeatIt ); // Then add the cell properties pAllCellProps->InsertProps(*aCellIterator); |