summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-01-20 13:44:46 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-01-22 15:34:28 +0000
commit7a0eec199901962b03f04371e9474caf8c408c01 (patch)
tree50f6ca1e32565d31a8fc6832c130daf110eb6c81
parentb703da40bb052809ff94a714fb8da7aadf2d7d6b (diff)
fdo#73389 Writer does not show a docx-document with nested table correctly
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 writerfilter/source/dmapper/DomainMapperTableManager.cxx Change-Id: I93efac0c004af1b2524c955ffb20c3ecd74a2920 Reviewed-on: https://gerrit.libreoffice.org/7565 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/qa/extras/ooxmlimport/data/fdo73389.docxbin0 -> 11067 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx10
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx19
3 files changed, 16 insertions, 13 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/fdo73389.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 2c72214bf1cb..32545c23cbc7 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -137,6 +137,7 @@ public:
void testBnc779620();
void testRPrChangeClosed();
void testFdo65090();
+ void testFdo73389();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -239,6 +240,7 @@ void Test::run()
{"bnc779620.docx", &Test::testBnc779620},
{"rprchange_closed.docx", &Test::testRPrChangeClosed},
{"fdo65090.docx", &Test::testFdo65090},
+ {"fdo73389.docx", &Test::testFdo73389},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1673,6 +1675,14 @@ void Test::testFdo65090()
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength());
}
+void Test::testFdo73389()
+{
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> 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<sal_Int32>(xTables->getByIndex(0), "Width"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 59afbb3e9310..157fbf83b914 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -142,20 +142,13 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
*/
bool bFixed = false;
sal_Int32 nRowFixedWidth = 0;
- if (!m_aCellWidths.empty())
+ IntVectorPtr pCellWidths = getCurrentCellWidths();
+ // Step 1. Check whether any cell has fixed width in the given row of table.
+ for (std::vector<sal_Int32>::const_iterator aValIter = pCellWidths->begin(); aValIter != pCellWidths->end(); ++aValIter)
{
- // Step 1. Check whether any cell has fixed width in the given row of table.
- ::std::vector< IntVectorPtr >::iterator itr;
- for (itr = m_aCellWidths.begin(); itr != m_aCellWidths.end(); itr ++)
- {
- IntVectorPtr itrVal = (*itr);
- for (std::vector<sal_Int32>::const_iterator aValIter = itrVal->begin(); aValIter != itrVal->end(); ++aValIter)
- {
- // Sum the width of cells to find the total width of given row
- nRowFixedWidth += (*aValIter);
- bFixed = true;
- }
- }
+ // Sum the width of cells to find the total width of given row
+ nRowFixedWidth += (*aValIter);
+ bFixed = true;
}
// Check whether the total width of given row is compared with the maximum value of rows (m_nMaxFixedWidth).