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

Justin Luth justin_luth at sil.org
Wed Jan 4 08:44:10 UTC 2017


 sw/qa/extras/ooxmlexport/data/tdf99616_hidemarkb.docx    |binary
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx                |   13 +++++++++++++
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |    4 +---
 3 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 1a58cdf8af1aba52ce0a376666dd7d742234d7cf
Author: Justin Luth <justin_luth at sil.org>
Date:   Fri Dec 23 13:49:19 2016 +0300

    tdf#99616 writerfilter: hideMark shouldn't force min size
    
    hideMark in Word does not force the minimum possible row size,
    but simply ignores any cell marker styles/sizings. So an empty row
    then takes on the "at least" size defined for the row.
    
    Change-Id: Id24a52f2a360a5040c2eed5c17757c0d32d03520
    Reviewed-on: https://gerrit.libreoffice.org/32380
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf99616_hidemarkb.docx b/sw/qa/extras/ooxmlexport/data/tdf99616_hidemarkb.docx
new file mode 100755
index 0000000..825108a
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf99616_hidemarkb.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 7e0b03f..706a359 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -1737,6 +1737,19 @@ DECLARE_OOXMLEXPORT_TEST(testHidemark, "hidemark.docx")
     CPPUNIT_ASSERT_MESSAGE("table size is less than 7000?",sal_Int32(7000) > getProperty<sal_Int32>(xTextTable, "Width"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testHidemarkb, "tdf99616_hidemarkb.docx")
+{
+    // Problem was that the smallest possible height was forced, not the min specified size.
+    uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY);
+    uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
+    uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY);
+    // Height should be .5cm
+    CPPUNIT_ASSERT_EQUAL(sal_Int64(501), getProperty<sal_Int64>(xTableRows->getByIndex(1), "Height"));
+    // Size type was MIN, should be FIX to avoid considering the end of paragraph marker.
+    CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, getProperty<sal_Int16>(xTableRows->getByIndex(1), "SizeType"));
+}
+
 DECLARE_OOXMLEXPORT_TEST(testBnc891663, "bnc891663.docx")
 {
     // The image should be inside a cell, so the text in the following cell should be below it.
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 30a4ad7..975f6d8 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -928,7 +928,6 @@ css::uno::Sequence<css::beans::PropertyValues> DomainMapperTableHandler::endTabl
     TagLogger::getInstance().startElement("getRowProperties");
 #endif
 
-    static const int MINLAY = 23; // sw/inc/swtypes.hxx, minimal possible size of frames.
     css::uno::Sequence<css::beans::PropertyValues> aRowProperties( m_aRowProperties.size() );
     PropertyMapVector1::const_iterator aRowIter = m_aRowProperties.begin();
     PropertyMapVector1::const_iterator aRowIterEnd = m_aRowProperties.end();
@@ -948,9 +947,8 @@ css::uno::Sequence<css::beans::PropertyValues> DomainMapperTableHandler::endTabl
             if (lcl_hideMarks(m_aCellProperties[nRow]) && lcl_emptyRow(m_aTableRanges, nRow))
             {
                 // We have CellHideMark on all cells, and also all cells are empty:
-                // Set the row height to minimal as Word does.
+                // Force the row height to be exactly as specified, and not just as the minimum suggestion.
                 (*aRowIter)->Insert(PROP_SIZE_TYPE, uno::makeAny(text::SizeType::FIX));
-                (*aRowIter)->Insert(PROP_HEIGHT, uno::makeAny(static_cast<sal_Int32>(ConversionHelper::convertTwipToMM100(MINLAY))));
             }
 
             aRowProperties[nRow] = (*aRowIter)->GetPropertyValues();


More information about the Libreoffice-commits mailing list