diff options
author | sushil_shinde <sushil.shinde@synerzip.com> | 2014-01-22 17:10:11 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-13 10:25:16 +0100 |
commit | 4d34d43b29be2b14a02b001b35fcde2459fb1993 (patch) | |
tree | 969629de48f4f64e5a3c63a11d918b981e767118 | |
parent | 9d5005a70cc42ee9f45104cc32aa099d0c3d6630 (diff) |
fdo#69656 table with auto-width and at least one column with auto-width.
- In case of auto width of table and atleast one cell of table
is auto width It was setting table width to 100% relative width.
- hence it was causing rederening problem, table width was wrong
while rendering.
- Changed 100% hardcoded value, now setting total width of table
as per grid values.
- modified one UT since we no longer setting width of table to
100% default in case of 'auto' width.
- Added one UT to check proper table width while importing.
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Reviewed on:
https://gerrit.libreoffice.org/7593
Change-Id: Iae396c632eb1ef0c06efaa8c1965e4a68f12c6b1
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/Table_cell_auto_width_fdo69656.docx | bin | 0 -> 18939 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableManager.cxx | 11 |
3 files changed, 17 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/Table_cell_auto_width_fdo69656.docx b/sw/qa/extras/ooxmlimport/data/Table_cell_auto_width_fdo69656.docx Binary files differnew file mode 100644 index 000000000000..10b8f9de21d8 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/Table_cell_auto_width_fdo69656.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index f9a02403b9bc..c9d578b359e9 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1343,7 +1343,7 @@ DECLARE_OOXMLIMPORT_TEST(testFdo66474, "fdo66474.docx") // take the full available width, like it would have to. uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xTables->getByIndex(0), "RelativeWidth")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xTables->getByIndex(0), "RelativeWidth")); } DECLARE_OOXMLIMPORT_TEST(testGroupshapeRotation, "groupshape-rotation.docx") @@ -1842,6 +1842,13 @@ DECLARE_OOXMLIMPORT_TEST(testPictureWithSchemeColor, "picture-with-schemecolor.d CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int8>(110), aDIB[136] ); CPPUNIT_ASSERT_EQUAL( static_cast<sal_Int8>(49), aDIB[137] ); } + +DECLARE_OOXMLIMPORT_TEST(testFdo69656, "Table_cell_auto_width_fdo69656.docx") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8154), getProperty<sal_Int32>(xTables->getByIndex(0), "Width")); +} #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 2b66761522f0..29d28b4d0cd9 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -169,7 +169,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) { // Set the width type of table with 'Auto' and set the width value to 100(%) pPropMap->setValue( TablePropertyMap::TABLE_WIDTH_TYPE, text::SizeType::VARIABLE ); - pPropMap->setValue( TablePropertyMap::TABLE_WIDTH, 100 ); + pPropMap->setValue( TablePropertyMap::TABLE_WIDTH, 0 ); } } m_bTableSizeTypeInserted = true; @@ -667,7 +667,14 @@ void DomainMapperTableManager::endOfRowAction() { propMap->setValue( TablePropertyMap::TABLE_WIDTH, m_nTableWidth ); } - + if (nTableWidthType == text::SizeType::VARIABLE ) + { + if(nTableWidth > 100 || nTableWidth <= 0) + { + propMap->setValue( TablePropertyMap::TABLE_WIDTH, m_nTableWidth); + propMap->setValue( TablePropertyMap::TABLE_WIDTH_TYPE, text::SizeType::FIX); + } + } uno::Sequence< text::TableColumnSeparator > aSeparators( m_nCell.back( ) - 1 ); text::TableColumnSeparator* pSeparators = aSeparators.getArray(); sal_Int16 nLastRelPos = 0; |