summaryrefslogtreecommitdiffstats
path: root/formula
diff options
context:
space:
mode:
Diffstat (limited to 'formula')
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx14
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 )
{