diff options
author | Eike Rathke <erack@redhat.com> | 2017-05-18 14:59:54 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-05-18 15:02:50 +0200 |
commit | 1469a83ca1d712e30131597d70dad1b3eb322175 (patch) | |
tree | 7354ed4bd79adf5b846d5712004e3e3f7b6e9861 /sc/source/ui/vba/vbarange.cxx | |
parent | 47a0e1554add5cc10c068275697108a663cd7a9a (diff) |
Pass grammar to ScCompiler ctor instead of subsequent SetGrammar()
Not only to have more concise code but also to avoid setting grammar
twice if the actual grammar differs from the document's default one.
Change-Id: I7bfd151c22c48a40aea05f5f983fa0370d9fd9ae
Diffstat (limited to 'sc/source/ui/vba/vbarange.cxx')
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index da37019e66a3..bb4164303798 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -883,8 +883,7 @@ protected: if ( pUnoRangesBase ) { ScRangeList aCellRanges = pUnoRangesBase->GetRangeList(); - ScCompiler aCompiler( m_pDoc, aCellRanges.front()->aStart ); - aCompiler.SetGrammar(m_eGrammar); + ScCompiler aCompiler( m_pDoc, aCellRanges.front()->aStart, m_eGrammar ); // compile the string in the format passed in std::unique_ptr<ScTokenArray> pArray(aCompiler.CompileString(sFormula)); // set desired convention to that of the document @@ -927,8 +926,7 @@ public: pUnoRangesBase ) { ScRangeList aCellRanges = pUnoRangesBase->GetRangeList(); - ScCompiler aCompiler( m_pDoc, aCellRanges.front()->aStart ); - aCompiler.SetGrammar(formula::FormulaGrammar::GRAM_DEFAULT); + ScCompiler aCompiler( m_pDoc, aCellRanges.front()->aStart, formula::FormulaGrammar::GRAM_DEFAULT ); std::unique_ptr<ScTokenArray> pArray(aCompiler.CompileString(sVal)); // set desired convention aCompiler.SetGrammar( m_eGrammar ); |