summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-04-15 09:41:10 +0100
committerDavid Tardon <dtardon@redhat.com>2015-04-20 15:52:16 +0000
commit3b6da5e618dd2bd279a7f765cb47d1d0006ff4d5 (patch)
tree3211c9e320e453679b5caace68fcb1dcd071416d
parentd9ca5cc82281b27819ddbaf5e89e05a133adc741 (diff)
fix col limit crash on export of ooo103315-1.ods to xls
Change-Id: Ic68ddc56d9cf9dd410c1f073ba83bfeea8220bf0 (cherry picked from commit cee6eb254fae1012bc6ffe1b2e440fe58fedac1b) Reviewed-on: https://gerrit.libreoffice.org/15317 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 005acacd306f068fc6aabdb3b85987c54727a7da) Reviewed-on: https://gerrit.libreoffice.org/15442 Reviewed-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
-rw-r--r--sc/source/filter/excel/xelink.cxx3
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 ) )
{