[Libreoffice-commits] core.git: sw/qa writerfilter/source

Rajashri rajashri.udhoji at synerzip.com
Fri Apr 11 05:31:11 PDT 2014


 sw/qa/extras/ooxmlexport/data/testTcBorders.docx         |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx                 |   19 +++++++++++++++
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   14 +++++++----
 3 files changed, 28 insertions(+), 5 deletions(-)

New commits:
commit 07f90c89ef78484a422ca4536ba587217147e80a
Author: Rajashri <rajashri.udhoji at synerzip.com>
Date:   Fri Apr 4 09:00:27 2014 +0530

    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 at redhat.com>
    Reviewed-by: David Tardon <dtardon at redhat.com>

diff --git a/sw/qa/extras/ooxmlexport/data/testTcBorders.docx b/sw/qa/extras/ooxmlexport/data/testTcBorders.docx
new file mode 100644
index 0000000..b7fb81a
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 cafd9ea..d13bb70 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 08d1919..336514b 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);


More information about the Libreoffice-commits mailing list