diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-08-29 20:44:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-30 11:39:01 +0100 |
commit | 74929bba736cc6cceed3c088e13f5952abb1bd2b (patch) | |
tree | 8a026d95bc586ca6a41686dee32dfa53b659b252 /sc/source/ui/StatisticsDialogs | |
parent | fc7e7b683112e9ccd23104f38d4acc3417e9d5b8 (diff) |
Related: fdo#38838 remove UniString::ToUpperAscii
things got a little out of hand and I ended up
converting quite a bit of calc to OUString
Change-Id: I056326d37ffefa8c120cb2e564d166dd9f20f216
Diffstat (limited to 'sc/source/ui/StatisticsDialogs')
7 files changed, 29 insertions, 49 deletions
diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx index 20d2c8612114..d0c809d446ae 100644 --- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx @@ -58,8 +58,7 @@ OUString lclCreateMultiParameterFormula( OUString aResult; for (size_t i = 0; i < aRangeList.size(); i++) { - OUString aRangeString; - aRangeList[i]->Format( aRangeString, SCR_ABS, pDocument, aAddressDetails ); + OUString aRangeString(aRangeList[i]->Format(SCR_ABS, pDocument, aAddressDetails)); OUString aFormulaString = aFormulaTemplate.replaceAll(aWildcard, aRangeString); aResult += aFormulaString; if(i != aRangeList.size() - 1) // Not Last @@ -138,7 +137,7 @@ void ScAnalysisOfVarianceDialog::CalculateInputAndWriteToOutput( ) ); aRangeList.Append(aColumnRange); - aColumnRange.Format( aReferenceString, SCR_ABS, mDocument, mAddressDetails ); + aReferenceString = aColumnRange.Format(SCR_ABS, mDocument, mAddressDetails); OUString aFormulaString; OUString aFormulaTemplate; @@ -176,12 +175,10 @@ void ScAnalysisOfVarianceDialog::CalculateInputAndWriteToOutput( ) // Sum of Squares aAddress = ScAddress(outCol, outRow, outTab); - OUString aReferenceTotal; - OUString aReferenceWithin; ScAddress aAddressTotal(outCol, outRow+2, outTab); - aAddressTotal.Format( aReferenceTotal, SCR_ABS, mDocument, mAddressDetails ); + OUString aReferenceTotal(aAddressTotal.Format(SCR_ABS, mDocument, mAddressDetails)); ScAddress aAddressWithin(outCol, outRow+1, outTab); - aAddressWithin.Format( aReferenceWithin, SCR_ABS, mDocument, mAddressDetails ); + OUString aReferenceWithin(aAddressWithin.Format(SCR_ABS, mDocument, mAddressDetails)); OUString aFormulaString = "=" + aReferenceTotal + "-" + aReferenceWithin; pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true); outCol++; @@ -189,18 +186,16 @@ void ScAnalysisOfVarianceDialog::CalculateInputAndWriteToOutput( ) // Degree of freedom aAddress = ScAddress(outCol, outRow, outTab); aAddressTotal = ScAddress(outCol, outRow+2, outTab); - aAddressTotal.Format( aReferenceTotal, SCR_ABS, mDocument, mAddressDetails ); + aReferenceTotal = aAddressTotal.Format(SCR_ABS, mDocument, mAddressDetails); aAddressWithin = ScAddress(outCol, outRow+1, outTab); - aAddressWithin.Format( aReferenceWithin, SCR_ABS, mDocument, mAddressDetails ); + aReferenceWithin = aAddressWithin.Format(SCR_ABS, mDocument, mAddressDetails); aFormulaString = "=" + aReferenceTotal + "-" + aReferenceWithin; pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true); outCol++; // MS - OUString aSSRef; - ScAddress(outCol-2, outRow, outTab).Format( aSSRef, SCR_ABS, mDocument, mAddressDetails ); - OUString aDFRef; - ScAddress(outCol-1, outRow, outTab).Format( aDFRef, SCR_ABS, mDocument, mAddressDetails ); + OUString aSSRef(ScAddress(outCol-2, outRow, outTab).Format(SCR_ABS, mDocument, mAddressDetails)); + OUString aDFRef(ScAddress(outCol-1, outRow, outTab).Format(SCR_ABS, mDocument, mAddressDetails)); aFormulaString = "=" + aSSRef + "/" + aDFRef; aAddress = ScAddress(outCol, outRow, outTab); pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true); @@ -208,22 +203,17 @@ void ScAnalysisOfVarianceDialog::CalculateInputAndWriteToOutput( ) // F aAddress = ScAddress(outCol, outRow, outTab); - OUString aMSBetween; - ScAddress(outCol-1, outRow, outTab).Format( aMSBetween, SCR_ABS, mDocument, mAddressDetails ); - OUString aMSWithin; - ScAddress(outCol-1, outRow+1, outTab).Format( aMSWithin, SCR_ABS, mDocument, mAddressDetails ); + OUString aMSBetween(ScAddress(outCol-1, outRow, outTab).Format(SCR_ABS, mDocument, mAddressDetails)); + OUString aMSWithin(ScAddress(outCol-1, outRow+1, outTab).Format(SCR_ABS, mDocument, mAddressDetails)); aFormulaString = "=" + aMSBetween + "/" + aMSWithin; pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true); outCol++; // P-value aAddress = ScAddress(outCol, outRow, outTab); - OUString aFValue; - ScAddress(outCol-1, outRow, outTab).Format( aFValue, SCR_ABS, mDocument, mAddressDetails ); - OUString aDFBetween; - ScAddress(outCol-3, outRow, outTab).Format( aDFBetween, SCR_ABS, mDocument, mAddressDetails ); - OUString aDFWithin; - ScAddress(outCol-3, outRow+1, outTab).Format( aDFWithin, SCR_ABS, mDocument, mAddressDetails ); + OUString aFValue(ScAddress(outCol-1, outRow, outTab).Format(SCR_ABS, mDocument, mAddressDetails)); + OUString aDFBetween(ScAddress(outCol-3, outRow, outTab).Format(SCR_ABS, mDocument, mAddressDetails)); + OUString aDFWithin(ScAddress(outCol-3, outRow+1, outTab).Format(SCR_ABS, mDocument, mAddressDetails)); aFormulaString = "=FDIST("+ aFValue + ";" + aDFBetween + ";" + aDFWithin + ")"; pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true); outCol++; @@ -265,12 +255,10 @@ void ScAnalysisOfVarianceDialog::CalculateInputAndWriteToOutput( ) outCol++; // MS - OUString aSSRef; - OUString aDFRef; ScAddress aAddressSS(outCol-2, outRow, outTab); - aAddressSS.Format( aSSRef, SCR_ABS, mDocument, mAddressDetails ); + OUString aSSRef(aAddressSS.Format(SCR_ABS, mDocument, mAddressDetails)); ScAddress aAddressDF(outCol-1, outRow, outTab); - aAddressDF.Format( aDFRef, SCR_ABS, mDocument, mAddressDetails ); + OUString aDFRef(aAddressDF.Format(SCR_ABS, mDocument, mAddressDetails)); OUString aFormulaString = "=" + aSSRef + "/" + aDFRef; aAddress = ScAddress(outCol, outRow, outTab); pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true); diff --git a/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx b/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx index 9f26c8c8eec4..780804ddbcbe 100644 --- a/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx @@ -126,8 +126,6 @@ void ScCorrelationDialog::CalculateInputAndWriteToOutput( ) void ScCorrelationDialog::WriteCorrelationFormulas(ScAddress aOutputAddress, ScRangeList aRangeList) { ScDocShell* pDocShell = mViewData->GetDocShell(); - OUString aColumnString1; - OUString aColumnString2; ScAddress aAddress; SCTAB outTab = aOutputAddress.Tab(); @@ -142,8 +140,8 @@ void ScCorrelationDialog::WriteCorrelationFormulas(ScAddress aOutputAddress, ScR { if (j >= i) { - aRangeList[i]->Format( aColumnString1, SCR_ABS, mDocument, mAddressDetails ); - aRangeList[j]->Format( aColumnString2, SCR_ABS, mDocument, mAddressDetails ); + OUString aColumnString1(aRangeList[i]->Format(SCR_ABS, mDocument, mAddressDetails)); + OUString aColumnString2(aRangeList[j]->Format(SCR_ABS, mDocument, mAddressDetails)); aAddress = ScAddress(outCol, outRow, outTab); aFormulaString = lclCorrelTemplate.replaceAll(lclWildcardColumn1, aColumnString1); diff --git a/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx index 94a62da7f7e2..b72e569ded24 100644 --- a/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/CovarianceDialog.cxx @@ -126,8 +126,6 @@ void ScCovarianceDialog::CalculateInputAndWriteToOutput( ) void ScCovarianceDialog::WriteCovarianceFormulas(ScAddress aOutputAddress, ScRangeList aRangeList) { ScDocShell* pDocShell = mViewData->GetDocShell(); - OUString aRowString1; - OUString aRowString2; ScAddress aAddress; SCTAB outTab = aOutputAddress.Tab(); @@ -142,8 +140,8 @@ void ScCovarianceDialog::WriteCovarianceFormulas(ScAddress aOutputAddress, ScRan { if (j >= i) { - aRangeList[i]->Format( aRowString1, SCR_ABS, mDocument, mAddressDetails ); - aRangeList[j]->Format( aRowString2, SCR_ABS, mDocument, mAddressDetails ); + OUString aRowString1(aRangeList[i]->Format(SCR_ABS, mDocument, mAddressDetails)); + OUString aRowString2(aRangeList[j]->Format(SCR_ABS, mDocument, mAddressDetails)); aAddress = ScAddress(outCol, outRow, outTab); aFormulaString = lclCovarTemplate.replaceAll(lclWildcardRow1, aRowString1); diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx index b4d89157a00e..f6ae015af70f 100644 --- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx @@ -113,7 +113,7 @@ void ScDescriptiveStatisticsDialog::CalculateInputAndWriteToOutput( ) ScAddress(inCol, mInputRange.aEnd.Row(), inTab) ); - aColumnRange.Format( aReferenceString, SCR_ABS, mDocument, mAddressDetails ); + aReferenceString = aColumnRange.Format(SCR_ABS, mDocument, mAddressDetails); OUString aFormulaString; OUString aFormulaTemplate; diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx index 779252e9bdfe..917b2965e698 100644 --- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx @@ -116,9 +116,8 @@ void ScRandomNumberGeneratorDialog::Init() void ScRandomNumberGeneratorDialog::GetRangeFromSelection() { - OUString aCurrentString; mViewData->GetSimpleArea(mInputRange); - mInputRange.Format( aCurrentString, SCR_ABS_3D, mDocument, mAddressDetails ); + OUString aCurrentString(mInputRange.Format(SCR_ABS_3D, mDocument, mAddressDetails)); mpInputRangeEdit->SetText( aCurrentString ); } @@ -154,8 +153,7 @@ void ScRandomNumberGeneratorDialog::SetReference( const ScRange& rReferenceRange mInputRange = rReferenceRange; - String aReferenceString; - mInputRange.Format( aReferenceString, SCR_ABS_3D, pDocument, mAddressDetails ); + OUString aReferenceString(mInputRange.Format(SCR_ABS_3D, pDocument, mAddressDetails)); mpInputRangeEdit->SetRefString( aReferenceString ); } } diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx index 841f3fc51663..20608bbb6e24 100644 --- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx @@ -101,9 +101,8 @@ void ScSamplingDialog::Init() void ScSamplingDialog::GetRangeFromSelection() { - OUString aCurrentString; mViewData->GetSimpleArea(mInputRange); - mInputRange.Format(aCurrentString, SCR_ABS_3D, mDocument, mAddressDetails); + OUString aCurrentString(mInputRange.Format(SCR_ABS_3D, mDocument, mAddressDetails)); mpInputRangeEdit->SetText(aCurrentString); } @@ -142,7 +141,7 @@ void ScSamplingDialog::SetReference( const ScRange& rReferenceRange, ScDocument* if ( mpActiveEdit == mpInputRangeEdit ) { mInputRange = rReferenceRange; - mInputRange.Format( aReferenceString, SCR_ABS_3D, pDocument, mAddressDetails ); + aReferenceString = mInputRange.Format(SCR_ABS_3D, pDocument, mAddressDetails); mpInputRangeEdit->SetRefString( aReferenceString ); } else if ( mpActiveEdit == mpOutputRangeEdit ) @@ -150,7 +149,7 @@ void ScSamplingDialog::SetReference( const ScRange& rReferenceRange, ScDocument* mOutputAddress = rReferenceRange.aStart; sal_uInt16 nFormat = ( mOutputAddress.Tab() == mCurrentAddress.Tab() ) ? SCA_ABS : SCA_ABS_3D; - mOutputAddress.Format( aReferenceString, nFormat, pDocument, pDocument->GetAddressConvention() ); + aReferenceString = mOutputAddress.Format(nFormat, pDocument, pDocument->GetAddressConvention()); mpOutputRangeEdit->SetRefString( aReferenceString ); // Change sampling size according to output range selection diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx index 7d868705192f..ff431d7cf677 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx @@ -111,9 +111,8 @@ void ScStatisticsInputOutputDialog::Init() void ScStatisticsInputOutputDialog::GetRangeFromSelection() { - OUString aCurrentString; mViewData->GetSimpleArea(mInputRange); - mInputRange.Format(aCurrentString, SCR_ABS_3D, mDocument, mAddressDetails); + OUString aCurrentString(mInputRange.Format(SCR_ABS_3D, mDocument, mAddressDetails)); mpInputRangeEdit->SetText(aCurrentString); } @@ -139,12 +138,12 @@ void ScStatisticsInputOutputDialog::SetReference( const ScRange& rReferenceRange if ( rReferenceRange.aStart != rReferenceRange.aEnd ) RefInputStart( mpActiveEdit ); - String aReferenceString; + OUString aReferenceString; if ( mpActiveEdit == mpInputRangeEdit ) { mInputRange = rReferenceRange; - mInputRange.Format( aReferenceString, SCR_ABS_3D, pDocument, mAddressDetails ); + aReferenceString = mInputRange.Format(SCR_ABS_3D, pDocument, mAddressDetails); mpInputRangeEdit->SetRefString( aReferenceString ); } else if ( mpActiveEdit == mpOutputRangeEdit ) @@ -152,7 +151,7 @@ void ScStatisticsInputOutputDialog::SetReference( const ScRange& rReferenceRange mOutputAddress = rReferenceRange.aStart; sal_uInt16 nFormat = ( mOutputAddress.Tab() == mCurrentAddress.Tab() ) ? SCA_ABS : SCA_ABS_3D; - mOutputAddress.Format( aReferenceString, nFormat, pDocument, pDocument->GetAddressConvention() ); + aReferenceString = mOutputAddress.Format(nFormat, pDocument, pDocument->GetAddressConvention()); mpOutputRangeEdit->SetRefString( aReferenceString ); // Enable OK, Cancel if output range is set |