From 3bfaa277f1a6d78cc5f58f8a1fb510a08c183e50 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 25 Mar 2013 12:15:59 -0400 Subject: Query content cell type directly from ScCellIterator. Change-Id: I0ab93d140f1864ca67ec42d0ac9e133dbc4b6660 --- sc/source/core/tool/chgtrack.cxx | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'sc/source/core/tool/chgtrack.cxx') 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 -- cgit v1.2.3