Kaydet (Commit) 2460b39d authored tarafından Kohei Yoshida's avatar Kohei Yoshida

ScBaseCell::CellEqual is no more.

Change-Id: I9a2923ec85ce116662d66a38b61a5258ff113168
üst b9079dc2
......@@ -100,8 +100,6 @@ public:
bool HasStringData() const;
rtl::OUString GetStringData() const; // only real strings
static bool CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 );
private:
ScBaseCell& operator=( const ScBaseCell& );
......
......@@ -345,86 +345,6 @@ rtl::OUString ScBaseCell::GetStringData() const
return aStr;
}
bool ScBaseCell::CellEqual( const ScBaseCell* pCell1, const ScBaseCell* pCell2 )
{
CellType eType1 = CELLTYPE_NONE;
CellType eType2 = CELLTYPE_NONE;
if ( pCell1 )
{
eType1 = pCell1->GetCellType();
if (eType1 == CELLTYPE_EDIT)
eType1 = CELLTYPE_STRING;
else if (eType1 == CELLTYPE_NOTE)
eType1 = CELLTYPE_NONE;
}
if ( pCell2 )
{
eType2 = pCell2->GetCellType();
if (eType2 == CELLTYPE_EDIT)
eType2 = CELLTYPE_STRING;
else if (eType2 == CELLTYPE_NOTE)
eType2 = CELLTYPE_NONE;
}
if ( eType1 != eType2 )
return false;
switch ( eType1 ) // Both Types are the same
{
case CELLTYPE_NONE: // Both Empty
return true;
case CELLTYPE_VALUE: // Really Value-Cells
return ( ((const ScValueCell*)pCell1)->GetValue() ==
((const ScValueCell*)pCell2)->GetValue() );
case CELLTYPE_STRING: // String or Edit
{
rtl::OUString aText1;
if ( pCell1->GetCellType() == CELLTYPE_STRING )
aText1 = ((const ScStringCell*)pCell1)->GetString();
else
aText1 = ((const ScEditCell*)pCell1)->GetString();
rtl::OUString aText2;
if ( pCell2->GetCellType() == CELLTYPE_STRING )
aText2 = ((const ScStringCell*)pCell2)->GetString();
else
aText2 = ((const ScEditCell*)pCell2)->GetString();
return ( aText1 == aText2 );
}
case CELLTYPE_FORMULA:
{
//! pasted Lines / allow Slots!!!!!
//! Comparsion Function of the Formula Cell???
//! To request with ScColumn::SwapRow to catch together!
ScTokenArray* pCode1 = ((ScFormulaCell*)pCell1)->GetCode();
ScTokenArray* pCode2 = ((ScFormulaCell*)pCell2)->GetCode();
if (pCode1->GetLen() == pCode2->GetLen()) // nicht-UPN
{
bool bEqual = true;
sal_uInt16 nLen = pCode1->GetLen();
FormulaToken** ppToken1 = pCode1->GetArray();
FormulaToken** ppToken2 = pCode2->GetArray();
for (sal_uInt16 i=0; i<nLen; i++)
if ( !ppToken1[i]->TextEqual(*(ppToken2[i])) )
{
bEqual = false;
break;
}
if (bEqual)
return true;
}
return false; // varying long or varying Tokens
}
default:
OSL_FAIL("oops, something for the Cells???");
}
return false;
}
// ============================================================================
ScNoteCell::ScNoteCell( SvtBroadcaster* pBC ) :
ScBaseCell( CELLTYPE_NOTE )
{
......
......@@ -790,18 +790,18 @@ sal_uInt16 ScDocument::RowDifferences( SCROW nThisRow, SCTAB nThisTab,
if (ValidCol(nOtherCol)) // nur Spalten vergleichen, die in beiden Dateien sind
{
const ScBaseCell* pThisCell = GetCell( ScAddress( nThisCol, nThisRow, nThisTab ) );
const ScBaseCell* pOtherCell = rOtherDoc.GetCell( ScAddress( nOtherCol, nOtherRow, nOtherTab ) );
if (!ScBaseCell::CellEqual( pThisCell, pOtherCell ))
ScRefCellValue aThisCell, aOtherCell;
aThisCell.assign(*this, ScAddress(nThisCol, nThisRow, nThisTab));
aOtherCell.assign(rOtherDoc, ScAddress(nOtherCol, nOtherRow, nOtherTab));
if (!aThisCell.equalsWithoutFormat(aOtherCell))
{
if ( pThisCell && pOtherCell )
if (!aThisCell.isEmpty() && !aOtherCell.isEmpty())
nDif += 3;
else
nDif += 4; // Inhalt <-> leer zaehlt mehr
}
if ( ( pThisCell && pThisCell->GetCellType()!=CELLTYPE_NOTE ) ||
( pOtherCell && pOtherCell->GetCellType()!=CELLTYPE_NOTE ) )
if (!aThisCell.isEmpty() || !aOtherCell.isEmpty())
++nUsed;
}
}
......@@ -831,18 +831,18 @@ sal_uInt16 ScDocument::ColDifferences( SCCOL nThisCol, SCTAB nThisTab,
if (ValidRow(nOtherRow)) // nur Zeilen vergleichen, die in beiden Dateien sind
{
const ScBaseCell* pThisCell = GetCell( ScAddress( nThisCol, nThisRow, nThisTab ) );
const ScBaseCell* pOtherCell = rOtherDoc.GetCell( ScAddress( nOtherCol, nOtherRow, nOtherTab ) );
if (!ScBaseCell::CellEqual( pThisCell, pOtherCell ))
ScRefCellValue aThisCell, aOtherCell;
aThisCell.assign(*this, ScAddress(nThisCol, nThisRow, nThisTab));
aOtherCell.assign(rOtherDoc, ScAddress(nOtherCol, nOtherRow, nOtherTab));
if (!aThisCell.equalsWithoutFormat(aOtherCell))
{
if ( pThisCell && pOtherCell )
if (!aThisCell.isEmpty() && !aOtherCell.isEmpty())
nDif += 3;
else
nDif += 4; // Inhalt <-> leer zaehlt mehr
}
if ( ( pThisCell && pThisCell->GetCellType()!=CELLTYPE_NOTE ) ||
( pOtherCell && pOtherCell->GetCellType()!=CELLTYPE_NOTE ) )
if (!aThisCell.isEmpty() || !aOtherCell.isEmpty())
++nUsed;
}
}
......
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