diff options
author | Eike Rathke <erack@redhat.com> | 2015-04-24 16:51:36 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-04-24 17:04:47 +0200 |
commit | 13b9e62d66d1d34dcc66c0f6df592a7129fa3d0a (patch) | |
tree | 46e28d0d20d927ee01a13d4e462a18114d932b17 /formula | |
parent | 9a8d327e023d59ad02378edf4cb9ccf2478fcdf5 (diff) |
TableRef: centralized FormulaCompiler::NeedsTableRefTransformation()
... and include OOXML until we actually write Table.
Change-Id: I95fa65bd593c72af409728cea1ec599481beaaab
Diffstat (limited to 'formula')
-rw-r--r-- | formula/source/core/api/FormulaCompiler.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 515c1fad05b7..dac5283006c8 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -1868,7 +1868,7 @@ const FormulaToken* FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuf case svIndex: CreateStringFromIndex( rBuffer, t ); - if (t->GetOpCode() == ocTableRef && bAllowArrAdvance && mxSymbols->getSymbol( ocTableRefOpen).isEmpty()) + if (t->GetOpCode() == ocTableRef && bAllowArrAdvance && NeedsTableRefTransformation()) { // Suppress all TableRef related tokens, the resulting // range was written by CreateStringFromIndex(). @@ -1989,6 +1989,18 @@ void FormulaCompiler::AppendString( OUStringBuffer& rBuffer, const OUString & rS rBuffer.append( '"'); } +bool FormulaCompiler::NeedsTableRefTransformation() const +{ + /* TODO: currently only UI representations use Table structured + * references. Not defined in ODFF, and not implemented yet for OOXML + * export. Change this once OOXML export is implemented, until then write + * A1 style references also for OOXML to not lose functionality. */ + // Unnecessary to explicitly check for ODFF grammar as the ocTableRefOpen + // symbol is not defined there. + return mxSymbols->getSymbol( ocTableRefOpen).isEmpty() || FormulaGrammar::isPODF( meGrammar) + || FormulaGrammar::isOOXML( meGrammar); +} + void FormulaCompiler::UpdateSeparatorsNative( const OUString& rSep, const OUString& rArrayColSep, const OUString& rArrayRowSep ) { |