diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2017-11-09 18:56:27 +0100 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2017-11-29 12:39:43 +0100 |
commit | 668242b1a7acbdd67d5c7a4e479c24933619333e (patch) | |
tree | f2c152b5f75be79f4e1f82e5dba14255bac38e96 /sc/source/ui/view/tabview.cxx | |
parent | 209f48daebfebb6391282a1096e12b0f149ee1ce (diff) |
lok: sc: subdivide headers data in range
Change-Id: I984b5da5774f97172de7659ecab84675060f8301
Reviewed-on: https://gerrit.libreoffice.org/44676
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'sc/source/ui/view/tabview.cxx')
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
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("\" }"); |