[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Sun Feb 9 09:20:04 PST 2014


 sc/source/core/tool/compiler.cxx |   28 ++++++++--------------------
 1 file changed, 8 insertions(+), 20 deletions(-)

New commits:
commit 0b3342e214d2f9edffbdc595de3410cfc96322d4
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sat Feb 8 18:19:42 2014 -0500

    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 at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 4a1bbd7..13b3a85 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()


More information about the Libreoffice-commits mailing list