From 1469a83ca1d712e30131597d70dad1b3eb322175 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Thu, 18 May 2017 14:59:54 +0200 Subject: 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 --- sc/source/ui/vba/vbarange.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sc/source/ui/vba/vbarange.cxx') 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 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 pArray(aCompiler.CompileString(sVal)); // set desired convention aCompiler.SetGrammar( m_eGrammar ); -- cgit