diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-22 14:21:25 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-22 21:49:25 -0400 |
commit | 98c408356cffbf48fad596168399143e17321555 (patch) | |
tree | 33cadb7b0f238923f975cbf8f544e85b762b473b /sc/source/ui | |
parent | 73f66a092c16cf96f87cae14442cef8d8fd3a0ae (diff) |
Use ScCellValue instead of ScBaseCell in ScCellIterator.
But of course such migration has to be done in gradual steps. For now,
ScCellIterator supports both methods.
Change-Id: I40cd8969b05598fe20916e43a5537217e824d418
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleCell.cxx | 36 | ||||
-rw-r--r-- | sc/source/ui/app/transobj.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/docshell/tablink.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 1 |
4 files changed, 19 insertions, 20 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index 95ac6ebb2ce2..33a99a1c2826 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -30,8 +30,9 @@ #include "miscuno.hxx" #include "editsrc.hxx" #include "dociter.hxx" -#include "cell.hxx" #include "markdata.hxx" +#include "cellvalue.hxx" +#include "formulaiter.hxx" #include <unotools/accessiblestatesethelper.hxx> #include <com/sun/star/accessibility/AccessibleRole.hpp> @@ -361,43 +362,38 @@ void ScAccessibleCell::FillDependends(utl::AccessibleRelationSetHelper* pRelatio { if (mpDoc) { - ScCellIterator aCellIter( mpDoc, 0,0, maCellAddress.Tab(), MAXCOL,MAXROW, maCellAddress.Tab() ); - ScBaseCell* pCell = aCellIter.GetFirst(); - while (pCell) + ScRange aRange(0, 0, maCellAddress.Tab(), MAXCOL, MAXROW, maCellAddress.Tab()); + ScCellIterator aCellIter(mpDoc, aRange); + + for (bool bHasCell = aCellIter.first(); bHasCell; bHasCell = aCellIter.next()) { - if (pCell->GetCellType() == CELLTYPE_FORMULA) + const ScCellValue& rVal = aCellIter.get(); + if (rVal.meType == CELLTYPE_FORMULA) { - sal_Bool bFound(false); - ScDetectiveRefIter aIter( (ScFormulaCell*) pCell ); + bool bFound = false; + ScDetectiveRefIter aIter(rVal.mpFormula); ScRange aRef; while ( !bFound && aIter.GetNextRef( aRef ) ) { if (aRef.In(maCellAddress)) - bFound = sal_True; + bFound = true; } if (bFound) AddRelation(aCellIter.GetPos(), AccessibleRelationType::CONTROLLER_FOR, pRelationSet); } - pCell = aCellIter.GetNext(); } } } void ScAccessibleCell::FillPrecedents(utl::AccessibleRelationSetHelper* pRelationSet) { - if (mpDoc) + if (mpDoc && mpDoc->GetCellType(maCellAddress) == CELLTYPE_FORMULA) { - ScBaseCell* pBaseCell = mpDoc->GetCell(maCellAddress); - if (pBaseCell && (pBaseCell->GetCellType() == CELLTYPE_FORMULA)) + ScDetectiveRefIter aIter(mpDoc->GetFormulaCell(maCellAddress)); + ScRange aRef; + while ( aIter.GetNextRef( aRef ) ) { - ScFormulaCell* pFCell = (ScFormulaCell*) pBaseCell; - - ScDetectiveRefIter aIter( pFCell ); - ScRange aRef; - while ( aIter.GetNextRef( aRef ) ) - { - AddRelation( aRef, AccessibleRelationType::CONTROLLED_BY, pRelationSet); - } + AddRelation( aRef, AccessibleRelationType::CONTROLLED_BY, pRelationSet); } } } diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 71046f43acb2..b98c05527b2a 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -62,6 +62,7 @@ #include "dociter.hxx" #include "cellsuno.hxx" #include "stringutil.hxx" +#include "formulaiter.hxx" using namespace com::sun::star; diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index a16f51ba1279..9105ee293886 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -42,6 +42,7 @@ #include "dociter.hxx" #include "formula/opcode.hxx" #include "cell.hxx" +#include "formulaiter.hxx" using ::rtl::OUString; diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 4ee76daf2582..a64feb1a448f 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -120,6 +120,7 @@ #include "formula/grammar.hxx" #include "editeng/escapementitem.hxx" #include "stringutil.hxx" +#include "formulaiter.hxx" #include <list> #include <boost/scoped_ptr.hpp> |