summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-07-26 16:50:07 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-07-26 17:33:02 +0200
commit67163f5531c29ff1983661ba832bd205944b33f3 (patch)
treee46ab0d09e9d07e6982b8912fbbf3562448d517f /writerfilter
parent4a1c808b95c9a62f6ecf8ae3c20218ef85a9261e (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. Change-Id: I58d3d16cbaa2c54a8a1ac309910336c72dcb39b7
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 739d3e74a648..c5c9ce0ff1e6 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -140,20 +140,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;
}
}
}
@@ -368,7 +372,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;
}