sc/source/ui/unoobj/chart2uno.cxx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-)
New commits: commit 83c1260a70b5b440522a1e9b88eb82456896c270 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Dec 4 15:24:20 2017 +0000 assert on export of fdo69698-1.ods to pdf since... commit 3af8a4faf5e20ccae2386052697713da160afb16 Date: Wed Nov 15 13:10:40 2017 +0300 tdf#113861: Less aggressive expansion of chart headers. In this example nAllColCount is 3, nAllRowCount is 5, the columns available are 0, 1, 4 and the rows are 20, 21, 22, 25, 26. So I assume, comparing to the original version, that its not the actual row and column we want, but the index of the row/column into the range provided Change-Id: I568c561a8c5f0b2ee84590293bed8e302d5dda75 Reviewed-on: https://gerrit.libreoffice.org/45811 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit 2074a3785371692dcfb86f45204f3707cbac1eec) Reviewed-on: https://gerrit.libreoffice.org/45944 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 71c3c96f83c0..4728efe7ae3c 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -290,18 +290,24 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount, { //check whether there is more than one text column or row that should be added to the headers SCROW nMaxHeaderRow = nAllRowCount; - for ( const auto & rCol : rCols ) + SCCOL nCol = 0; + for (auto it = rCols.begin(); it != rCols.end(); ++it, ++nCol) { // Skip header columns - if ( rCol.first < nHeaderColCount ) + if (nCol < nHeaderColCount) continue; + const auto& rCol = *it; + bool bFoundValuesInCol = false; bool bFoundAnythingInCol = false; - for ( const auto & rCell : *rCol.second ) + SCROW nRow = 0; + for (auto it2 = rCol.second->begin(); it2 != rCol.second->end(); ++it2, ++nRow) { + const auto& rCell = *it2; + // Skip header rows - if (rCell.first < nHeaderRowCount || !rCell.second) + if (nRow < nHeaderRowCount || !rCell.second) continue; ScRange aRange; @@ -319,7 +325,7 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount, { // Found some numeric data bFoundValuesInCol = true; - nMaxHeaderRow = std::min(nMaxHeaderRow, nRow1); + nMaxHeaderRow = std::min(nMaxHeaderRow, nRow); break; } if ( pDoc->HasData( nCol1, nRow1, nTab1 ) ) @@ -330,11 +336,11 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount, else { // If cell is empty, it belongs to data - nMaxHeaderRow = std::min(nMaxHeaderRow, nRow1); + nMaxHeaderRow = std::min(nMaxHeaderRow, nRow); } } - if (nHeaderColCount && !bFoundValuesInCol && bFoundAnythingInCol && rCol.first == nHeaderColCount) + if (nHeaderColCount && !bFoundValuesInCol && bFoundAnythingInCol && nCol == nHeaderColCount) { // There is no values in row, but some data. And this column is next to header // So lets put it to header
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits