diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-14 11:59:34 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-14 16:18:24 +0100 |
commit | 6d1c34b3698c0fff6125205494e71d32d11a4dbd (patch) | |
tree | 005759d5c88c22e72f8d36a19d21c9b31c15e887 /sc | |
parent | 5d1f3098bf8aad3a54896eb2505563773428dbbe (diff) |
mDocument is assumed to be non-null
Change-Id: I53cf6625a24fe0b79914736f271ed3577af2e6e5
Reviewed-on: https://gerrit.libreoffice.org/82680
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
9 files changed, 25 insertions, 25 deletions
diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx index 0c4aaa7b3d70..bdb4c51f350f 100644 --- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx @@ -286,7 +286,7 @@ void ScAnalysisOfVarianceDialog::AnovaSingleFactor(AddressWalkerWriter& output, output.nextColumn(); // Sum of Squares - OUString aSSPart = lclCreateMultiParameterFormula(aRangeList, "DEVSQ(%RANGE%)", strWildcardRange, mDocument, mAddressDetails); + OUString aSSPart = lclCreateMultiParameterFormula(aRangeList, "DEVSQ(%RANGE%)", strWildcardRange, &mDocument, mAddressDetails); aTemplate.setTemplate("=SUM(%RANGE%)"); aTemplate.applyString(strWildcardRange, aSSPart); aTemplate.autoReplaceAddress("%WITHIN_SS%", output.current()); @@ -539,9 +539,9 @@ void ScAnalysisOfVarianceDialog::AnovaTwoFactor(AddressWalkerWriter& output, For 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); + FormulaTemplate aTemplate(&mDocument); if (meFactor == SINGLE_FACTOR) { diff --git a/sc/source/ui/StatisticsDialogs/ChiSquareTestDialog.cxx b/sc/source/ui/StatisticsDialogs/ChiSquareTestDialog.cxx index 0d5a4faabf98..e2de2db8246d 100644 --- a/sc/source/ui/StatisticsDialogs/ChiSquareTestDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/ChiSquareTestDialog.cxx @@ -39,9 +39,9 @@ const char* ScChiSquareTestDialog::GetUndoNameId() ScRange ScChiSquareTestDialog::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); + FormulaTemplate aTemplate(&mDocument); aTemplate.autoReplaceRange("%RANGE%", mInputRange); diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx index 99798b0c73d5..434271d0a3ca 100644 --- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx @@ -70,9 +70,9 @@ const char* 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); + FormulaTemplate aTemplate(&mDocument); std::unique_ptr<DataRangeIterator> pIterator; if (mGroupedBy == BY_COLUMN) diff --git a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx index 3057f85d587b..8e87c11fb80f 100644 --- a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx @@ -43,9 +43,9 @@ const char* 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); + FormulaTemplate aTemplate(&mDocument); // Smoothing factor double aSmoothingFactor = mxSmoothingFactor->get_value() / 100.0; diff --git a/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx b/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx index b32ae3a9ce42..635b83804226 100644 --- a/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx @@ -63,10 +63,10 @@ const char* ScFourierAnalysisDialog::GetUndoNameId() { return STR_FOURIER_ANALYS ScRange ScFourierAnalysisDialog::ApplyOutput(ScDocShell* pDocShell) { getOptions(); - AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, + AddressWalkerWriter aOutput(mOutputAddress, pDocShell, &mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); - FormulaTemplate aTemplate(mDocument); + FormulaTemplate aTemplate(&mDocument); aTemplate.autoReplaceUses3D(mbUse3DAddresses); aOutput.writeBoldString(mbInverse ? ScResId(STR_INVERSE_FOURIER_TRANSFORM) @@ -204,14 +204,14 @@ void ScFourierAnalysisDialog::getDataLabel(OUString& rLabel) rLabel = "=" + maLabelAddr.Format(mbUse3DAddresses ? ScRefFlags::ADDR_ABS_3D : ScRefFlags::ADDR_ABS, - mDocument, mAddressDetails); + &mDocument, mAddressDetails); return; } OUString aDataSrc( mInputRange.Format(mbUse3DAddresses ? ScRefFlags::RANGE_ABS_3D : ScRefFlags::RANGE_ABS, - mDocument, mAddressDetails)); + &mDocument, mAddressDetails)); rLabel = ScResId(STR_INPUT_DATA_RANGE) + " : " + aDataSrc; return; diff --git a/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx b/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx index 6a371033b4a3..bb8e43efeded 100644 --- a/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx +++ b/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx @@ -57,9 +57,9 @@ const char* 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); + FormulaTemplate aTemplate(&mDocument); SCTAB inTab = mInputRange.aStart.Tab(); diff --git a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx index 4d59e28336c7..07e104f39328 100644 --- a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx @@ -44,12 +44,12 @@ const char* 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); + FormulaTemplate aTemplate(&mDocument); if (mxTrimRangeCheck->get_active()) - mDocument->GetDataAreaSubrange(mInputRange); + mDocument.GetDataAreaSubrange(mInputRange); std::unique_ptr<DataRangeIterator> pIterator; if (mGroupedBy == BY_COLUMN) diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx index 36558845a8ae..afe85effa5a2 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx @@ -59,9 +59,9 @@ ScStatisticsInputOutputDialog::ScStatisticsInputOutputDialog( , mxGroupByColumnsRadio(m_xBuilder->weld_radio_button("groupedby-columns-radio")) , mxGroupByRowsRadio(m_xBuilder->weld_radio_button("groupedby-rows-radio")) , mViewData(pViewData) - , mDocument(pViewData->GetDocument()) + , mDocument(*pViewData->GetDocument()) , mInputRange(ScAddress::INITIALIZE_INVALID) - , mAddressDetails(mDocument->GetAddressConvention(), 0, 0) + , mAddressDetails(mDocument.GetAddressConvention(), 0, 0) , mOutputAddress(ScAddress::INITIALIZE_INVALID) , mGroupedBy(BY_COLUMN) , mxButtonOk(m_xBuilder->weld_button("ok")) @@ -118,7 +118,7 @@ void ScStatisticsInputOutputDialog::Init() void ScStatisticsInputOutputDialog::GetRangeFromSelection() { mViewData->GetSimpleArea(mInputRange); - OUString aCurrentString(mInputRange.Format(ScRefFlags::RANGE_ABS_3D, mDocument, mAddressDetails)); + OUString aCurrentString(mInputRange.Format(ScRefFlags::RANGE_ABS_3D, &mDocument, mAddressDetails)); mxInputRangeEdit->SetText(aCurrentString); } @@ -226,7 +226,7 @@ IMPL_LINK_NOARG( ScStatisticsInputOutputDialog, RefInputModifyHandler, formula:: if (mpActiveEdit == mxInputRangeEdit.get()) { ScRangeList aRangeList; - bool bValid = ParseWithNames( aRangeList, mxInputRangeEdit->GetText(), mDocument); + bool bValid = ParseWithNames( aRangeList, mxInputRangeEdit->GetText(), &mDocument); const ScRange* pRange = (bValid && aRangeList.size() == 1) ? &aRangeList[0] : nullptr; if (pRange) { @@ -242,7 +242,7 @@ IMPL_LINK_NOARG( ScStatisticsInputOutputDialog, RefInputModifyHandler, formula:: else if (mpActiveEdit == mxOutputRangeEdit.get()) { ScRangeList aRangeList; - bool bValid = ParseWithNames( aRangeList, mxOutputRangeEdit->GetText(), mDocument); + bool bValid = ParseWithNames( aRangeList, mxOutputRangeEdit->GetText(), &mDocument); const ScRange* pRange = (bValid && aRangeList.size() == 1) ? &aRangeList[0] : nullptr; if (pRange) { @@ -254,7 +254,7 @@ IMPL_LINK_NOARG( ScStatisticsInputOutputDialog, RefInputModifyHandler, formula:: ScRefFlags nFormat = ( mOutputAddress.Tab() == mCurrentAddress.Tab() ) ? ScRefFlags::ADDR_ABS : ScRefFlags::ADDR_ABS_3D; - OUString aReferenceString = mOutputAddress.Format(nFormat, mDocument, mDocument->GetAddressConvention()); + OUString aReferenceString = mOutputAddress.Format(nFormat, &mDocument, mDocument.GetAddressConvention()); mxOutputRangeEdit->SetRefString( aReferenceString ); } diff --git a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx index 8bdc1fa9e019..5640dfaa5222 100644 --- a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx +++ b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx @@ -56,7 +56,7 @@ protected: // Data ScViewData* const mViewData; - ScDocument* const mDocument; + ScDocument& mDocument; ScRange mInputRange; ScAddress::Details const mAddressDetails; |