diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-25 12:15:59 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-26 01:41:19 -0400 |
commit | 3bfaa277f1a6d78cc5f58f8a1fb510a08c183e50 (patch) | |
tree | 623de3c33c04d3e090e23f39924d5d32266aafba /sc/source/core/tool/chgtrack.cxx | |
parent | f74e52fe79692bba8603411246a30fc1bfa55f58 (diff) |
Query content cell type directly from ScCellIterator.
Change-Id: I0ab93d140f1864ca67ec42d0ac9e133dbc4b6660
Diffstat (limited to 'sc/source/core/tool/chgtrack.cxx')
-rw-r--r-- | sc/source/core/tool/chgtrack.cxx | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 7e06debe02b3..655246576780 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -1753,6 +1753,37 @@ ScChangeActionContentCellType ScChangeActionContent::GetContentCellType( const S return SC_CACCT_NONE; } +ScChangeActionContentCellType ScChangeActionContent::GetContentCellType( const ScCellIterator& rIter ) +{ + switch (rIter.getType()) + { + case CELLTYPE_VALUE: + case CELLTYPE_STRING: + case CELLTYPE_EDIT: + return SC_CACCT_NORMAL; + case CELLTYPE_FORMULA: + { + const ScFormulaCell* pCell = rIter.getFormulaCell(); + switch (pCell->GetMatrixFlag()) + { + case MM_NONE : + return SC_CACCT_NORMAL; + case MM_FORMULA : + case MM_FAKE : + return SC_CACCT_MATORG; + case MM_REFERENCE : + return SC_CACCT_MATREF; + default: + ; + } + return SC_CACCT_NORMAL; + } + default: + ; + } + + return SC_CACCT_NONE; +} bool ScChangeActionContent::NeedsNumberFormat( const ScBaseCell* pCell ) { @@ -2657,8 +2688,7 @@ void ScChangeTrack::LookUpContents( const ScRange& rOrgRange, ScCellIterator aIter( pRefDoc, rOrgRange ); for (bool bHas = aIter.first(); bHas; bHas = aIter.next()) { - ScBaseCell* pCell = aIter.getHackedBaseCell(); - if ( ScChangeActionContent::GetContentCellType( pCell ) ) + if (ScChangeActionContent::GetContentCellType(aIter)) { aBigPos.Set( aIter.GetPos().Col() + nDx, aIter.GetPos().Row() + nDy, aIter.GetPos().Tab() + nDz ); @@ -2667,6 +2697,8 @@ void ScChangeTrack::LookUpContents( const ScRange& rOrgRange, { // nicht getrackte Contents aPos.Set( aIter.GetPos().Col() + nDx, aIter.GetPos().Row() + nDy, aIter.GetPos().Tab() + nDz ); + + ScBaseCell* pCell = aIter.getHackedBaseCell(); GenerateDelContent( aPos, pCell, pRefDoc ); //! der Content wird hier _nicht_ per AddContent hinzugefuegt, //! sondern in UpdateReference, um z.B. auch kreuzende Deletes |