From f18d3a8f842713de10ecda161b74ef25e21aa14f Mon Sep 17 00:00:00 2001 From: Zolnai Tamás Date: Mon, 20 Jan 2014 13:44:46 +0100 Subject: fdo#73389 Writer does not show a docx-document with nested table correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The table manager can work with more table simultaneously and so m_aCellWidths contains more table's properties.Only one item of it belongs to the current table (getCurrentCellwidths). Regression from 74c5ed19f430327988194cdcd6bdff09591a93fa (cherry picked from commit d0c383256ef72d5212d8e2db77582d0ebe417209) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: I93efac0c004af1b2524c955ffb20c3ecd74a2920 Reviewed-on: https://gerrit.libreoffice.org/7544 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna Reviewed-by: Caolán McNamara --- sw/qa/extras/ooxmlimport/data/fdo73389.docx | Bin 0 -> 11067 bytes sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 7 +++++++ .../source/dmapper/DomainMapperTableManager.cxx | 23 +++++++-------------- 3 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 sw/qa/extras/ooxmlimport/data/fdo73389.docx diff --git a/sw/qa/extras/ooxmlimport/data/fdo73389.docx b/sw/qa/extras/ooxmlimport/data/fdo73389.docx new file mode 100644 index 000000000000..02b55f74e2b8 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo73389.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 6d44d45d496e..e9c5ad0d213f 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1563,6 +1563,13 @@ DECLARE_OOXMLIMPORT_TEST(testRPrChangeClosed, "rprchange_closed.docx") CPPUNIT_ASSERT_EQUAL(false, hasProperty(getRun(getParagraph(2), 1), "RedlineType")); } +DECLARE_OOXMLIMPORT_TEST(testFdo73389,"fdo73389.docx") +{ + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + // This was 9340, i.e. the width of the inner table was too large. + CPPUNIT_ASSERT_EQUAL(sal_Int32(2842), getProperty(xTables->getByIndex(0), "Width")); +} #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index c4b24a7e1a6a..cc7d1196661f 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -142,24 +142,17 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) */ bool bFixed = true; sal_Int32 nRowFixedWidth = 0; - if (!m_aCellWidths.empty()) + IntVectorPtr pCellWidths = getCurrentCellWidths(); + // Step 1. Check whether all cells have fixed widths in the given row of table. + for (std::vector::const_iterator aValIter = pCellWidths->begin(); aValIter != pCellWidths->end(); ++aValIter) { - // Step 1. Check whether all cells have fixed widths in the given row of table. - ::std::vector< IntVectorPtr >::iterator itr; - for (itr = m_aCellWidths.begin(); itr != m_aCellWidths.end(); ++itr ) + if (*aValIter == -1) { - IntVectorPtr itrVal = (*itr); - for (std::vector::const_iterator aValIter = itrVal->begin(); aValIter != itrVal->end(); ++aValIter) - { - if (*aValIter == -1) - { - bFixed = false; - break; - } - // Sum the width of cells to find the total width of given row - nRowFixedWidth += (*aValIter); - } + bFixed = false; + break; } + // Sum the width of cells to find the total width of given row + nRowFixedWidth += (*aValIter); } // Check whether the total width of given row is compared with the maximum value of rows (m_nMaxFixedWidth). -- cgit v1.2.3