summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlimport
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2015-11-19 20:48:14 +1000
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-12-09 13:11:48 +0000
commit769dc61fcaea382518f014c24dffb702b7a50fc6 (patch)
tree1bacd98cb3c68ce0a98748830b1f6d85893b099d /sw/qa/extras/ooxmlimport
parent9d2a1c48b4a39967bc21776b471f1a4eca735cb6 (diff)
tdf#95755: Don't discard table properties in endOfRowAction()
In the beginning of endOfRowAction(), the current value of m_aTmpTableProperties.back( ) is stored in a temporary variable. Then, the width of table may be put into m_aTmpTableProperties.back( ). In the end, this temp variable is assigned to TableManager::mState.mTableProps and the m_aTmpTableProperties.back( ) is reset. In the middle, the m_aTmpTableProperties.back( ) may be replaced in endLevel()/startLevel() sequence (if new table is started). In that case, the width calculations go to a different object than stored in temp var. Consequently, that value will be discarded and replaced with initial stored in temp var. Fixed that by directly operating with temp var instead of m_aTmpTableProperties.back( ). Also, the value of m_nCell was not kept over endLevel()/startLevel() sequence and that prevented from calculating width. Fixed that. Also, removed leftovers from commit cbd0fbc287051f918e4adb32b3e9b58dfbf8059d. Change-Id: If85dbb715e7c60f60043f9d60d6a3c3d02277add Reviewed-on: https://gerrit.libreoffice.org/20052 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf95755.docxbin0 -> 16864 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx15
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf95755.docx b/sw/qa/extras/ooxmlimport/data/tdf95755.docx
new file mode 100644
index 000000000000..194c43199c02
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf95755.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index e19d1ba4c91e..f5cc1f6fd0ba 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2933,6 +2933,21 @@ DECLARE_OOXMLIMPORT_TEST(testTdf78902, "tdf78902.docx")
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
+DECLARE_OOXMLIMPORT_TEST(testTdf95755, "tdf95755.docx")
+{
+ /*
+ * The problem was that the width of a second table with single cell was discarded
+ * and resulted in too wide table
+ */
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xTableProperties(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Any aValue = xTableProperties->getPropertyValue("Width");
+ sal_Int32 nWidth;
+ aValue >>= nWidth;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(10659), nWidth);
+}
+
DECLARE_OOXMLIMPORT_TEST(testTdf95775, "tdf95775.docx")
{
// This must not fail in layout