diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-22 13:03:23 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-22 21:49:24 -0400 |
commit | 73f66a092c16cf96f87cae14442cef8d8fd3a0ae (patch) | |
tree | 3450fbec2195980e3c7ea1fe08f0b94d6f48a213 /sc | |
parent | bffe8b807ec2ac9e4749360151682591895778fd (diff) |
Simplify ScCellIterator.
Change-Id: I33b10e68434fe0047f8e7c3959b87a51f3460d29
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/dociter.hxx | 18 | ||||
-rw-r--r-- | sc/inc/document.hxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/autonamecache.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/dociter.cxx | 146 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/chgtrack.cxx | 8 | ||||
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 18 | ||||
-rw-r--r-- | sc/source/core/tool/detfunc.cxx | 22 | ||||
-rw-r--r-- | sc/source/core/tool/interpr5.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleCell.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/transobj.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 27 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 3 |
14 files changed, 105 insertions, 154 deletions
diff --git a/sc/inc/dociter.hxx b/sc/inc/dociter.hxx index 36831113e591..c104a33a8186 100644 --- a/sc/inc/dociter.hxx +++ b/sc/inc/dociter.hxx @@ -214,19 +214,14 @@ class ScCellIterator // walk through all cells in an area { // for SubTotal no hidden and no sub-total lines private: ScDocument* pDoc; - SCCOL nStartCol; - SCROW nStartRow; - SCTAB nStartTab; - SCCOL nEndCol; - SCROW nEndRow; - SCTAB nEndTab; - SCCOL nCol; - SCROW nRow; - SCTAB nTab; + ScAddress maStartPos; + ScAddress maEndPos; + ScAddress maCurPos; SCSIZE nColRow; bool bSubTotal; ScBaseCell* GetThis(); + void init(); public: ScCellIterator(ScDocument* pDocument, SCCOL nSCol, SCROW nSRow, SCTAB nSTab, @@ -236,10 +231,7 @@ public: const ScRange& rRange, bool bSTotal = false); ScBaseCell* GetFirst(); ScBaseCell* GetNext(); - SCCOL GetCol() const { return nCol; } - SCROW GetRow() const { return nRow; } - SCTAB GetTab() const { return nTab; } - ScAddress GetPos() const { return ScAddress( nCol, nRow, nTab ); } + const ScAddress& GetPos() const { return maCurPos; } }; class ScQueryCellIterator // walk through all non-empty cells in an area diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index e0f19cdba9a1..742bfc9e7072 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1213,6 +1213,7 @@ public: double& rResult ); SC_DLLPUBLIC const SfxPoolItem* GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich ) const; + SC_DLLPUBLIC const SfxPoolItem* GetAttr( const ScAddress& rPos, sal_uInt16 nWhich ) const; SC_DLLPUBLIC const ScPatternAttr* GetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; SC_DLLPUBLIC const ScPatternAttr* GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, SCROW nEndRow, SCTAB nTab ) const; const ScPatternAttr* GetSelectionPattern( const ScMarkData& rMark, bool bDeep = true ); diff --git a/sc/source/core/data/autonamecache.cxx b/sc/source/core/data/autonamecache.cxx index 4dde59f0ded5..f0e98dc12df5 100644 --- a/sc/source/core/data/autonamecache.cxx +++ b/sc/source/core/data/autonamecache.cxx @@ -84,7 +84,7 @@ const ScAutoNameAddresses& ScAutoNameCache::GetNameOccurrences( const String& rN } if ( ScGlobal::GetpTransliteration()->isEqual( aStr, rName ) ) { - rAddresses.push_back( ScAddress( aIter.GetCol(), aIter.GetRow(), aIter.GetTab() ) ); + rAddresses.push_back(aIter.GetPos()); } } } diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index 33533f64de5a..d5417d5cb5ed 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -940,152 +940,114 @@ ScCellIterator::ScCellIterator( ScDocument* pDocument, SCCOL nSCol, SCROW nSRow, SCTAB nSTab, SCCOL nECol, SCROW nERow, SCTAB nETab, bool bSTotal ) : pDoc( pDocument ), - nStartCol( nSCol), - nStartRow( nSRow), - nStartTab( nSTab ), - nEndCol( nECol ), - nEndRow( nERow), - nEndTab( nETab ), + maStartPos(nSCol, nSRow, nSTab), + maEndPos(nECol, nERow, nETab), + nColRow(0), bSubTotal(bSTotal) - { - SCTAB nDocMaxTab = pDocument->GetTableCount() - 1; - - PutInOrder( nStartCol, nEndCol); - PutInOrder( nStartRow, nEndRow); - PutInOrder( nStartTab, nEndTab ); - - if (!ValidCol(nStartCol)) nStartCol = MAXCOL; - if (!ValidCol(nEndCol)) nEndCol = MAXCOL; - if (!ValidRow(nStartRow)) nStartRow = MAXROW; - if (!ValidRow(nEndRow)) nEndRow = MAXROW; - if (!ValidTab(nStartTab) || nStartTab > nDocMaxTab) nStartTab = nDocMaxTab; - if (!ValidTab(nEndTab) || nEndTab > nDocMaxTab) nEndTab = nDocMaxTab; - - while (nEndTab>0 && !pDoc->maTabs[nEndTab]) - --nEndTab; // Only the tables in use - if (nStartTab>nEndTab) - nStartTab = nEndTab; - - nCol = nStartCol; - nRow = nStartRow; - nTab = nStartTab; - nColRow = 0; // Initialized in GetFirst - - if (!pDoc->maTabs[nTab]) - { - OSL_FAIL("Table not found"); - nStartCol = nCol = MAXCOL+1; - nStartRow = nRow = MAXROW+1; - nStartTab = nTab = MAXTAB+1; // -> Abort on GetFirst - } + init(); } -ScCellIterator::ScCellIterator - ( ScDocument* pDocument, const ScRange& rRange, bool bSTotal ) : +ScCellIterator::ScCellIterator( ScDocument* pDocument, const ScRange& rRange, bool bSTotal ) : pDoc( pDocument ), - nStartCol( rRange.aStart.Col() ), - nStartRow( rRange.aStart.Row() ), - nStartTab( rRange.aStart.Tab() ), - nEndCol( rRange.aEnd.Col() ), - nEndRow( rRange.aEnd.Row() ), - nEndTab( rRange.aEnd.Tab() ), + maStartPos(rRange.aStart), + maEndPos(rRange.aEnd), + nColRow(0), bSubTotal(bSTotal) +{ + init(); +} +void ScCellIterator::init() { - PutInOrder( nStartCol, nEndCol); - PutInOrder( nStartRow, nEndRow); - PutInOrder( nStartTab, nEndTab ); + SCTAB nDocMaxTab = pDoc->GetTableCount() - 1; - if (!ValidCol(nStartCol)) nStartCol = MAXCOL; - if (!ValidCol(nEndCol)) nEndCol = MAXCOL; - if (!ValidRow(nStartRow)) nStartRow = MAXROW; - if (!ValidRow(nEndRow)) nEndRow = MAXROW; - if (!ValidTab(nStartTab)) nStartTab = pDoc->GetTableCount()-1; - if (!ValidTab(nEndTab)) nEndTab = pDoc->GetTableCount()-1; + PutInOrder(maStartPos, maEndPos); - while (nEndTab>0 && !pDoc->maTabs[nEndTab]) - --nEndTab; // Only tables that are in use - if (nStartTab>nEndTab) - nStartTab = nEndTab; + if (!ValidCol(maStartPos.Col())) maStartPos.SetCol(MAXCOL); + if (!ValidCol(maEndPos.Col())) maEndPos.SetCol(MAXCOL); + if (!ValidRow(maStartPos.Row())) maStartPos.SetRow(MAXROW); + if (!ValidRow(maEndPos.Row())) maEndPos.SetRow(MAXROW); + if (!ValidTab(maStartPos.Tab(), nDocMaxTab)) maStartPos.SetTab(nDocMaxTab); + if (!ValidTab(maEndPos.Tab(), nDocMaxTab)) maEndPos.SetTab(nDocMaxTab); - nCol = nStartCol; - nRow = nStartRow; - nTab = nStartTab; - nColRow = 0; // Initialized in GetFirst + while (maEndPos.Tab() > 0 && !pDoc->maTabs[maEndPos.Tab()]) + maEndPos.IncTab(-1); // Only the tables in use - if (!pDoc->maTabs[nTab]) + if (maStartPos.Tab() > maEndPos.Tab()) + maStartPos.SetTab(maEndPos.Tab()); + + maCurPos = maStartPos; + + if (!pDoc->maTabs[maCurPos.Tab()]) { OSL_FAIL("Table not found"); - nStartCol = nCol = MAXCOL+1; - nStartRow = nRow = MAXROW+1; - nStartTab = nTab = MAXTAB+1; // -> Abort on GetFirst + maStartPos = ScAddress(MAXCOL+1, MAXROW+1, MAXTAB+1); // -> Abort on GetFirst. + maCurPos = maStartPos; } } ScBaseCell* ScCellIterator::GetThis() { - - ScColumn* pCol = &(pDoc->maTabs[nTab])->aCol[nCol]; + ScColumn* pCol = &(pDoc->maTabs[maCurPos.Tab()])->aCol[maCurPos.Col()]; for ( ;; ) { - if ( nRow > nEndRow ) + if (maCurPos.Row() > maEndPos.Row()) { - nRow = nStartRow; + maCurPos.SetRow(maStartPos.Row()); do { - nCol++; - if ( nCol > nEndCol ) + maCurPos.IncCol(); + if (maCurPos.Col() > maEndPos.Col()) { - nCol = nStartCol; - nTab++; - if ( nTab > nEndTab ) + maCurPos.SetCol(maStartPos.Col()); + maCurPos.IncTab(); + if (maCurPos.Tab() > maEndPos.Tab()) return NULL; // Over and out } - pCol = &(pDoc->maTabs[nTab])->aCol[nCol]; + pCol = &(pDoc->maTabs[maCurPos.Tab()])->aCol[maCurPos.Col()]; } while ( pCol->maItems.empty() ); - pCol->Search( nRow, nColRow ); + pCol->Search(maCurPos.Row(), nColRow); } - while ( (nColRow < pCol->maItems.size()) && (pCol->maItems[nColRow].nRow < nRow) ) - nColRow++; + while ( (nColRow < pCol->maItems.size()) && (pCol->maItems[nColRow].nRow < maCurPos.Row()) ) + ++nColRow; - if ( nColRow < pCol->maItems.size() && pCol->maItems[nColRow].nRow <= nEndRow ) + if (nColRow < pCol->maItems.size() && pCol->maItems[nColRow].nRow <= maEndPos.Row()) { - nRow = pCol->maItems[nColRow].nRow; - if ( !bSubTotal || !pDoc->maTabs[nTab]->RowFiltered( nRow ) ) + maCurPos.SetRow(pCol->maItems[nColRow].nRow); + if (!bSubTotal || !pDoc->maTabs[maCurPos.Tab()]->RowFiltered(maCurPos.Row())) { ScBaseCell* pCell = pCol->maItems[nColRow].pCell; if ( bSubTotal && pCell->GetCellType() == CELLTYPE_FORMULA && ((ScFormulaCell*)pCell)->IsSubTotal() ) - nRow++; // Don't subtotal rows + maCurPos.IncRow(); // Don't subtotal rows else return pCell; // Found it! } else - nRow++; + maCurPos.IncRow(); } else - nRow = nEndRow + 1; // Next column + maCurPos.SetRow(maEndPos.Row() + 1); // Next column } } ScBaseCell* ScCellIterator::GetFirst() { - if ( !ValidTab(nTab) ) + if ( !ValidTab(maCurPos.Tab()) ) return NULL; - nCol = nStartCol; - nRow = nStartRow; - nTab = nStartTab; - ScColumn* pCol = &(pDoc->maTabs[nTab])->aCol[nCol]; - pCol->Search( nRow, nColRow ); + + maCurPos = maStartPos; + ScColumn* pCol = &(pDoc->maTabs[maCurPos.Tab()])->aCol[maCurPos.Col()]; + pCol->Search(maCurPos.Row(), nColRow); return GetThis(); } ScBaseCell* ScCellIterator::GetNext() { - ++nRow; + maCurPos.IncRow(); return GetThis(); } diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 7064ee2ddb60..dcdb2abc35d6 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -4286,6 +4286,10 @@ const SfxPoolItem* ScDocument::GetAttr( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_ return &xPoolHelper->GetDocPool()->GetDefaultItem( nWhich ); } +const SfxPoolItem* ScDocument::GetAttr( const ScAddress& rPos, sal_uInt16 nWhich ) const +{ + return GetAttr(rPos.Col(), rPos.Row(), rPos.Tab(), nWhich); +} const ScPatternAttr* ScDocument::GetPattern( SCCOL nCol, SCROW nRow, SCTAB nTab ) const { diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 68c7a05877c0..652c1320c8ea 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -2660,13 +2660,13 @@ void ScChangeTrack::LookUpContents( const ScRange& rOrgRange, { if ( ScChangeActionContent::GetContentCellType( pCell ) ) { - aBigPos.Set( aIter.GetCol() + nDx, aIter.GetRow() + nDy, - aIter.GetTab() + nDz ); + aBigPos.Set( aIter.GetPos().Col() + nDx, aIter.GetPos().Row() + nDy, + aIter.GetPos().Tab() + nDz ); ScChangeActionContent* pContent = SearchContentAt( aBigPos, NULL ); if ( !pContent ) { // nicht getrackte Contents - aPos.Set( aIter.GetCol() + nDx, aIter.GetRow() + nDy, - aIter.GetTab() + nDz ); + aPos.Set( aIter.GetPos().Col() + nDx, aIter.GetPos().Row() + nDy, + aIter.GetPos().Tab() + nDz ); GenerateDelContent( aPos, pCell, pRefDoc ); //! der Content wird hier _nicht_ per AddContent hinzugefuegt, //! sondern in UpdateReference, um z.B. auch kreuzende Deletes diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 931bf1cb118d..a9857e2b83e0 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -3065,9 +3065,9 @@ bool ScCompiler::IsColRowName( const String& rName ) if ( ScGlobal::GetpTransliteration()->isEqual( aStr, aName ) ) { aRef.InitFlags(); - aRef.nCol = aIter.GetCol(); - aRef.nRow = aIter.GetRow(); - aRef.nTab = aIter.GetTab(); + aRef.nCol = aIter.GetPos().Col(); + aRef.nRow = aIter.GetPos().Row(); + aRef.nTab = aIter.GetPos().Tab(); if ( !jRow ) aRef.SetColRel( true ); // ColName else @@ -3159,7 +3159,7 @@ bool ScCompiler::IsColRowName( const String& rName ) { if ( bFound ) { // stop if everything else is further away - if ( nMax < (long)aIter.GetCol() ) + if ( nMax < (long)aIter.GetPos().Col() ) break; // aIter } CellType eType = pCell->GetCellType(); @@ -3193,8 +3193,8 @@ bool ScCompiler::IsColRowName( const String& rName ) } if ( ScGlobal::GetpTransliteration()->isEqual( aStr, aName ) ) { - SCCOL nCol = aIter.GetCol(); - SCROW nRow = aIter.GetRow(); + SCCOL nCol = aIter.GetPos().Col(); + SCROW nRow = aIter.GetPos().Row(); long nC = nMyCol - nCol; long nR = nMyRow - nRow; if ( bFound ) @@ -3205,7 +3205,7 @@ bool ScCompiler::IsColRowName( const String& rName ) if ( nC < 0 || nR < 0 ) { // right or below bTwo = true; - aTwo.Set( nCol, nRow, aIter.GetTab() ); + aTwo.Set( nCol, nRow, aIter.GetPos().Tab() ); nMax = Max( nMyCol + Abs( nC ), nMyRow + Abs( nR ) ); nDistance = nD; } @@ -3215,7 +3215,7 @@ bool ScCompiler::IsColRowName( const String& rName ) // current entry and nMyRow is below (CellIter // runs column-wise) bTwo = false; - aOne.Set( nCol, nRow, aIter.GetTab() ); + aOne.Set( nCol, nRow, aIter.GetPos().Tab() ); nMax = Max( nMyCol + nC, nMyRow + nR ); nDistance = nD; } @@ -3223,7 +3223,7 @@ bool ScCompiler::IsColRowName( const String& rName ) } else { - aOne.Set( nCol, nRow, aIter.GetTab() ); + aOne.Set( nCol, nRow, aIter.GetPos().Tab() ); nDistance = nC * nC + nR * nR; nMax = Max( nMyCol + Abs( nC ), nMyRow + Abs( nR ) ); } diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index 612ffbd22dbb..359e95eac13e 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -306,7 +306,7 @@ sal_Bool ScDetectiveFunc::HasError( const ScRange& rRange, ScAddress& rErrPos ) { nError = ((ScFormulaCell*)pCell)->GetErrCode(); if (nError) - rErrPos.Set( aCellIter.GetCol(), aCellIter.GetRow(), aCellIter.GetTab() ); + rErrPos = aCellIter.GetPos(); } pCell = aCellIter.GetNext(); } @@ -796,7 +796,7 @@ sal_uInt16 ScDetectiveFunc::InsertPredLevelArea( const ScRange& rRef, while (pCell) { if (pCell->GetCellType() == CELLTYPE_FORMULA) - switch( InsertPredLevel( aCellIter.GetCol(), aCellIter.GetRow(), rData, nLevel ) ) + switch( InsertPredLevel( aCellIter.GetPos().Col(), aCellIter.GetPos().Row(), rData, nLevel ) ) { case DET_INS_INSERTED: nResult = DET_INS_INSERTED; @@ -897,7 +897,7 @@ sal_uInt16 ScDetectiveFunc::FindPredLevelArea( const ScRange& rRef, { if (pCell->GetCellType() == CELLTYPE_FORMULA) { - sal_uInt16 nTemp = FindPredLevel( aCellIter.GetCol(), aCellIter.GetRow(), nLevel, nDeleteLevel ); + sal_uInt16 nTemp = FindPredLevel( aCellIter.GetPos().Col(), aCellIter.GetPos().Row(), nLevel, nDeleteLevel ); if (nTemp > nResult) nResult = nTemp; } @@ -1056,12 +1056,12 @@ sal_uInt16 ScDetectiveFunc::InsertSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCo aRef.aStart.Col(),aRef.aStart.Row(), aRef.aEnd.Col(),aRef.aEnd.Row() )) { - sal_Bool bAlien = ( aCellIter.GetTab() != nTab ); + sal_Bool bAlien = ( aCellIter.GetPos().Tab() != nTab ); sal_Bool bDrawRet; if (bAlien) bDrawRet = DrawAlienEntry( aRef, rData ); else - bDrawRet = DrawEntry( aCellIter.GetCol(), aCellIter.GetRow(), + bDrawRet = DrawEntry( aCellIter.GetPos().Col(), aCellIter.GetPos().Row(), aRef, rData ); if (bDrawRet) { @@ -1081,8 +1081,8 @@ sal_uInt16 ScDetectiveFunc::InsertSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCo if ( nLevel < rData.GetMaxLevel() ) { sal_uInt16 nSubResult = InsertSuccLevel( - aCellIter.GetCol(), aCellIter.GetRow(), - aCellIter.GetCol(), aCellIter.GetRow(), + aCellIter.GetPos().Col(), aCellIter.GetPos().Row(), + aCellIter.GetPos().Col(), aCellIter.GetPos().Row(), rData, nLevel+1 ); switch (nSubResult) { @@ -1158,10 +1158,10 @@ sal_uInt16 ScDetectiveFunc::FindSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2 } else if ( !bRunning && HasArrow( aRef.aStart, - aCellIter.GetCol(),aCellIter.GetRow(),aCellIter.GetTab() ) ) + aCellIter.GetPos().Col(),aCellIter.GetPos().Row(),aCellIter.GetPos().Tab() ) ) { - sal_uInt16 nTemp = FindSuccLevel( aCellIter.GetCol(), aCellIter.GetRow(), - aCellIter.GetCol(), aCellIter.GetRow(), + sal_uInt16 nTemp = FindSuccLevel( aCellIter.GetPos().Col(), aCellIter.GetPos().Row(), + aCellIter.GetPos().Col(), aCellIter.GetPos().Row(), nLevel+1, nDeleteLevel ); if (nTemp > nResult) nResult = nTemp; @@ -1365,7 +1365,7 @@ sal_Bool ScDetectiveFunc::MarkInvalid(sal_Bool& rOverflow) ScBaseCell* pCell = aCellIter.GetFirst(); while ( pCell && nInsCount < SC_DET_MAXCIRCLE ) { - SCROW nCellRow = aCellIter.GetRow(); + SCROW nCellRow = aCellIter.GetPos().Row(); if ( bMarkEmpty ) for ( nRow = nNextRow; nRow < nCellRow && nInsCount < SC_DET_MAXCIRCLE; nRow++ ) { diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 065e7a9ba18d..7a716ed0f71a 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -426,7 +426,7 @@ ScMatrixRef ScInterpreter::CreateMatrixFromDoubleRef( const FormulaToken* pToken // an array to the matrix object, for performance reasons. for (ScBaseCell* pCell = aCellIter.GetFirst(); pCell; pCell = aCellIter.GetNext(), nPrevRow = nThisRow) { - nThisRow = aCellIter.GetRow(); + nThisRow = aCellIter.GetPos().Row(); if (HasCellEmptyData(pCell)) { diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index eadf4b239b4a..95ac6ebb2ce2 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -376,7 +376,7 @@ void ScAccessibleCell::FillDependends(utl::AccessibleRelationSetHelper* pRelatio bFound = sal_True; } if (bFound) - AddRelation(ScAddress(aCellIter.GetCol(), aCellIter.GetRow(), aCellIter.GetTab()), AccessibleRelationType::CONTROLLER_FOR, pRelationSet); + AddRelation(aCellIter.GetPos(), AccessibleRelationType::CONTROLLER_FOR, pRelationSet); } pCell = aCellIter.GetNext(); } diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 880719548b34..71046f43acb2 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -795,8 +795,8 @@ void ScTransferObj::StripRefs( ScDocument* pDoc, } if (bOut) { - SCCOL nCol = aIter.GetCol() - nSubX; - SCROW nRow = aIter.GetRow() - nSubY; + SCCOL nCol = aIter.GetPos().Col() - nSubX; + SCROW nRow = aIter.GetPos().Row() - nSubY; sal_uInt16 nErrCode = pFCell->GetErrCode(); ScAddress aPos(nCol, nRow, nDestTab); diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index f67b2cd9128c..a73b238fdcfa 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1184,7 +1184,7 @@ bool lcl_EmptyExcept( ScDocument* pDoc, const ScRange& rRange, const ScRange& rE { if ( !pCell->IsBlank() ) // real content? { - if ( !rExcept.In( ScAddress( aIter.GetCol(), aIter.GetRow(), aIter.GetTab() ) ) ) + if (!rExcept.In(aIter.GetPos())) return false; // cell found } pCell = aIter.GetNext(); diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 04e7dec72bba..4ee76daf2582 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -3562,9 +3562,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryEmptyCel { // Notizen zaehlen als nicht-leer if ( !pCell->IsBlank() ) - aMarkData.SetMultiMarkArea( - ScRange( aIter.GetCol(), aIter.GetRow(), aIter.GetTab() ), - false ); + aMarkData.SetMultiMarkArea(aIter.GetPos(), false); pCell = aIter.GetNext(); } @@ -3625,8 +3623,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC // Date/Time Erkennung sal_uLong nIndex = (sal_uLong)((SfxUInt32Item*)pDoc->GetAttr( - aIter.GetCol(), aIter.GetRow(), aIter.GetTab(), - ATTR_VALUE_FORMAT ))->GetValue(); + aIter.GetPos(), ATTR_VALUE_FORMAT))->GetValue(); short nTyp = pDoc->GetFormatTable()->GetType(nIndex); if ((nTyp == NUMBERFORMAT_DATE) || (nTyp == NUMBERFORMAT_TIME) || (nTyp == NUMBERFORMAT_DATETIME)) @@ -3648,9 +3645,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC } if (bAdd) - aMarkData.SetMultiMarkArea( - ScRange( aIter.GetCol(), aIter.GetRow(), aIter.GetTab() ), - sal_True ); + aMarkData.SetMultiMarkArea(aIter.GetPos(), true); pCell = aIter.GetNext(); } @@ -3708,9 +3703,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryFormulaC } if (bAdd) - aMarkData.SetMultiMarkArea( - ScRange( aIter.GetCol(), aIter.GetRow(), aIter.GetTab() ), - sal_True ); + aMarkData.SetMultiMarkArea(aIter.GetPos(), true); } pCell = aIter.GetNext(); @@ -3754,7 +3747,7 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl( { if (pCmpCell->GetCellType() != CELLTYPE_NOTE) { - SCCOLROW nCellPos = bColumnDiff ? static_cast<SCCOLROW>(aCmpIter.GetCol()) : static_cast<SCCOLROW>(aCmpIter.GetRow()); + SCCOLROW nCellPos = bColumnDiff ? static_cast<SCCOLROW>(aCmpIter.GetPos().Col()) : static_cast<SCCOLROW>(aCmpIter.GetPos().Row()); if (bColumnDiff) aCellRange = ScRange( static_cast<SCCOL>(nCellPos),0,nTab, static_cast<SCCOL>(nCellPos),MAXROW,nTab ); @@ -3796,12 +3789,12 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl( while (pCell) { if (bColumnDiff) - aCmpAddr = ScAddress( aIter.GetCol(), nCmpPos, aIter.GetTab() ); + aCmpAddr = ScAddress( aIter.GetPos().Col(), nCmpPos, aIter.GetPos().Tab() ); else - aCmpAddr = ScAddress( static_cast<SCCOL>(nCmpPos), aIter.GetRow(), aIter.GetTab() ); + aCmpAddr = ScAddress( static_cast<SCCOL>(nCmpPos), aIter.GetPos().Row(), aIter.GetPos().Tab() ); const ScBaseCell* pOtherCell = pDoc->GetCell( aCmpAddr ); - ScRange aOneRange( aIter.GetCol(), aIter.GetRow(), aIter.GetTab() ); + ScRange aOneRange(aIter.GetPos()); if ( !ScBaseCell::CellEqual( pCell, pOtherCell ) ) aMarkData.SetMultiMarkArea( aOneRange ); else @@ -3954,9 +3947,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryDependen } if (bMark) { - ScRange aCellRange( aCellIter.GetCol(), - aCellIter.GetRow(), - aCellIter.GetTab() ); + ScRange aCellRange(aCellIter.GetPos()); if ( bRecursive && !bFound && !aMarkData.IsAllMarked( aCellRange ) ) bFound = sal_True; aMarkData.SetMultiMarkArea( aCellRange, sal_True ); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 8cea62d9fc57..1283ddd045ad 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -831,7 +831,8 @@ sal_uInt8 ScViewFunc::GetSelectionScriptType() ScBaseCell* pCell = aIter.GetFirst(); while ( pCell ) { - nScript |= pDoc->GetScriptType( aIter.GetCol(), aIter.GetRow(), aIter.GetTab(), pCell ); + nScript |= pDoc->GetScriptType( + aIter.GetPos().Col(), aIter.GetPos().Row(), aIter.GetPos().Tab(), pCell); pCell = aIter.GetNext(); } } |