diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2013-12-01 12:33:42 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2013-12-01 12:36:26 +0100 |
commit | 1d96c4a097313fd5240d79dc70ffed95bd264f55 (patch) | |
tree | 73bae8cb6808f1be129d9f015ac329f4d1bc497b /sc | |
parent | 0f4be588622379388650d8fc451829d17d16a7bf (diff) |
Add strings in statistics dialogs to the SRC/HRC file.
Change-Id: I8b66356a76586443fc5174c2af9c40bf2551b864
Diffstat (limited to 'sc')
12 files changed, 166 insertions, 50 deletions
diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx index 7c3873be01ba..cc35630391eb 100644 --- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx @@ -30,9 +30,14 @@ namespace { -static const char* lclBasicStatisticsLabels[] = +static sal_Int16 lclBasicStatisticsLabels[] = { - "Groups", "Count", "Sum", "Mean", "Variance", NULL + STR_ANOVA_LABEL_GROUPS, + STRID_CALC_COUNT, + STRID_CALC_SUM, + STRID_CALC_MEAN, + STRID_CALC_VARIANCE, + 0 }; static const char* lclBasicStatisticsFormula[] = @@ -40,15 +45,20 @@ static const char* lclBasicStatisticsFormula[] = "=COUNT(%RANGE%)", "=SUM(%RANGE%)", "=AVERAGE(%RANGE%)", "=VAR(%RANGE%)", NULL }; -static const char* lclAnovaLabels[] = +static sal_Int16 lclAnovaLabels[] = { - "Source of Variation", "SS", "df", "MS", "F", "P-value", "F critical", NULL + STR_ANOVA_LABEL_SOURCE_OF_VARIATION, + STR_ANOVA_LABEL_SS, + STR_ANOVA_LABEL_DF, + STR_ANOVA_LABEL_MS, + STR_ANOVA_LABEL_F, + STR_ANOVA_LABEL_P_VALUE, + STR_ANOVA_LABEL_F_CRITICAL, + 0 }; static const OUString strWildcardRange("%RANGE%"); static const OUString strWildcardNumber("%NUMBER%"); -static const OUString strColumnLabelTemplate("Column %NUMBER%"); -static const OUString strRowLabelTemplate("Row %NUMBER%"); OUString lclCreateMultiParameterFormula( ScRangeList& aRangeList, const OUString& aFormulaTemplate, @@ -97,14 +107,14 @@ ScRange ScAnalysisOfVarianceDialog::ApplyOutput(ScDocShell* pDocShell) AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument); FormulaTemplate aTemplate(mDocument, mAddressDetails); - output.writeBoldString("ANOVA - Single Factor"); + output.writeBoldString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ANOVA_SINGLE_FACTOR_LABEL)); output.nextRow(); output.nextRow(); // Write labels - for(sal_Int32 i = 0; lclBasicStatisticsLabels[i] != NULL; i++) + for(sal_Int32 i = 0; lclBasicStatisticsLabels[i] != 0; i++) { - output.writeString(lclBasicStatisticsLabels[i]); + output.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, lclBasicStatisticsLabels[i])); output.nextColumn(); } output.nextRow(); @@ -123,12 +133,13 @@ ScRange ScAnalysisOfVarianceDialog::ApplyOutput(ScDocShell* pDocShell) output.resetColumn(); if (mGroupedBy == BY_COLUMN) - aTemplate.setTemplate(strColumnLabelTemplate); + aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_COLUMN_LABEL_TEMPLATE)); else - aTemplate.setTemplate(strRowLabelTemplate); + aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ROW_LABEL_TEMPLATE)); aTemplate.applyNumber(strWildcardNumber, pIterator->index() + 1); - pDocShell->GetDocFunc().SetStringCell(output.current(), aTemplate.getTemplate(), true); + output.writeString(aTemplate.getTemplate()); + output.nextColumn(); ScRange aColumnRange = pIterator->get(); @@ -149,9 +160,9 @@ ScRange ScAnalysisOfVarianceDialog::ApplyOutput(ScDocShell* pDocShell) // Write ANOVA labels output.resetColumn(); - for(sal_Int32 i = 0; lclAnovaLabels[i] != NULL; i++) + for(sal_Int32 i = 0; lclAnovaLabels[i] != 0; i++) { - output.writeString(lclAnovaLabels[i]); + output.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, lclAnovaLabels[i])); output.nextColumn(); } output.nextRow(); @@ -160,7 +171,7 @@ ScRange ScAnalysisOfVarianceDialog::ApplyOutput(ScDocShell* pDocShell) { // Label output.resetColumn(); - output.writeString("Between Groups"); + output.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ANOVA_LABEL_BETWEEN_GROUPS)); output.nextColumn(); // Sum of Squares @@ -217,7 +228,7 @@ ScRange ScAnalysisOfVarianceDialog::ApplyOutput(ScDocShell* pDocShell) { // Label output.resetColumn(); - output.writeString("Within Groups"); + output.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ANOVA_LABEL_WITHIN_GROUPS)); output.nextColumn(); // Sum of Squares @@ -246,7 +257,7 @@ ScRange ScAnalysisOfVarianceDialog::ApplyOutput(ScDocShell* pDocShell) { // Label output.resetColumn(); - output.writeString("Total"); + output.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ANOVA_LABEL_TOTAL)); output.nextColumn(); // Sum of Squares diff --git a/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx b/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx index 4f17a48943db..4b8b1de76310 100644 --- a/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx @@ -10,12 +10,13 @@ #include "docsh.hxx" #include "reffact.hxx" +#include "strload.hxx" +#include "StatisticsDialogs.hrc" #include "CorrelationDialog.hxx" namespace { - static const OUString strCorrelationLabel("Correlations"); static const OUString strCorrelationTemplate("=CORREL(%VAR1%; %VAR2%)"); } @@ -32,12 +33,12 @@ sal_Bool ScCorrelationDialog::Close() return DoClose( ScCorrelationDialogWrapper::GetChildWindowId() ); } -const OUString& ScCorrelationDialog::getLabel() +const OUString ScCorrelationDialog::getLabel() { - return strCorrelationLabel; + return SC_STRLOAD(RID_STATISTICS_DLGS, STR_CORRELATION_LABEL); } -const OUString& ScCorrelationDialog::getTemplate() +const OUString ScCorrelationDialog::getTemplate() { return strCorrelationTemplate; } diff --git a/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx index 3918654d50f6..432ca4673576 100644 --- a/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx @@ -10,12 +10,13 @@ #include "docsh.hxx" #include "reffact.hxx" +#include "strload.hxx" +#include "StatisticsDialogs.hrc" #include "CovarianceDialog.hxx" namespace { - static const OUString strCovarianceLabel("Covariances"); static const OUString strCovarianceTemplate("=COVAR(%VAR1%; %VAR2%)"); } @@ -32,12 +33,12 @@ sal_Bool ScCovarianceDialog::Close() return DoClose( ScCovarianceDialogWrapper::GetChildWindowId() ); } -const OUString& ScCovarianceDialog::getLabel() +const OUString ScCovarianceDialog::getLabel() { - return strCovarianceLabel; + return SC_STRLOAD(RID_STATISTICS_DLGS, STR_COVARIANCE_LABEL); } -const OUString& ScCovarianceDialog::getTemplate() +const OUString ScCovarianceDialog::getTemplate() { return strCovarianceTemplate; } diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx index c5c857ee35d5..d4601ff5a4d7 100644 --- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx @@ -57,8 +57,7 @@ static const StatisticCalculation lclCalcDefinitions[] = static const OUString strWildcardRange("%RANGE%"); static const OUString strWildcardNumber("%NUMBER%"); -static const OUString strColumnLabelTemplate("Column %NUMBER%"); -static const OUString strRowLabelTemplate("Row %NUMBER%"); + } ScDescriptiveStatisticsDialog::ScDescriptiveStatisticsDialog( @@ -99,9 +98,10 @@ ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell) for( ; pIterator->hasNext(); pIterator->next() ) { if (mGroupedBy == BY_COLUMN) - aTemplate.setTemplate(strColumnLabelTemplate); + aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_COLUMN_LABEL_TEMPLATE)); else - aTemplate.setTemplate(strRowLabelTemplate); + aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ROW_LABEL_TEMPLATE)); + aTemplate.applyNumber(strWildcardNumber, pIterator->index() + 1); aOutput.writeBoldString(aTemplate.getTemplate()); aOutput.nextColumn(); diff --git a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx index 9e4cb9bf8978..be6de68dcd21 100644 --- a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx @@ -59,7 +59,7 @@ ScRange ScExponentialSmoothingDialog::ApplyOutput(ScDocShell* pDocShell) double aSmoothingFactor = mpSmoothingFactor->GetValue() / 100.0; // Alpha - output.writeBoldString("Alpha"); + output.writeBoldString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_LABEL_ALPHA)); output.nextRow(); // Alpha Value @@ -84,9 +84,9 @@ ScRange ScExponentialSmoothingDialog::ApplyOutput(ScDocShell* pDocShell) // Write column label if (mGroupedBy == BY_COLUMN) - aTemplate.setTemplate("Column %NUMBER%"); + aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_COLUMN_LABEL_TEMPLATE)); else - aTemplate.setTemplate("Row %NUMBER%"); + aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ROW_LABEL_TEMPLATE)); aTemplate.applyNumber("%NUMBER%", pIterator->index() + 1); output.writeBoldString(aTemplate.getTemplate()); output.nextRow(); diff --git a/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx b/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx index 12c70ecead72..e797b0c92fe2 100644 --- a/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx +++ b/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx @@ -33,8 +33,6 @@ namespace static const OUString strWildcard2("%VAR2%"); static const OUString strWildcardNumber("%NUMBER%"); - static const OUString strColumnLabelTemplate("Column %NUMBER%"); - static const OUString strRowLabelTemplate("Row %NUMBER%"); void lclWriteCorrelationFormulas( AddressWalkerWriter& aOutput, FormulaTemplate& aTemplate, @@ -95,13 +93,13 @@ ScRange ScMatrixComparisonGenerator::ApplyOutput(ScDocShell* pDocShell) // write labels to columns for (size_t i = 0; i < aRangeList.size(); i++) { - OUString aLabel; if (mGroupedBy == BY_COLUMN) - aLabel = strColumnLabelTemplate.replaceAll(strWildcardNumber, OUString::number(i + 1)); + aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_COLUMN_LABEL_TEMPLATE)); else - aLabel = strRowLabelTemplate.replaceAll(strWildcardNumber, OUString::number(i + 1)); + aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ROW_LABEL_TEMPLATE)); - output.writeString(aLabel); + aTemplate.applyNumber(strWildcardNumber, i + 1); + output.writeString(aTemplate.getTemplate()); output.nextColumn(); } @@ -110,13 +108,13 @@ ScRange ScMatrixComparisonGenerator::ApplyOutput(ScDocShell* pDocShell) output.nextRow(); for (size_t i = 0; i < aRangeList.size(); i++) { - OUString aLabel; if (mGroupedBy == BY_COLUMN) - aLabel = strColumnLabelTemplate.replaceAll(strWildcardNumber, OUString::number(i + 1)); + aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_COLUMN_LABEL_TEMPLATE)); else - aLabel = strRowLabelTemplate.replaceAll(strWildcardNumber, OUString::number(i + 1)); + aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ROW_LABEL_TEMPLATE)); - output.writeString(aLabel); + aTemplate.applyNumber(strWildcardNumber, i + 1); + output.writeString(aTemplate.getTemplate()); output.nextRow(); } diff --git a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx index 04f424526453..9097b969707d 100644 --- a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx @@ -70,9 +70,10 @@ ScRange ScMovingAverageDialog::ApplyOutput(ScDocShell* pDocShell) // Write label if (mGroupedBy == BY_COLUMN) - aTemplate.setTemplate("Column %NUMBER%"); + aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_COLUMN_LABEL_TEMPLATE)); else - aTemplate.setTemplate("Row %NUMBER%"); + aTemplate.setTemplate(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ROW_LABEL_TEMPLATE)); + aTemplate.applyNumber("%NUMBER%", pIterator->index() + 1); output.writeBoldString(aTemplate.getTemplate()); output.nextRow(); diff --git a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc index 6b254030de65..e697a8cf46d0 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc +++ b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc @@ -55,4 +55,24 @@ #define STR_MOVING_AVERAGE_UNDO_NAME 39 #define STR_TTEST_UNDO_NAME 40 +#define STR_COLUMN_LABEL_TEMPLATE 41 +#define STR_ROW_LABEL_TEMPLATE 42 + +#define STR_ANOVA_SINGLE_FACTOR_LABEL 43 +#define STR_ANOVA_LABEL_GROUPS 44 +#define STR_ANOVA_LABEL_BETWEEN_GROUPS 45 +#define STR_ANOVA_LABEL_WITHIN_GROUPS 46 +#define STR_ANOVA_LABEL_SOURCE_OF_VARIATION 47 +#define STR_ANOVA_LABEL_SS 48 +#define STR_ANOVA_LABEL_DF 49 +#define STR_ANOVA_LABEL_MS 50 +#define STR_ANOVA_LABEL_F 51 +#define STR_ANOVA_LABEL_P_VALUE 52 +#define STR_ANOVA_LABEL_F_CRITICAL 53 +#define STR_ANOVA_LABEL_TOTAL 54 + +#define STR_CORRELATION_LABEL 55 +#define STR_COVARIANCE_LABEL 56 +#define STR_LABEL_ALPHA 57 + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src index d45b841e8f67..5af2f076a553 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src +++ b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src @@ -34,6 +34,66 @@ Resource RID_STATISTICS_DLGS Text [ en-US ] = "Analysis of Variance"; }; + String STR_ANOVA_SINGLE_FACTOR_LABEL + { + Text [ en-US ] = "ANOVA - Single Factor"; + }; + + String STR_ANOVA_LABEL_GROUPS + { + Text [ en-US ] = "Groups"; + }; + + String STR_ANOVA_LABEL_BETWEEN_GROUPS + { + Text [ en-US ] = "Between Groups"; + }; + + String STR_ANOVA_LABEL_WITHIN_GROUPS + { + Text [ en-US ] = "Within Groups"; + }; + + String STR_ANOVA_LABEL_SOURCE_OF_VARIATION + { + Text [ en-US ] = "Source of Variation"; + }; + + String STR_ANOVA_LABEL_SS + { + Text [ en-US ] = "SS"; + }; + + String STR_ANOVA_LABEL_DF + { + Text [ en-US ] = "df"; + }; + + String STR_ANOVA_LABEL_MS + { + Text [ en-US ] = "MS"; + }; + + String STR_ANOVA_LABEL_F + { + Text [ en-US ] = "F"; + }; + + String STR_ANOVA_LABEL_P_VALUE + { + Text [ en-US ] = "P-value"; + }; + + String STR_ANOVA_LABEL_F_CRITICAL + { + Text [ en-US ] = "F critical"; + }; + + String STR_ANOVA_LABEL_TOTAL + { + Text [ en-US ] = "Total"; + }; + /* CorrelationDialog */ String STR_CORRELATION_UNDO_NAME @@ -41,6 +101,11 @@ Resource RID_STATISTICS_DLGS Text [ en-US ] = "Correlation"; }; + String STR_CORRELATION_LABEL + { + Text [ en-US ] = "Correlations"; + }; + /* CovarianceDialog */ String STR_COVARIANCE_UNDO_NAME @@ -48,6 +113,11 @@ Resource RID_STATISTICS_DLGS Text [ en-US ] = "Covariance"; }; + String STR_COVARIANCE_LABEL + { + Text [ en-US ] = "Covariances"; + }; + /* DescriptiveStatisticsDialog */ String STR_DESCRIPTIVE_STATISTICS_UNDO_NAME @@ -197,6 +267,20 @@ Resource RID_STATISTICS_DLGS { Text [ en-US ] = "t-test"; }; + + /* Common */ + String STR_COLUMN_LABEL_TEMPLATE + { + Text [ en-US ] = "Column %NUMBER%"; + }; + String STR_ROW_LABEL_TEMPLATE + { + Text [ en-US ] = "Row %NUMBER%"; + }; + String STR_LABEL_ALPHA + { + Text [ en-US ] = "Alpha"; + }; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/CorrelationDialog.hxx b/sc/source/ui/inc/CorrelationDialog.hxx index 4e89cc05897a..cefc60d43569 100644 --- a/sc/source/ui/inc/CorrelationDialog.hxx +++ b/sc/source/ui/inc/CorrelationDialog.hxx @@ -23,8 +23,8 @@ public: virtual sal_Bool Close(); protected: - virtual const OUString& getLabel(); - virtual const OUString& getTemplate(); + virtual const OUString getLabel(); + virtual const OUString getTemplate(); }; diff --git a/sc/source/ui/inc/CovarianceDialog.hxx b/sc/source/ui/inc/CovarianceDialog.hxx index cd46701dc74d..9325af2585ff 100644 --- a/sc/source/ui/inc/CovarianceDialog.hxx +++ b/sc/source/ui/inc/CovarianceDialog.hxx @@ -23,8 +23,8 @@ public: virtual sal_Bool Close(); protected: - virtual const OUString& getLabel(); - virtual const OUString& getTemplate(); + virtual const OUString getLabel(); + virtual const OUString getTemplate(); }; #endif diff --git a/sc/source/ui/inc/MatrixComparisonGenerator.hxx b/sc/source/ui/inc/MatrixComparisonGenerator.hxx index 88c8f17f64e4..6875c73806e0 100644 --- a/sc/source/ui/inc/MatrixComparisonGenerator.hxx +++ b/sc/source/ui/inc/MatrixComparisonGenerator.hxx @@ -35,8 +35,8 @@ protected: virtual sal_Int16 GetUndoNameId(); virtual ScRange ApplyOutput(ScDocShell* pDocShell); - virtual const OUString& getLabel() = 0; - virtual const OUString& getTemplate() = 0; + virtual const OUString getLabel() = 0; + virtual const OUString getTemplate() = 0; }; #endif |