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

This one too.

Change-Id: Ie0965d1b61d32c943bde3f295e73423008f6b77b
üst 24c5edc8
...@@ -3025,42 +3025,26 @@ bool ScCompiler::IsColRowName( const String& rName ) ...@@ -3025,42 +3025,26 @@ bool ScCompiler::IsColRowName( const String& rName )
nThisTab <= rNameRange.aEnd.Tab()) ) nThisTab <= rNameRange.aEnd.Tab()) )
continue; // for continue; // for
ScCellIterator aIter( pDoc, rNameRange ); ScCellIterator aIter( pDoc, rNameRange );
for ( ScBaseCell* pCell = aIter.GetFirst(); pCell && !bInList; for (bool bHas = aIter.first(); bHas && !bInList; bHas = aIter.next())
pCell = aIter.GetNext() )
{ {
// Don't crash if cell (via CompileNameFormula) encounters // Don't crash if cell (via CompileNameFormula) encounters
// a formula cell without code and // a formula cell without code and
// HasStringData/Interpret/Compile is executed and all that // HasStringData/Interpret/Compile is executed and all that
// recursive.. // recursive..
// Furthermore, *this* cell won't be touched, since no RPN exists yet. // Furthermore, *this* cell won't be touched, since no RPN exists yet.
CellType eType = pCell->GetCellType(); CellType eType = aIter.getType();
bool bOk = ( (eType == CELLTYPE_FORMULA ? bool bOk = false;
((ScFormulaCell*)pCell)->GetCode()->GetCodeLen() > 0 if (eType == CELLTYPE_FORMULA)
&& ((ScFormulaCell*)pCell)->aPos != aPos // noIter
: true ) );
if ( bOk && pCell->HasStringData() )
{ {
String aStr; ScFormulaCell* pFC = aIter.getFormulaCell();
switch ( eType ) bOk = (pFC->GetCode()->GetCodeLen() > 0) && (pFC->aPos != aPos);
{ }
case CELLTYPE_STRING: else
aStr = ((ScStringCell*)pCell)->GetString(); bOk = true;
break;
case CELLTYPE_FORMULA: if (bOk && aIter.hasString())
aStr = ((ScFormulaCell*)pCell)->GetString(); {
break; OUString aStr = aIter.getString();
case CELLTYPE_EDIT:
aStr = ((ScEditCell*)pCell)->GetString();
break;
case CELLTYPE_NONE:
case CELLTYPE_VALUE:
case CELLTYPE_NOTE:
#if OSL_DEBUG_LEVEL > 0
case CELLTYPE_DESTROYED:
#endif
; // nothing, prevent compiler warning
break;
}
if ( ScGlobal::GetpTransliteration()->isEqual( aStr, aName ) ) if ( ScGlobal::GetpTransliteration()->isEqual( aStr, aName ) )
{ {
aRef.InitFlags(); aRef.InitFlags();
......
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