sc/source/ui/StatisticsDialogs/FTestDialog.cxx                 |    4 +-
 sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx |    6 +--
 sc/source/ui/StatisticsDialogs/RegressionDialog.cxx            |    8 ++--
 sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx |   18 
+++++-----
 sc/source/ui/StatisticsDialogs/TTestDialog.cxx                 |    4 +-
 sc/source/ui/StatisticsDialogs/ZTestDialog.cxx                 |    4 +-
 sc/source/ui/inc/RandomNumberGeneratorDialog.hxx               |    2 -
 sc/source/ui/inc/StatisticsTwoVariableDialog.hxx               |    2 -
 8 files changed, 24 insertions(+), 24 deletions(-)

New commits:
commit 5d1f3098bf8aad3a54896eb2505563773428dbbe
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Nov 14 11:55:17 2019 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Nov 14 16:18:01 2019 +0100

    mDocument is assumed to be non-null
    
    Change-Id: I180c0a6d5041c52cef332b07a0ff433e47f2f384
    Reviewed-on: https://gerrit.libreoffice.org/82679
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

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;
commit ab7790334fbc1fb0ac9b292bf8b31b59ffd8d6df
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Nov 14 11:49:33 2019 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Nov 14 16:17:34 2019 +0100

    mpDoc is assumed to be non-null
    
    Change-Id: Iecb34ff0483b522146e1a4e89da71e6a06b0b3c2
    Reviewed-on: https://gerrit.libreoffice.org/82678
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx 
b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
index 0b4bf136e03f..d027d7b24ca4 100644
--- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
@@ -49,7 +49,7 @@ ScRandomNumberGeneratorDialog::ScRandomNumberGeneratorDialog(
                           "modules/scalc/ui/randomnumbergenerator.ui",
                           "RandomNumberGeneratorDialog")
     , mpViewData(pViewData)
-    , mpDoc(pViewData->GetDocument())
+    , mrDoc(*pViewData->GetDocument())
     , mbDialogLostFocus(false)
     , mxInputRangeText(m_xBuilder->weld_label("cell-range-label"))
     , mxInputRangeEdit(new 
formula::RefEdit(m_xBuilder->weld_entry("cell-range-edit")))
@@ -106,7 +106,7 @@ void ScRandomNumberGeneratorDialog::Init()
 void ScRandomNumberGeneratorDialog::GetRangeFromSelection()
 {
     mpViewData->GetSimpleArea(maInputRange);
-    OUString aCurrentString(maInputRange.Format(ScRefFlags::RANGE_ABS_3D, 
mpDoc, mpDoc->GetAddressConvention()));
+    OUString aCurrentString(maInputRange.Format(ScRefFlags::RANGE_ABS_3D, 
&mrDoc, mrDoc.GetAddressConvention()));
     mxInputRangeEdit->SetText( aCurrentString );
 }
 
@@ -334,7 +334,7 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, 
LoseButtonFocusHandler, formula::
 IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, InputRangeModified, 
formula::RefEdit&, void)
 {
     ScRangeList aRangeList;
-    bool bValid = ParseWithNames( aRangeList, mxInputRangeEdit->GetText(), 
mpDoc);
+    bool bValid = ParseWithNames( aRangeList, mxInputRangeEdit->GetText(), 
&mrDoc);
     const ScRange* pRange = (bValid && aRangeList.size() == 1) ? 
&aRangeList[0] : nullptr;
     if (pRange)
     {
diff --git a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx 
b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
index 881b0fbb0c19..b63f549ae574 100644
--- a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
+++ b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
@@ -33,7 +33,7 @@ public:
 private:
     // Data
     ScViewData* const          mpViewData;
-    ScDocument* const          mpDoc;
+    const ScDocument&          mrDoc;
 
     ScRange             maInputRange;
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to