summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-04-11 16:35:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-04-12 12:46:13 +0200
commit11e381c527ebd440e4d64d19a5bc27bdc9ea70fc (patch)
tree036b27503ac7084b97bd0d40331f007d9c590409 /sc
parent0b022f7e1a0312ab4db762a198714675cdf65ca8 (diff)
crashtesting: failure on import of tdf90694-1.ots
since... commit 7282014e362a1529a36c88eb308df8ed359c2cfa Date: Fri Feb 1 15:15:16 2019 +0100 tdf#50916 Makes numbers of columns dynamic Change-Id: I7a624f391c85f9c7af07f951c9da3914460b7526 Reviewed-on: https://gerrit.libreoffice.org/70602 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/table1.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index d964642bd498..057398906f47 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -2059,10 +2059,18 @@ void ScTable::MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, d
SCCOL nNewCol = rCol;
while (nMissing > 0 && nNewCol < MAXCOL)
{
- ScRefCellValue aNextCell = aCol[nNewCol+1].GetCellValue(nRow);
- if (!aNextCell.isEmpty())
+ auto nNextCol = nNewCol + 1;
+ bool bNextEmpty = true;
+ if (GetAllocatedColumnsCount() > nNextCol)
+ {
+ ScRefCellValue aNextCell = aCol[nNextCol].GetCellValue(nRow);
+ bNextEmpty = aNextCell.isEmpty();
+ }
+ if (!bNextEmpty)
+ {
// Cell content in a next column ends display of this string.
nMissing = 0;
+ }
else
nMissing -= GetColWidth(++nNewCol);
}