summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-20 18:57:22 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-20 20:58:52 +0200
commit3ccd2a487ab2f2550dc33dd87df045917b0c13c9 (patch)
treef45f6c4d7e972a71cc795248537ba093dd6d6b22 /sc
parent7c10706845e3b2924152c831b35a458078dc274f (diff)
cache calls to size
Change-Id: I7bb009e1250111f1c05c421ecfb5b62a75ab88d0
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/column2.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 57a4e87a2e6b..dba0fc68a841 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1317,22 +1317,23 @@ void ScColumn::FindDataAreaPos(SCROW& rRow, long nMovY) const
if (bThere && maItems[nIndex].pCell->IsBlank())
bThere = false;
+ size_t nLastIndex = maItems.size() - 1;
if (bThere)
{
SCROW nLast = rRow;
SCSIZE nOldIndex = nIndex;
if (bForward)
{
- if (nIndex<maItems.size()-1)
+ if (nIndex<nLastIndex)
{
++nIndex;
- while (nIndex<maItems.size()-1 && maItems[nIndex].nRow==nLast+1
+ while (nIndex<nLastIndex && maItems[nIndex].nRow==nLast+1
&& !maItems[nIndex].pCell->IsBlank())
{
++nIndex;
++nLast;
}
- if (nIndex==maItems.size()-1)
+ if (nIndex==nLastIndex)
if (maItems[nIndex].nRow==nLast+1 && !maItems[nIndex].pCell->IsBlank())
++nLast;
}
@@ -1366,9 +1367,9 @@ void ScColumn::FindDataAreaPos(SCROW& rRow, long nMovY) const
{
if (bForward)
{
- while (nIndex<maItems.size() && maItems[nIndex].pCell->IsBlank())
+ while (nIndex<nLastIndex+1 && maItems[nIndex].pCell->IsBlank())
++nIndex;
- if (nIndex<maItems.size())
+ if (nIndex<nLastIndex+1)
rRow = maItems[nIndex].nRow;
else
rRow = MAXROW;