Kaydet (Commit) 2074a378 authored tarafından Caolán McNamara's avatar Caolán McNamara

assert on export of fdo69698-1.ods to pdf

since...

commit 3af8a4fa
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/45811Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 20f985a4
...@@ -290,18 +290,24 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount, ...@@ -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 //check whether there is more than one text column or row that should be added to the headers
SCROW nMaxHeaderRow = nAllRowCount; SCROW nMaxHeaderRow = nAllRowCount;
for ( const auto & rCol : rCols ) SCCOL nCol = 0;
for (auto it = rCols.begin(); it != rCols.end(); ++it, ++nCol)
{ {
// Skip header columns // Skip header columns
if ( rCol.first < nHeaderColCount ) if (nCol < nHeaderColCount)
continue; continue;
const auto& rCol = *it;
bool bFoundValuesInCol = false; bool bFoundValuesInCol = false;
bool bFoundAnythingInCol = 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 // Skip header rows
if (rCell.first < nHeaderRowCount || !rCell.second) if (nRow < nHeaderRowCount || !rCell.second)
continue; continue;
ScRange aRange; ScRange aRange;
...@@ -319,7 +325,7 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount, ...@@ -319,7 +325,7 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount,
{ {
// Found some numeric data // Found some numeric data
bFoundValuesInCol = true; bFoundValuesInCol = true;
nMaxHeaderRow = std::min(nMaxHeaderRow, nRow1); nMaxHeaderRow = std::min(nMaxHeaderRow, nRow);
break; break;
} }
if ( pDoc->HasData( nCol1, nRow1, nTab1 ) ) if ( pDoc->HasData( nCol1, nRow1, nTab1 ) )
...@@ -330,11 +336,11 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount, ...@@ -330,11 +336,11 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount,
else else
{ {
// If cell is empty, it belongs to data // 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 // There is no values in row, but some data. And this column is next to header
// So lets put it to header // So lets put it to header
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment