[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Mon Jan 13 09:09:14 PST 2014


 sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx       |    3 +-
 sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx    |    3 +-
 sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx     |    3 +-
 sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx      |    3 +-
 sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx            |    3 +-
 sc/source/ui/StatisticsDialogs/TTestDialog.cxx                    |    3 +-
 sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx |   11 ++++++----
 sc/source/ui/inc/TableFillingAndNavigationTools.hxx               |    8 ++++---
 8 files changed, 24 insertions(+), 13 deletions(-)

New commits:
commit 9570a27d3e2f56e9046a8bfacaafe9e3c9744ac5
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Jan 13 18:02:21 2014 +0100

    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.
    
    Change-Id: I7c782a42d007daeaaf99463beb8aa580c05c7363

diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
index cc35630..0dc9971 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 d4601ff..1687773 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 be6de68..6b20afd 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 e797b0c..a5e5001 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 9097b96..85466de 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/TTestDialog.cxx b/sc/source/ui/StatisticsDialogs/TTestDialog.cxx
index 4c576e9..59c249c 100644
--- a/sc/source/ui/StatisticsDialogs/TTestDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/TTestDialog.cxx
@@ -60,7 +60,8 @@ sal_Int16 ScTTestDialog::GetUndoNameId()
 
 ScRange ScTTestDialog::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> pVariable1Iterator;
diff --git a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
index f708b3b..53e01bf 100644
--- a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
+++ b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
@@ -152,15 +152,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::writeMatrixFormula(OUString aFormula)
@@ -168,7 +171,7 @@ void AddressWalkerWriter::writeMatrixFormula(OUString aFormula)
     ScRange aRange;
     aRange.aStart = mCurrentAddress;
     aRange.aEnd = mCurrentAddress;
-    mpDocShell->GetDocFunc().EnterMatrix(aRange, NULL, NULL, aFormula, false, false, OUString(), formula::FormulaGrammar::GRAM_DEFAULT );
+    mpDocShell->GetDocFunc().EnterMatrix(aRange, NULL, NULL, aFormula, false, false, OUString(), meGrammar );
 }
 
 void AddressWalkerWriter::writeString(OUString aString)
diff --git a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
index f616e5b..88f7c3f 100644
--- a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
+++ b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
@@ -76,10 +76,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 writeMatrixFormula(OUString aFormula);


More information about the Libreoffice-commits mailing list