summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-02-08 18:19:42 -0500
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-02-09 17:19:36 +0000
commit0b3342e214d2f9edffbdc595de3410cfc96322d4 (patch)
tree1ac281b6654d10e5dd642b2ff1c9a8f76b4f8ac2
parentdbb89000146d118ea28f0869d03e121d01e11f04 (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 (cherry picked from commit 83cdcdb9f0fe11309939f5dca4fb46e426559896) Reviewed-on: https://gerrit.libreoffice.org/7947 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/source/core/tool/compiler.cxx28
1 files changed, 8 insertions, 20 deletions
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<OUString>::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<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 ) :
@@ -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<OUString>::iterator it = maTabNames.begin(), itEnd = maTabNames.end();
- for (; it != itEnd; ++it)
- ScCompiler::CheckTabQuotes(*it, formula::FormulaGrammar::extractRefConvention(meGrammar));
- }
- }
}
ScCompiler::~ScCompiler()