sc/source/ui/view/tabview.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
New commits: commit 668242b1a7acbdd67d5c7a4e479c24933619333e Author: Marco Cecchetti <marco.cecche...@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 <c...@libreoffice.org> Reviewed-by: Marco Cecchetti <mrcek...@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("\" }"); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits