diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-05-23 16:20:27 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-05-23 16:45:30 +0200 |
commit | ff2ead2c359e65afc25c0ddb74a127572aecc516 (patch) | |
tree | b27d19371f5df82ce4e88dbae7b9f5352a659658 /writerfilter/source/dmapper/DomainMapperTableHandler.cxx | |
parent | e76b470dfbefeb4c807f87871cb701f0a6ab34b9 (diff) |
bnc#819882 DOCX import: backport table-related fixes from libreoffice-4-1
7705a50ba330cd3fa08f5edfe6617d9acde8e8a5 2012-11-06 docx import: round float value to int when computing cells width
b261177e5d81a662c76d523e447d80c108ebdf5b 2012-11-08 round() is not portable
d276d3f3ae112a11c8cb5768650d147cbb94275e 2013-01-14 fdo#44053 fix this again and this time add a testcase as well
6718482c072defe5d885030826fef5ef833732e9 2013-03-28 fixed table width, supporting rel table width, fixed grid handling
84f1fa190fc2b91d21b685f4d0ea99aaeea26fe0 2013-03-28 WaE: -Wsign-compare
Change-Id: I419636a4d115ef97033b6b2ac0424c66318f0009
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapperTableHandler.cxx')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 9c2d298d4037..a3bdb71b715b 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/RelOrientation.hpp> +#include <com/sun/star/text/SizeType.hpp> #include <dmapperLoggers.hxx> #ifdef DEBUG_DMAPPER_TABLE_HANDLER @@ -328,6 +329,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo sal_Int32 nGapHalf = 0; sal_Int32 nLeftMargin = 0; sal_Int32 nTableWidth = 0; + sal_Int32 nTableWidthType = text::SizeType::FIX; PropertyMap::iterator aTableStyleIter = m_aTableProperties->find( PropertyDefinition( META_PROP_TABLE_STYLE_NAME, false ) ); @@ -460,8 +462,17 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo } m_aTableProperties->getValue( TablePropertyMap::TABLE_WIDTH, nTableWidth ); - if( nTableWidth > 0 ) - m_aTableProperties->Insert( PROP_WIDTH, false, uno::makeAny( nTableWidth )); + m_aTableProperties->getValue( TablePropertyMap::TABLE_WIDTH_TYPE, nTableWidthType ); + if( nTableWidthType == text::SizeType::FIX ) + { + if( nTableWidth > 0 ) + m_aTableProperties->Insert( PROP_WIDTH, false, uno::makeAny( nTableWidth )); + } + else + { + m_aTableProperties->Insert( PROP_RELATIVE_WIDTH, false, uno::makeAny( sal_Int16( nTableWidth ) ) ); + m_aTableProperties->Insert( PROP_IS_WIDTH_RELATIVE, false, uno::makeAny( sal_Bool( sal_True ) ) ); + } sal_Int32 nHoriOrient = text::HoriOrientation::LEFT_AND_WIDTH; m_aTableProperties->getValue( TablePropertyMap::HORI_ORIENT, nHoriOrient ) ; |