diff options
author | Eike Rathke <erack@redhat.com> | 2015-03-13 16:18:33 +0000 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-03-13 16:24:29 +0000 |
commit | e1fee5ae6e762994737ec80d2fb267d8b956339a (patch) | |
tree | 9be2ac442d455908b7c91ea8001e9fe01320d58c /sc | |
parent | 040cf119d184233971b9cbcc9c5478d9089f9157 (diff) |
TableRef: scan whatever (translated) item name up to the next ']' closer
Change-Id: Ifd18e4dd369a0fbe98da7a7b972c012f5269af3e
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index fd0bf45ecfd8..718817611ec2 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -89,6 +89,7 @@ enum ScanState ssGetReference, ssSkipReference, ssGetErrorConstant, + ssGetTableRefItem, ssStop }; @@ -1985,7 +1986,10 @@ Label_MaskStateMachine: else if( nMask & SC_COMPILER_C_CHAR_ERRCONST ) { *pSym++ = c; - eState = ssGetErrorConstant; + if (!maTableRefs.empty() && maTableRefs.back().mnLevel) + eState = ssGetTableRefItem; + else + eState = ssGetErrorConstant; } else if( nMask & SC_COMPILER_C_CHAR_DONTCARE ) { @@ -2188,6 +2192,26 @@ Label_MaskStateMachine: } } break; + case ssGetTableRefItem: + { + // Scan whatever up to the next ']' closer. + if (c != ']') + { + if( pSym == &cSymbol[ MAXSTRLEN-1 ] ) + { + SetError( errStringOverflow); + eState = ssStop; + } + else + *pSym++ = c; + } + else + { + --pSrc; + eState = ssStop; + } + } + break; case ssGetReference: if( pSym == &cSymbol[ MAXSTRLEN-1 ] ) { |