summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-06-04 18:46:23 +0300
committerMiklos Vajna <vmiklos@collabora.com>2021-03-05 11:36:46 +0100
commit8f3305936c8c852f36cb7abb2f29f9b6631c032b (patch)
tree9aad6224dd7dad7ee8176b775e4b0f3a3b347e6e
parenttdf#129452 writerfilter: use column, not cell when comparing rows (diff)
downloadcore-8f3305936c8c852f36cb7abb2f29f9b6631c032b.tar.gz
core-8f3305936c8c852f36cb7abb2f29f9b6631c032b.zip
tdf#132898 writerfilter: use last merged cell's bottom border
Previously, this was just using the border set on the first cell. Obviously, the bottom merged cell should contain the definitive setting for the bottom border. This depends on all of the commits for tdf#129452. P.S. The top border is obviously fine defined by the top merged cell. P.S. The left/right borders are a bit more interesting. In MSO, each row's value applies to that section of the merged cell. I.E., it isn't treated as a cell border at all. Only noted as a comment here, since how to deal with it is probably best left as is - defined by the top cell. (cherry picked from commit 03803de58bd426eb0b726437dc205d92383e8e2e) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport15.cxx writerfilter/source/dmapper/DomainMapperTableHandler.cxx Change-Id: Ibe8d31cba5122078ce73020f7816bff0b2ae36c6
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index c0facb42b3dc..4cb518eb29d8 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -850,16 +850,28 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
if ( bMergedVertically )
{
const sal_uInt32 nColumn = m_rDMapper_Impl.getTableManager().findColumn(nRow, nCell);
+ sal_Int32 nLastMergedRow = 0;
for (size_t i = nRow + 1; bMergedVertically && i < m_aCellProperties.size(); i++)
{
const sal_uInt32 nColumnCell = m_rDMapper_Impl.getTableManager().findColumnCell(i, nColumn);
if ( m_aCellProperties[i].size() > sal::static_int_cast<std::size_t>(nColumnCell) )
{
bMergedVertically = bool(m_aCellProperties[i][nColumnCell]->getProperty(PROP_VERTICAL_MERGE));
+ if ( bMergedVertically )
+ nLastMergedRow = i;
}
else
bMergedVertically = false;
}
+
+ // Only consider the bottom border setting from the last merged cell.
+ // Note: in MSO, left/right apply per-unmerged-row. Can't do that in LO, so just using the top cell's borders should be fine.
+ if ( nRow < nLastMergedRow )
+ {
+ (*aCellIterator)->Erase(PROP_BOTTOM_BORDER);
+ const sal_uInt32 nColumnCell = m_rDMapper_Impl.getTableManager().findColumnCell(nLastMergedRow, nColumn);
+ lcl_mergeBorder( PROP_BOTTOM_BORDER, m_aCellProperties[nLastMergedRow][nColumnCell], *aCellIterator );
+ }
}
lcl_computeCellBorders( rInfo.pTableBorders, *aCellIterator, nCell, nRow, bIsEndCol, bIsEndRow, bMergedVertically );