diff options
author | Bakos Attila <bakos.attilakaroly@nisz.hu> | 2019-10-28 14:03:11 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-11-04 09:48:37 +0100 |
commit | 44e44239de35c1548809c96e13bfa9d64c7ca441 (patch) | |
tree | 11bca5409e5d68ff38e27b88bbac8cbd8dbeefe6 /writerfilter/source/dmapper | |
parent | f9fb1e1abc2f6326e3c495e11eca7d64f8fdfc27 (diff) |
tdf#120315 DOCX import: fix cells merged vertically
Due to rounding mistake cells weren't merged vertically,
when their horizontal positions are different a little bit.
Change-Id: I10623719a3759b35fcd04b154590b8ac6ec3ac45
Reviewed-on: https://gerrit.libreoffice.org/81604
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter/source/dmapper')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableManager.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 6adbcdc075f7..e09dd45f1642 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -650,7 +650,7 @@ void DomainMapperTableManager::endOfRowAction() } uno::Sequence< text::TableColumnSeparator > aSeparators( m_nCell.back( ) - 1 ); text::TableColumnSeparator* pSeparators = aSeparators.getArray(); - sal_Int16 nLastRelPos = 0; + double nLastRelPos = 0.0; sal_uInt32 nBorderGridIndex = m_nGridBefore; size_t nWidthsBound = m_nCell.back( ) - 1; @@ -666,10 +666,9 @@ void DomainMapperTableManager::endOfRowAction() for ( sal_Int32 nGridCount = *aSpansIter; nGridCount > 0; --nGridCount ) fGridWidth += (*pTableGrid)[nBorderGridIndex++]; - sal_Int16 nRelPos = - sal::static_int_cast< sal_Int16 >((fGridWidth * 10000) / nFullWidthRelative); + double nRelPos = static_cast<double>((fGridWidth * 10000) / nFullWidthRelative); - pSeparators[nBorder].Position = nRelPos + nLastRelPos; + pSeparators[nBorder].Position = sal::static_int_cast< sal_Int16 >( nRelPos + nLastRelPos ); pSeparators[nBorder].IsVisible = true; nLastRelPos = nLastRelPos + nRelPos; ++aSpansIter; |