Kaydet (Commit) 3bfaa277 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Query content cell type directly from ScCellIterator.

Change-Id: I0ab93d140f1864ca67ec42d0ac9e133dbc4b6660
üst f74e52fe
......@@ -37,6 +37,7 @@
class ScBaseCell;
class ScDocument;
class ScFormulaCell;
class ScCellIterator;
enum ScChangeActionType
{
......@@ -813,6 +814,7 @@ public:
rtl::OUString& rStr, ScDocument* pDoc, bool bFlag3D = false ) const;
static ScChangeActionContentCellType GetContentCellType( const ScBaseCell* );
static ScChangeActionContentCellType GetContentCellType( const ScCellIterator& rIter );
// NewCell
bool IsMatrixOrigin() const;
......
......@@ -245,6 +245,7 @@ public:
OUString getString();
const EditTextObject* getEditText() const;
ScFormulaCell* getFormulaCell();
const ScFormulaCell* getFormulaCell() const;
double getValue() const;
bool hasString() const;
......
......@@ -1102,6 +1102,11 @@ ScFormulaCell* ScCellIterator::getFormulaCell()
return mpCurFormula;
}
const ScFormulaCell* ScCellIterator::getFormulaCell() const
{
return mpCurFormula;
}
double ScCellIterator::getValue() const
{
switch (meCurType)
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment