Kaydet (Commit) 1e060e94 authored tarafından Eike Rathke's avatar Eike Rathke

add items to ScTableRefToken

Change-Id: I23ddec273f7d3df0d5342b73c54ae411b9ef3782
üst 7dcaa806
...@@ -3308,23 +3308,44 @@ bool ScCompiler::IsErrorConstant( const OUString& rName ) const ...@@ -3308,23 +3308,44 @@ bool ScCompiler::IsErrorConstant( const OUString& rName ) const
bool ScCompiler::IsTableRefItem( const OUString& rName ) const bool ScCompiler::IsTableRefItem( const OUString& rName ) const
{ {
bool bItem = false;
OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap()->find( rName)); OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap()->find( rName));
if (iLook != mxSymbols->getHashMap()->end()) if (iLook != mxSymbols->getHashMap()->end())
{ {
// Only called when there actually is a current TableRef, hence
// accessing maTableRefs.back() is safe.
ScTableRefToken* p = dynamic_cast<ScTableRefToken*>(maTableRefs.back().mxToken.get());
assert(p); // not a ScTableRefToken can't be
switch ((*iLook).second) switch ((*iLook).second)
{ {
case ocTableRefItemAll: case ocTableRefItemAll:
bItem = true;
p->AddItem( ScTableRefToken::ALL);
break;
case ocTableRefItemHeaders: case ocTableRefItemHeaders:
bItem = true;
p->AddItem( ScTableRefToken::HEADERS);
break;
case ocTableRefItemData: case ocTableRefItemData:
bItem = true;
p->AddItem( ScTableRefToken::DATA);
break;
case ocTableRefItemTotals: case ocTableRefItemTotals:
bItem = true;
p->AddItem( ScTableRefToken::TOTALS);
break;
case ocTableRefItemThisRow: case ocTableRefItemThisRow:
maRawToken.SetOpCode( (*iLook).second ); bItem = true;
return true; p->AddItem( ScTableRefToken::THIS_ROW);
break;
default: default:
; ;
} }
if (bItem)
maRawToken.SetOpCode( (*iLook).second );
} }
return false; return bItem;
} }
void ScCompiler::SetAutoCorrection( bool bVal ) void ScCompiler::SetAutoCorrection( bool bVal )
......
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