chart2/source/view/main/DataTableView.cxx |   19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 0ce3d7dd14e45bf239d55b63671aa416a0a91fc1
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Thu Aug 11 22:40:27 2022 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Wed Aug 24 20:14:50 2022 +0200

    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 <qui...@gmail.com>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    (cherry picked from commit 5dcfa8f3750d549d895246c50285bb38690f9734)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138602

diff --git a/chart2/source/view/main/DataTableView.cxx 
b/chart2/source/view/main/DataTableView.cxx
index 1fe3b191b878..77d9943ab9ec 100644
--- a/chart2/source/view/main/DataTableView.cxx
+++ b/chart2/source/view/main/DataTableView.cxx
@@ -265,6 +265,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)
     {
@@ -274,13 +276,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);
@@ -304,8 +312,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);
@@ -325,6 +335,7 @@ void DataTableView::createShapes(basegfx::B2DVector const& 
rStart, basegfx::B2DV
         nRow++;
     }
 
+    // TABLE
     nRow = 1;
     for (auto const& rSeries : m_pDataSeriesValues)
     {

Reply via email to