summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-06-04 18:46:23 +0300
committerJustin Luth <justin_luth@sil.org>2020-07-16 18:42:29 +0200
commit03803de58bd426eb0b726437dc205d92383e8e2e (patch)
tree48982f42592c45d2e94a5ca0225c49c336ce4447 /writerfilter/source
parent56b04e40ab72b6333ce278ba2980650f5272025f (diff)
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. Change-Id: Ibe8d31cba5122078ce73020f7816bff0b2ae36c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95528 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter/source')
-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 2046d36db613..b56323bd3190 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -912,6 +912,7 @@ 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);
@@ -919,10 +920,21 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl
{
oProp = m_aCellProperties[i][nColumnCell]->getProperty(PROP_VERTICAL_MERGE);
bMergedVertically = oProp && !oProp->second.get<bool>(); //continuing cell
+ 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 );