diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-02-08 18:19:42 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-02-08 18:21:48 -0500 |
commit | 83cdcdb9f0fe11309939f5dca4fb46e426559896 (patch) | |
tree | 1a4d4140d511f613449485406689754f7b71d950 | |
parent | c4987cd730be2d4aa7c76e69fad4e3195413fb0c (diff) |
fdo#74512: Generate escaped sheet names after the grammer is set.
Otherwise the single quote characters wouldn't be properly doubled.
Change-Id: I864ca8912a35049905e52e002d92d648e1278015
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 8c6dee9d6b92..f8d00f16a4a9 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -238,6 +238,14 @@ void ScCompiler::SetGrammar( const FormulaGrammar::Grammar eGrammar ) if (eMyGrammar != GetGrammar()) SetGrammarAndRefConvention( eMyGrammar, eOldGrammar); } + + if (pDoc && maTabNames.empty()) + { + maTabNames = pDoc->GetAllTableNames(); + std::vector<OUString>::iterator it = maTabNames.begin(), itEnd = maTabNames.end(); + for (; it != itEnd; ++it) + ScCompiler::CheckTabQuotes(*it, formula::FormulaGrammar::extractRefConvention(meGrammar)); + } } void ScCompiler::SetNumberFormatter( SvNumberFormatter* pFormatter ) @@ -1546,16 +1554,6 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos,ScTokenArra mbRewind( false ) { nMaxTab = pDoc ? pDoc->GetTableCount() - 1 : 0; - - if (pDoc) - { - maTabNames = pDoc->GetAllTableNames(); - { - std::vector<OUString>::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 ) : @@ -1589,16 +1587,6 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos) mbRewind( false ) { nMaxTab = pDoc ? pDoc->GetTableCount() - 1 : 0; - - if (pDoc) - { - maTabNames = pDoc->GetAllTableNames(); - { - std::vector<OUString>::iterator it = maTabNames.begin(), itEnd = maTabNames.end(); - for (; it != itEnd; ++it) - ScCompiler::CheckTabQuotes(*it, formula::FormulaGrammar::extractRefConvention(meGrammar)); - } - } } ScCompiler::~ScCompiler() |