summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/vbaname.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-05-18 14:59:54 +0200
committerEike Rathke <erack@redhat.com>2017-05-18 15:02:50 +0200
commit1469a83ca1d712e30131597d70dad1b3eb322175 (patch)
tree7354ed4bd79adf5b846d5712004e3e3f7b6e9861 /sc/source/ui/vba/vbaname.cxx
parent47a0e1554add5cc10c068275697108a663cd7a9a (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/vbaname.cxx')
-rw-r--r--sc/source/ui/vba/vbaname.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/sc/source/ui/vba/vbaname.cxx b/sc/source/ui/vba/vbaname.cxx
index 6e6e86e9ac4b..dd0f2cd88344 100644
--- a/sc/source/ui/vba/vbaname.cxx
+++ b/sc/source/ui/vba/vbaname.cxx
@@ -122,8 +122,7 @@ void ScVbaName::setContent( const OUString& rContent, const formula::FormulaGra
if (pOldData)
{
// Shorter way of doing this ?
- ScCompiler aComp( &rDoc, pOldData->GetPos() );
- aComp.SetGrammar( eGrammar );
+ ScCompiler aComp( &rDoc, pOldData->GetPos(), eGrammar );
std::unique_ptr<ScTokenArray> pArray(aComp.CompileString(sContent));
pOldData->SetCode(*pArray);
}