summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-03-22 19:49:41 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-03-22 21:49:26 -0400
commit2f6b33da43a06ff43bda739c41245761ffdf97fa (patch)
treec03ec0426a59d98793fe94720996f9b4337d98ee /sc/source/ui/unoobj
parent71362fb191d87e918fbf066ce639b0df213bd2a7 (diff)
Re-did ScCellIterator to avoid copying every single iterated cell.
ScCellValue copies the cell value. Let's not use it in ScCellIterator. Change-Id: Id478b607c702077751878f557b8779c98b68db28
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx27
1 files changed, 10 insertions, 17 deletions
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 7bff6ddc2b07..2ff086f2a87b 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -3561,7 +3561,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryEmptyCel
for (bool bHasCell = aIter.first(); bHasCell; bHasCell = aIter.next())
{
// Notizen zaehlen als nicht-leer
- if (!aIter.get().isEmpty())
+ if (!aIter.isEmpty())
aMarkData.SetMultiMarkArea(aIter.GetPos(), false);
}
}
@@ -3597,8 +3597,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC
for (bool bHasCell = aIter.first(); bHasCell; bHasCell = aIter.next())
{
bool bAdd = false;
- const ScCellValue& rVal = aIter.get();
- switch (rVal.meType)
+ switch (aIter.getType())
{
case CELLTYPE_STRING:
if ( nContentFlags & sheet::CellFlags::STRING )
@@ -3677,9 +3676,9 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryFormulaC
ScCellIterator aIter( pDoc, aRange );
for (bool bHasCell = aIter.first(); bHasCell; bHasCell = aIter.next())
{
- if (aIter.get().meType == CELLTYPE_FORMULA)
+ if (aIter.getType() == CELLTYPE_FORMULA)
{
- ScFormulaCell* pFCell = aIter.get().mpFormula;
+ ScFormulaCell* pFCell = aIter.getFormulaCell();
bool bAdd = false;
if (pFCell->GetErrCode())
{
@@ -3737,7 +3736,7 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl(
ScCellIterator aCmpIter( pDoc, aCmpRange );
for (bool bHasCell = aCmpIter.first(); bHasCell; bHasCell = aCmpIter.next())
{
- if (aCmpIter.get().meType != CELLTYPE_NOTE)
+ if (aCmpIter.getType() != CELLTYPE_NOTE)
{
SCCOLROW nCellPos = bColumnDiff ? static_cast<SCCOLROW>(aCmpIter.GetPos().Col()) : static_cast<SCCOLROW>(aCmpIter.GetPos().Row());
if (bColumnDiff)
@@ -3778,17 +3777,13 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl(
ScCellIterator aIter( pDoc, aRange );
for (bool bHasCell = aIter.first(); bHasCell; bHasCell = aIter.next())
{
- const ScCellValue& rCell = aIter.get();
-
if (bColumnDiff)
aCmpAddr = ScAddress( aIter.GetPos().Col(), nCmpPos, aIter.GetPos().Tab() );
else
aCmpAddr = ScAddress( static_cast<SCCOL>(nCmpPos), aIter.GetPos().Row(), aIter.GetPos().Tab() );
- ScCellValue aOtherCell;
- aOtherCell.assign(*pDoc, aCmpAddr);
ScRange aOneRange(aIter.GetPos());
- if (!rCell.equalsWithoutFormat(aOtherCell))
+ if (!aIter.equalsWithoutFormat(aCmpAddr))
aMarkData.SetMultiMarkArea( aOneRange );
else
aMarkData.SetMultiMarkArea( aOneRange, false ); // deselect
@@ -3868,11 +3863,10 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryPreceden
ScCellIterator aIter( pDoc, aRange );
for (bool bHasCell = aIter.first(); bHasCell; bHasCell = aIter.next())
{
- const ScCellValue& rVal = aIter.get();
- if (rVal.meType != CELLTYPE_FORMULA)
+ if (aIter.getType() != CELLTYPE_FORMULA)
continue;
- ScDetectiveRefIter aRefIter(rVal.mpFormula);
+ ScDetectiveRefIter aRefIter(aIter.getFormulaCell());
ScRange aRefRange;
while ( aRefIter.GetNextRef( aRefRange) )
{
@@ -3917,12 +3911,11 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryDependen
ScCellIterator aCellIter( pDoc, 0,0, nTab, MAXCOL,MAXROW, nTab );
for (bool bHasCell = aCellIter.first(); bHasCell; bHasCell = aCellIter.next())
{
- const ScCellValue& rVal = aCellIter.get();
- if (rVal.meType != CELLTYPE_FORMULA)
+ if (aCellIter.getType() != CELLTYPE_FORMULA)
continue;
bool bMark = false;
- ScDetectiveRefIter aIter(rVal.mpFormula);
+ ScDetectiveRefIter aIter(aCellIter.getFormulaCell());
ScRange aRefRange;
while ( aIter.GetNextRef( aRefRange) )
{