[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/source
Marco Cecchetti
marco.cecchetti at collabora.com
Tue Nov 28 20:49:17 UTC 2017
sc/source/ui/view/tabview.cxx | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
New commits:
commit f4c6426d28aea11743881906d8179c220fa73b9f
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/45415
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 96f10d6729de..4aef7be67b16 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2674,11 +2674,15 @@ OUString ScTabView::getRowColumnHeaders(const 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(", ");
@@ -2781,13 +2785,18 @@ OUString ScTabView::getRowColumnHeaders(const 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