diff options
author | Eike Rathke <erack@redhat.com> | 2014-01-13 18:02:21 +0100 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2014-01-16 20:12:04 +0000 |
commit | 8461894a7b23c9d7b8123562847ed7689c8387eb (patch) | |
tree | ee8e12e367965b9c41d8bf9e69392c440400a3d7 | |
parent | 5a21b3ee198cefc1f4081ff4f99c1752c4bded8f (diff) |
resolved fdo#73555 compile statistics templates using English grammar
The statistics templates' formula expressions are setup using English
function names, so compile the resulting expressions using an English
grammar merged with the current address conventions.
(cherry picked from commit 9570a27d3e2f56e9046a8bfacaafe9e3c9744ac5)
Conflicts:
sc/source/ui/StatisticsDialogs/TTestDialog.cxx
sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
Change-Id: I7c782a42d007daeaaf99463beb8aa580c05c7363
Reviewed-on: https://gerrit.libreoffice.org/7412
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Tested-by: Kohei Yoshida <libreoffice@kohei.us>
7 files changed, 21 insertions, 11 deletions
diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx index cc35630391eb..0dc997113eb7 100644 --- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx @@ -104,7 +104,8 @@ sal_Int16 ScAnalysisOfVarianceDialog::GetUndoNameId() ScRange ScAnalysisOfVarianceDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument); + AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument, + formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(mDocument, mAddressDetails); output.writeBoldString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ANOVA_SINGLE_FACTOR_LABEL)); diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx index d4601ff5a4d7..168777346c72 100644 --- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx @@ -83,7 +83,8 @@ sal_Int16 ScDescriptiveStatisticsDialog::GetUndoNameId() ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument); + AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, + formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(mDocument, mAddressDetails); boost::scoped_ptr<DataRangeIterator> pIterator; diff --git a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx index be6de68dcd21..6b20afd2ccc5 100644 --- a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx @@ -52,7 +52,8 @@ sal_Int16 ScExponentialSmoothingDialog::GetUndoNameId() ScRange ScExponentialSmoothingDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument); + AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument, + formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(mDocument, mAddressDetails); // Smoothing factor diff --git a/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx b/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx index e797b0c92fe2..a5e5001e645b 100644 --- a/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx +++ b/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx @@ -74,7 +74,8 @@ sal_Int16 ScMatrixComparisonGenerator::GetUndoNameId() ScRange ScMatrixComparisonGenerator::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument); + AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument, + formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(mDocument, mAddressDetails); SCTAB inTab = mInputRange.aStart.Tab(); diff --git a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx index 9097b969707d..85466deb5d84 100644 --- a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx @@ -52,7 +52,8 @@ sal_Int16 ScMovingAverageDialog::GetUndoNameId() ScRange ScMovingAverageDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument); + AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument, + formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(mDocument, mAddressDetails); boost::scoped_ptr<DataRangeIterator> pIterator; diff --git a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx index efd4581e70e0..c6935fe83b9b 100644 --- a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx +++ b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx @@ -132,15 +132,18 @@ void AddressWalker::pop() mAddressStack.pop_back(); } -AddressWalkerWriter::AddressWalkerWriter(ScAddress aInitialAddress, ScDocShell* pDocShell, ScDocument* pDocument) : +AddressWalkerWriter::AddressWalkerWriter(ScAddress aInitialAddress, ScDocShell* pDocShell, ScDocument* pDocument, + formula::FormulaGrammar::Grammar eGrammar ) : AddressWalker(aInitialAddress, true), mpDocShell(pDocShell), - mpDocument(pDocument) + mpDocument(pDocument), + meGrammar(eGrammar) {} void AddressWalkerWriter::writeFormula(OUString aFormula) { - mpDocShell->GetDocFunc().SetFormulaCell(mCurrentAddress, new ScFormulaCell(mpDocument, mCurrentAddress, aFormula), true); + mpDocShell->GetDocFunc().SetFormulaCell(mCurrentAddress, + new ScFormulaCell(mpDocument, mCurrentAddress, aFormula, meGrammar), true); } void AddressWalkerWriter::writeString(OUString aString) diff --git a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx index 9a62b7e24b23..ea9a309f0a2b 100644 --- a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx +++ b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx @@ -65,10 +65,12 @@ public: class AddressWalkerWriter : public AddressWalker { public: - ScDocShell* mpDocShell; - ScDocument* mpDocument; + ScDocShell* mpDocShell; + ScDocument* mpDocument; + formula::FormulaGrammar::Grammar meGrammar; - AddressWalkerWriter(ScAddress aInitialAddress, ScDocShell* pDocShell, ScDocument* pDocument); + AddressWalkerWriter(ScAddress aInitialAddress, ScDocShell* pDocShell, ScDocument* pDocument, + formula::FormulaGrammar::Grammar eGrammar ); void writeFormula(OUString aFormula); void writeString(OUString aString); |