summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-09-18 14:44:21 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-09-18 14:48:07 +0200
commit2c933f90e3bc056b7094744d1512bd068dbf8d36 (patch)
treeeebe49aa999229577dbf4a3f732a0139bc59d492
parentf5b299e6721bcc67bb1afe4995f2c26b41b6adac (diff)
shrink to used area for duplicate codn format, fdo#54349
Change-Id: Ie0cce19c3ea2132d94a227cd051090573054b369
-rw-r--r--sc/source/core/data/conditio.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 8fddfe5e0590..7f0c2d97b004 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -768,8 +768,21 @@ static bool lcl_IsDuplicate( ScDocument *pDoc, double nArg, const String& rStr,
const ScRange *aRange = rRanges[i];
SCROW nRow = aRange->aEnd.Row();
SCCOL nCol = aRange->aEnd.Col();
- for( SCROW r = aRange->aStart.Row(); r <= nRow; r++ )
- for( SCCOL c = aRange->aStart.Col(); c <= nCol; c++ )
+ SCCOL nColStart = aRange->aStart.Col();
+ SCROW nRowStart = aRange->aEnd.Row();
+ SCTAB nTab = aRange->aStart.Tab();
+
+ // temporary fix to workaorund slow duplicate entry
+ // conditions, prevent to use a whole row
+ if(nRow == MAXROW)
+ {
+ bool bShrunk = false;
+ pDoc->ShrinkToUsedDataArea(bShrunk, nTab, nColStart, nRowStart,
+ nCol, nRow, false);
+ }
+
+ for( SCROW r = nRowStart; r <= nRow; r++ )
+ for( SCCOL c = nColStart; c <= nCol; c++ )
{
double nVal = 0.0;
ScBaseCell *pCell = NULL;