diff options
author | Eike Rathke <erack@redhat.com> | 2015-03-13 18:18:57 +0000 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-03-13 18:32:34 +0000 |
commit | 1e060e94629aac8b37d59e34159198aa9e8f4b39 (patch) | |
tree | bf05de31ca82509e07ba63a45b21659cb5d733d7 | |
parent | 7dcaa806b8583224cb24d4a37ddf855b9c02150d (diff) |
add items to ScTableRefToken
Change-Id: I23ddec273f7d3df0d5342b73c54ae411b9ef3782
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 718817611ec2..ca677699a6d6 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -3308,23 +3308,44 @@ bool ScCompiler::IsErrorConstant( const OUString& rName ) const bool ScCompiler::IsTableRefItem( const OUString& rName ) const { + bool bItem = false; OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap()->find( rName)); 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) { case ocTableRefItemAll: + bItem = true; + p->AddItem( ScTableRefToken::ALL); + break; case ocTableRefItemHeaders: + bItem = true; + p->AddItem( ScTableRefToken::HEADERS); + break; case ocTableRefItemData: + bItem = true; + p->AddItem( ScTableRefToken::DATA); + break; case ocTableRefItemTotals: + bItem = true; + p->AddItem( ScTableRefToken::TOTALS); + break; case ocTableRefItemThisRow: - maRawToken.SetOpCode( (*iLook).second ); - return true; + bItem = true; + p->AddItem( ScTableRefToken::THIS_ROW); + break; default: ; } + if (bItem) + maRawToken.SetOpCode( (*iLook).second ); } - return false; + return bItem; } void ScCompiler::SetAutoCorrection( bool bVal ) |