diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-07-26 16:50:07 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-08-05 14:32:00 +0200 |
commit | df10efed1f8c9864b18bf41ce7b9cc29bbf19760 (patch) | |
tree | 9bfcf000bb4ad8efc71031a283f7a98df736759f /writerfilter | |
parent | 6c6b3795a043f1fb0eec3acc0414015f508c1d57 (diff) |
fdo#66474 DOCX import: fix handling of mixed fixed/auto cell widths
Instead of checking if any cells have fixed width, check if all calls
have fixed with. Regression from
74c5ed19f430327988194cdcd6bdff09591a93fa.
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Change-Id: I58d3d16cbaa2c54a8a1ac309910336c72dcb39b7
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableManager.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index e28c1714e304..527793e0f421 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -135,20 +135,24 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) the final sizing of the table, but then must use the contents of each cell to determine final column widths. (See 17.18.87 of the ISO/IEC 29500-1:2011.) */ - bool bFixed = false; + bool bFixed = true; sal_Int32 nRowFixedWidth = 0; if (!m_aCellWidths.empty()) { - // Step 1. Check whether any cell has fixed width in the given row of table. + // 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 ++) { IntVectorPtr itrVal = (*itr); for (std::vector<sal_Int32>::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 = true; } } } @@ -351,7 +355,10 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) { MeasureHandlerPtr pMeasureHandler(new MeasureHandler()); pProperties->resolve(*pMeasureHandler); - getCurrentCellWidths()->push_back(pMeasureHandler->getMeasureValue()); + if (sal::static_int_cast<Id>(pMeasureHandler->getUnit()) == NS_ooxml::LN_Value_ST_TblWidth_auto) + getCurrentCellWidths()->push_back(sal_Int32(-1)); + else + getCurrentCellWidths()->push_back(pMeasureHandler->getMeasureValue()); if (getTableDepthDifference() > 0) m_bPushCurrentWidth = true; } |