From 0b3342e214d2f9edffbdc595de3410cfc96322d4 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 8 Feb 2014 18:19:42 -0500 Subject: fdo#74512: Generate escaped sheet names after the grammer is set. Otherwise the single quote characters wouldn't be properly doubled. Change-Id: I864ca8912a35049905e52e002d92d648e1278015 (cherry picked from commit 83cdcdb9f0fe11309939f5dca4fb46e426559896) Reviewed-on: https://gerrit.libreoffice.org/7947 Tested-by: Markus Mohrhard Reviewed-by: Markus Mohrhard --- sc/source/core/tool/compiler.cxx | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'sc/source/core/tool') diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 4a1bbd723570..13b3a8509f30 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -239,6 +239,14 @@ void ScCompiler::SetGrammar( const FormulaGrammar::Grammar eGrammar ) if (eMyGrammar != GetGrammar()) SetGrammarAndRefConvention( eMyGrammar, eOldGrammar); } + + if (pDoc && maTabNames.empty()) + { + maTabNames = pDoc->GetAllTableNames(); + std::vector::iterator it = maTabNames.begin(), itEnd = maTabNames.end(); + for (; it != itEnd; ++it) + ScCompiler::CheckTabQuotes(*it, formula::FormulaGrammar::extractRefConvention(meGrammar)); + } } void ScCompiler::SetNumberFormatter( SvNumberFormatter* pFormatter ) @@ -1562,16 +1570,6 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos,ScTokenArra mbRewind( false ) { nMaxTab = pDoc ? pDoc->GetTableCount() - 1 : 0; - - if (pDoc) - { - maTabNames = pDoc->GetAllTableNames(); - { - std::vector::iterator it = maTabNames.begin(), itEnd = maTabNames.end(); - for (; it != itEnd; ++it) - ScCompiler::CheckTabQuotes(*it, formula::FormulaGrammar::extractRefConvention(meGrammar)); - } - } } ScCompiler::ScCompiler( sc::CompileFormulaContext& rCxt, const ScAddress& rPos ) : @@ -1605,16 +1603,6 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos) mbRewind( false ) { nMaxTab = pDoc ? pDoc->GetTableCount() - 1 : 0; - - if (pDoc) - { - maTabNames = pDoc->GetAllTableNames(); - { - std::vector::iterator it = maTabNames.begin(), itEnd = maTabNames.end(); - for (; it != itEnd; ++it) - ScCompiler::CheckTabQuotes(*it, formula::FormulaGrammar::extractRefConvention(meGrammar)); - } - } } ScCompiler::~ScCompiler() -- cgit v1.2.3