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>
This commit is contained in:
BIN
sw/qa/extras/ooxmlexport/data/testTcBorders.docx
Normal file
BIN
sw/qa/extras/ooxmlexport/data/testTcBorders.docx
Normal file
Binary file not shown.
@@ -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);
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user