diff options
-rw-r--r-- | sc/source/filter/excel/xelink.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index 1f6143f31217..0cf2e9e7fd1d 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1348,7 +1348,8 @@ bool XclExpXct::BuildCrnList( XclExpCrnList& rCrnRecs ) for( SCROW nScRow = nScRow1; bValid && (nScRow <= nScRow2); ++nScRow ) { ::std::pair< SCCOL, SCCOL > aColRange = mxCacheTable->getColRange( nScRow ); - for( SCCOL nScCol = aColRange.first; bValid && (nScCol < aColRange.second); ++nScCol ) + const SCCOL nScEnd = ::std::min( aColRange.second, MAXCOLCOUNT ); + for( SCCOL nScCol = aColRange.first; bValid && (nScCol < nScEnd); ++nScCol ) { if( maUsedCells.IsCellMarked( nScCol, nScRow, true ) ) { |