diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-08-11 22:40:27 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-08-16 08:15:33 +0200 |
commit | 5dcfa8f3750d549d895246c50285bb38690f9734 (patch) | |
tree | b2d8b52ae2d95a5891f30e250b7d4c79a6d78e58 /chart2/source | |
parent | 9d6ffcc0572cc7917651489c69ca4b3452e89a89 (diff) |
chart2: fix rendering of table borders of row/column headers
The row/column headers didn't enable/disable the table borders
correctly when outline was enabled and horizontal and vertical
borders properties were disabled.
Change-Id: Ifcb059dd7d39890bbcaf55d3a68dce41eef586cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138300
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/view/main/DataTableView.cxx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/chart2/source/view/main/DataTableView.cxx b/chart2/source/view/main/DataTableView.cxx index 6f099bccf04c..d80e753d9e65 100644 --- a/chart2/source/view/main/DataTableView.cxx +++ b/chart2/source/view/main/DataTableView.cxx @@ -264,6 +264,8 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV sal_Int32 nColumn; sal_Int32 nRow; + // COLUMN HEADER + nColumn = 1; for (auto const& rString : m_aXValues) { @@ -273,13 +275,19 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV if (xCellTextRange.is()) { xCellTextRange->setString(rString); - bool bLeft = bOutline || (bVBorder && nColumn > 1); - setCellProperties(xPropertySet, bLeft, bOutline, bOutline, bOutline); + + bool bLeft + = (bOutline && nColumn == 1) || (bVBorder && nColumn > 1 && nColumn < nColumnCount); + bool bRight = (bOutline && nColumn == nColumnCount) + || (bVBorder && nColumn > 1 && nColumn < nColumnCount); + setCellProperties(xPropertySet, bLeft, bOutline, bRight, bOutline); setCellCharAndParagraphProperties(xPropertySet); } nColumn++; } + // ROW HEADER + // Prepare keys if (bKeys) { awt::Size aMaxSymbolExtent(300, 300); @@ -302,8 +310,10 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV uno::Reference<text::XTextRange> xCellTextRange(xCell, uno::UNO_QUERY); if (xCellTextRange.is()) { - bool bTop = bOutline || (bHBorder && nRow > 1); - setCellProperties(xCellPropertySet, bOutline, bTop, bOutline, bOutline); + bool bTop = (bOutline && nRow == 1) || (bHBorder && nRow > 1 && nRow < nRowCount); + bool bBottom + = (bOutline && nRow == nRowCount) || (bHBorder && nRow > 1 && nRow < nRowCount); + setCellProperties(xCellPropertySet, bOutline, bTop, bOutline, bBottom); auto xText = xCellTextRange->getText(); xText->insertString(xText->getStart(), rSeriesName, false); @@ -317,11 +327,12 @@ void DataTableView::createShapes(basegfx::B2DVector const& rStart, basegfx::B2DV xCellPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_LEFT)); if (bKeys) - xCellPropertySet->setPropertyValue("ParaLeftMargin", uno::Any(500)); + xCellPropertySet->setPropertyValue("ParaLeftMargin", uno::Any(sal_Int32(500))); } nRow++; } + // TABLE nRow = 1; for (auto const& rSeries : m_pDataSeriesValues) { |