[Libreoffice-commits] core.git: sc/source

Marco Cecchetti marco.cecchetti at collabora.com
Wed Nov 29 11:40:14 UTC 2017


 sc/source/ui/view/tabview.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 668242b1a7acbdd67d5c7a4e479c24933619333e
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Thu Nov 9 18:56:27 2017 +0100

    lok: sc: subdivide headers data in range
    
    Change-Id: I984b5da5774f97172de7659ecab84675060f8301
    Reviewed-on: https://gerrit.libreoffice.org/44676
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Marco Cecchetti <mrcekets at gmail.com>

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 2fde14330441..fd3464a029cc 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2681,11 +2681,15 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle)
         aBuffer.append("\"size\": \"").append(OUString::number(nTotalPixels * TWIPS_PER_PIXEL)).append("\" }");
     }
 
+    long nPrevSizePx = -1;
     for (SCROW nRow = nStartRow + 1; nRow < nEndRow; ++nRow)
     {
         // nSize will be 0 for hidden rows.
         const long nSizePx = lcl_GetRowHeightPx(pDoc, nRow, nTab);
         nTotalPixels += nSizePx;
+        if (nRow < nEndRow - 1 && nSizePx == nPrevSizePx)
+            continue;
+        nPrevSizePx = nSizePx;
 
         OUString aText = pRowBar[SC_SPLIT_BOTTOM]->GetEntryText(nRow);
         aBuffer.append(", ");
@@ -2788,13 +2792,18 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle)
         aBuffer.append("\"size\": \"").append(OUString::number(nTotalPixels * TWIPS_PER_PIXEL)).append("\" }");
     }
 
+    nPrevSizePx = -1;
     for (SCCOL nCol = nStartCol + 1; nCol < nEndCol; ++nCol)
     {
         // nSize will be 0 for hidden columns.
         const long nSizePx = lcl_GetColWidthPx(pDoc, nCol, nTab);
         nTotalPixels += nSizePx;
+        if (nCol < nEndCol - 1 && nSizePx == nPrevSizePx)
+            continue;
+        nPrevSizePx = nSizePx;
+
 
-        OUString aText = pColBar[SC_SPLIT_LEFT]->GetEntryText(nCol);
+        OUString aText = OUString::number(nCol + 1);
         aBuffer.append(", ");
         aBuffer.append("{ \"text\": \"").append(aText).append("\", ");
         aBuffer.append("\"size\": \"").append(OUString::number(nTotalPixels * TWIPS_PER_PIXEL)).append("\" }");


More information about the Libreoffice-commits mailing list