Kaydet (Commit) 1714dd65 authored tarafından Eike Rathke's avatar Eike Rathke

TableRef: parse item specifiers

Change-Id: If1419844544be08fa14b6c78c755abba35fff353
üst dbbe0f81
......@@ -381,7 +381,9 @@ public:
// Check if it is a valid english function name
bool IsEnglishSymbol( const OUString& rName );
bool IsErrorConstant( const OUString& ) const;
bool IsTableRefItem( const OUString& ) const;
/**
* When auto correction is set, the jump command reorder must be enabled.
......
......@@ -3282,6 +3282,27 @@ bool ScCompiler::IsErrorConstant( const OUString& rName ) const
return false;
}
bool ScCompiler::IsTableRefItem( const OUString& rName ) const
{
OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap()->find( rName));
if (iLook != mxSymbols->getHashMap()->end())
{
switch ((*iLook).second)
{
case ocTableRefItemAll:
case ocTableRefItemHeaders:
case ocTableRefItemData:
case ocTableRefItemTotals:
case ocTableRefItemThisRow:
maRawToken.SetOpCode( (*iLook).second );
return true;
default:
;
}
}
return false;
}
void ScCompiler::SetAutoCorrection( bool bVal )
{
assert(mbJumpCommandReorder);
......@@ -3596,9 +3617,17 @@ bool ScCompiler::NextNewToken( bool bInArray )
bAsciiUpper = lcl_UpperAsciiOrI18n( aUpper, aOrg, meGrammar);
if (cSymbol[0] == '#')
{
// Check for TableRef item specifiers first.
if (!maTableRefs.empty())
{
if (IsTableRefItem( aUpper ))
return true;
}
// This can be only an error constant, if any.
if (IsErrorConstant( aUpper))
return true;
break; // do; create ocBad token or set error.
}
if (IsOpCode( aUpper, bInArray ))
......
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