summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-14 11:55:17 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-14 16:18:01 +0100
commit5d1f3098bf8aad3a54896eb2505563773428dbbe (patch)
tree05c95ac2090694deabddbe3f98e6982bb81b6720 /sc
parentab7790334fbc1fb0ac9b292bf8b31b59ffd8d6df (diff)
mDocument is assumed to be non-null
Change-Id: I180c0a6d5041c52cef332b07a0ff433e47f2f384 Reviewed-on: https://gerrit.libreoffice.org/82679 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/StatisticsDialogs/FTestDialog.cxx4
-rw-r--r--sc/source/ui/StatisticsDialogs/RegressionDialog.cxx8
-rw-r--r--sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx18
-rw-r--r--sc/source/ui/StatisticsDialogs/TTestDialog.cxx4
-rw-r--r--sc/source/ui/StatisticsDialogs/ZTestDialog.cxx4
-rw-r--r--sc/source/ui/inc/StatisticsTwoVariableDialog.hxx2
6 files changed, 20 insertions, 20 deletions
diff --git a/sc/source/ui/StatisticsDialogs/FTestDialog.cxx b/sc/source/ui/StatisticsDialogs/FTestDialog.cxx
index f39b84359925..1fc75ee7f2b2 100644
--- a/sc/source/ui/StatisticsDialogs/FTestDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/FTestDialog.cxx
@@ -41,9 +41,9 @@ const char* ScFTestDialog::GetUndoNameId()
ScRange ScFTestDialog::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> pVariable1Iterator;
if (mGroupedBy == BY_COLUMN)
diff --git a/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx b/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx
index 4441f041e3ef..b5efacb85df4 100644
--- a/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx
@@ -170,9 +170,9 @@ const char* ScRegressionDialog::GetUndoNameId()
ScRange ScRegressionDialog::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.autoReplaceUses3D(mbUse3DAddresses);
mbCalcIntercept = !mxNoInterceptCheckBox->get_active();
@@ -318,8 +318,8 @@ OUString ScRegressionDialog::GetVariableNameFormula(bool bXVar, size_t nIndex, b
ScRefFlags eAddrFlag = mbUse3DAddresses ? ScRefFlags::ADDR_ABS_3D : ScRefFlags::ADDR_ABS;
return bWithLog ? OUString("=CONCAT(\"LN(\";" +
- aAddr.Format(eAddrFlag, mDocument, mDocument->GetAddressConvention()) + ";\")\")") :
- OUString("=" + aAddr.Format(eAddrFlag, mDocument, mDocument->GetAddressConvention()));
+ aAddr.Format(eAddrFlag, &mDocument, mDocument.GetAddressConvention()) + ";\")\")") :
+ OUString("=" + aAddr.Format(eAddrFlag, &mDocument, mDocument.GetAddressConvention()));
}
OUString aDefaultVarName;
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
index dbc78a0dc6e1..3fce491373f7 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
@@ -32,10 +32,10 @@ ScStatisticsTwoVariableDialog::ScStatisticsTwoVariableDialog(
, mxOutputRangeEdit(new formula::RefEdit(m_xBuilder->weld_entry("output-range-edit")))
, mxOutputRangeButton(new formula::RefButton(m_xBuilder->weld_button("output-range-button")))
, mViewData(pViewData)
- , mDocument(pViewData->GetDocument())
+ , mDocument(*pViewData->GetDocument())
, mVariable1Range(ScAddress::INITIALIZE_INVALID)
, mVariable2Range(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"))
@@ -112,18 +112,18 @@ void ScStatisticsTwoVariableDialog::GetRangeFromSelection()
{
mVariable1Range = aCurrentRange;
mVariable1Range.aEnd.SetCol(mVariable1Range.aStart.Col());
- aCurrentString = mVariable1Range.Format(ScRefFlags::RANGE_ABS_3D, mDocument, mAddressDetails);
+ aCurrentString = mVariable1Range.Format(ScRefFlags::RANGE_ABS_3D, &mDocument, mAddressDetails);
mxVariable1RangeEdit->SetText(aCurrentString);
mVariable2Range = aCurrentRange;
mVariable2Range.aStart.SetCol(mVariable2Range.aEnd.Col());
- aCurrentString = mVariable2Range.Format(ScRefFlags::RANGE_ABS_3D, mDocument, mAddressDetails);
+ aCurrentString = mVariable2Range.Format(ScRefFlags::RANGE_ABS_3D, &mDocument, mAddressDetails);
mxVariable2RangeEdit->SetText(aCurrentString);
}
else
{
mVariable1Range = aCurrentRange;
- aCurrentString = mVariable1Range.Format(ScRefFlags::RANGE_ABS_3D, mDocument, mAddressDetails);
+ aCurrentString = mVariable1Range.Format(ScRefFlags::RANGE_ABS_3D, &mDocument, mAddressDetails);
mxVariable1RangeEdit->SetText(aCurrentString);
}
}
@@ -252,7 +252,7 @@ IMPL_LINK_NOARG( ScStatisticsTwoVariableDialog, RefInputModifyHandler, formula::
if (mpActiveEdit == mxVariable1RangeEdit.get())
{
ScRangeList aRangeList;
- bool bValid = ParseWithNames( aRangeList, mxVariable1RangeEdit->GetText(), mDocument);
+ bool bValid = ParseWithNames( aRangeList, mxVariable1RangeEdit->GetText(), &mDocument);
const ScRange* pRange = (bValid && aRangeList.size() == 1) ? &aRangeList[0] : nullptr;
if (pRange)
{
@@ -268,7 +268,7 @@ IMPL_LINK_NOARG( ScStatisticsTwoVariableDialog, RefInputModifyHandler, formula::
else if ( mpActiveEdit == mxVariable2RangeEdit.get() )
{
ScRangeList aRangeList;
- bool bValid = ParseWithNames( aRangeList, mxVariable2RangeEdit->GetText(), mDocument);
+ bool bValid = ParseWithNames( aRangeList, mxVariable2RangeEdit->GetText(), &mDocument);
const ScRange* pRange = (bValid && aRangeList.size() == 1) ? &aRangeList[0] : nullptr;
if (pRange)
{
@@ -284,7 +284,7 @@ IMPL_LINK_NOARG( ScStatisticsTwoVariableDialog, 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)
{
@@ -296,7 +296,7 @@ IMPL_LINK_NOARG( ScStatisticsTwoVariableDialog, 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/StatisticsDialogs/TTestDialog.cxx b/sc/source/ui/StatisticsDialogs/TTestDialog.cxx
index c3fcda8f4d3e..80cb6608e31d 100644
--- a/sc/source/ui/StatisticsDialogs/TTestDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/TTestDialog.cxx
@@ -41,9 +41,9 @@ const char* 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);
+ FormulaTemplate aTemplate(&mDocument);
std::unique_ptr<DataRangeIterator> pVariable1Iterator;
if (mGroupedBy == BY_COLUMN)
diff --git a/sc/source/ui/StatisticsDialogs/ZTestDialog.cxx b/sc/source/ui/StatisticsDialogs/ZTestDialog.cxx
index ef36fb1cccfc..6eb11ac5732f 100644
--- a/sc/source/ui/StatisticsDialogs/ZTestDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/ZTestDialog.cxx
@@ -41,9 +41,9 @@ const char* ScZTestDialog::GetUndoNameId()
ScRange ScZTestDialog::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> pVariable1Iterator;
if (mGroupedBy == BY_COLUMN)
diff --git a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
index 25871ec1ea4f..607e3ac1afe4 100644
--- a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
+++ b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
@@ -56,7 +56,7 @@ protected:
// Data
ScViewData* const mViewData;
- ScDocument* const mDocument;
+ ScDocument& mDocument;
ScRange mVariable1Range;
ScRange mVariable2Range;