diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-01-27 00:04:53 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-01-27 02:37:14 +0100 |
commit | 7bd35614757e4e97913ed9b9d3344f800e8514b2 (patch) | |
tree | 9a444a385c1f9c7daa11ebd460aa5b72b20b7bf3 /sc | |
parent | 6033eaf5b85e01da61628c65ee92292eb2974617 (diff) |
prevent some unnecessary cycles for large cond format ranges
Change-Id: I48f03a897d1ca876bba0d0becf6b51a300970346
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/colorscale.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 558b16c56820..bef5acaf6e44 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -291,9 +291,21 @@ std::vector<double>& ScColorFormat::getValues() const { const ScRange* pRange = aRanges[i]; SCTAB nTab = pRange->aStart.Tab(); - for(SCCOL nCol = pRange->aStart.Col(); nCol <= pRange->aEnd.Col(); ++nCol) + + SCCOL nColStart = pRange->aStart.Col(); + SCROW nRowStart = pRange->aStart.Row(); + SCCOL nColEnd = pRange->aEnd.Col(); + SCROW nRowEnd = pRange->aEnd.Row(); + + if(nRowEnd == MAXROW) + { + bool bShrunk = false; + mpDoc->ShrinkToUsedDataArea(bShrunk, nTab, nColStart, nRowStart, + nColEnd, nRowEnd, false); + } + for(SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol) { - for(SCROW nRow = pRange->aStart.Row(); nRow <= pRange->aEnd.Row(); ++nRow) + for(SCROW nRow = nRowStart; nRow <= nRowEnd; ++nRow) { ScAddress aAddr(nCol, nRow, nTab); CellType eType = mpDoc->GetCellType(aAddr); |