sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx | 2 - sc/source/ui/StatisticsDialogs/SamplingDialog.cxx | 4 +- sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx | 4 +- sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx | 6 +-- sc/source/ui/inc/anyrefdg.hxx | 4 +- sc/source/ui/miscdlgs/anyrefdg.cxx | 16 +++++----- sc/source/ui/miscdlgs/optsolver.cxx | 2 - 7 files changed, 19 insertions(+), 19 deletions(-)
New commits: commit 285538be45d03e524a404d072a9b0178c74baeaf Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Nov 14 12:06:06 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Nov 14 16:44:40 2019 +0100 ParseWithNames pDoc arg assumed to be non-null Change-Id: I97451daf3a99ace4c936912a3978dfaee8fe9fb2 Reviewed-on: https://gerrit.libreoffice.org/82681 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 d027d7b24ca4..fcde4b6c59ae 100644 --- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx @@ -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(), &mrDoc); + 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/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx index 77838143419a..85dc8cb9a0d0 100644 --- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx @@ -497,7 +497,7 @@ IMPL_LINK_NOARG(ScSamplingDialog, RefInputModifyHandler, formula::RefEdit&, void 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) { @@ -515,7 +515,7 @@ IMPL_LINK_NOARG(ScSamplingDialog, RefInputModifyHandler, formula::RefEdit&, void 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) { diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx index afe85effa5a2..ee017c67254d 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx @@ -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) { diff --git a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx index 3fce491373f7..f7794b5381df 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx @@ -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) { diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx index 2aa5b84ceee7..4d18444583ac 100644 --- a/sc/source/ui/inc/anyrefdg.hxx +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -58,7 +58,7 @@ public: void ShowSimpleReference(const OUString& rStr); void ShowFormulaReference(const OUString& rStr); - bool ParseWithNames( ScRangeList& rRanges, const OUString& rStr, const ScDocument* pDoc ); + bool ParseWithNames( ScRangeList& rRanges, const OUString& rStr, const ScDocument& rDoc ); void Init(); void ShowReference(const OUString& rStr); @@ -102,7 +102,7 @@ protected: virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = nullptr ) override; virtual void RefInputDone( bool bForced = false ) override; - bool ParseWithNames( ScRangeList& rRanges, const OUString& rStr, const ScDocument* pDoc ); + bool ParseWithNames( ScRangeList& rRanges, const OUString& rStr, const ScDocument& pDoc ); public: ScRefHandler(SfxDialogController &rController, SfxBindings* pB, bool bBindRef); diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index 406c9bf57cdb..484352be29b7 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -123,7 +123,7 @@ void ScFormulaReferenceHelper::ShowSimpleReference(const OUString& rStr) pTabViewShell->DoneRefMode(); pTabViewShell->ClearHighlightRanges(); - if( ParseWithNames( aRangeList, rStr, pDoc ) ) + if( ParseWithNames( aRangeList, rStr, *pDoc ) ) { for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i ) { @@ -136,14 +136,14 @@ void ScFormulaReferenceHelper::ShowSimpleReference(const OUString& rStr) } } -bool ScFormulaReferenceHelper::ParseWithNames( ScRangeList& rRanges, const OUString& rStr, const ScDocument* pDoc ) +bool ScFormulaReferenceHelper::ParseWithNames( ScRangeList& rRanges, const OUString& rStr, const ScDocument& rDoc ) { rRanges.RemoveAll(); if (rStr.isEmpty()) return true; - ScAddress::Details aDetails(pDoc->GetAddressConvention(), 0, 0); + ScAddress::Details aDetails(rDoc.GetAddressConvention(), 0, 0); bool bError = false; sal_Int32 nIdx {0}; @@ -152,7 +152,7 @@ bool ScFormulaReferenceHelper::ParseWithNames( ScRangeList& rRanges, const OUStr ScRange aRange; OUString aRangeStr( rStr.getToken( 0, ';', nIdx ) ); - ScRefFlags nFlags = aRange.ParseAny( aRangeStr, pDoc, aDetails ); + ScRefFlags nFlags = aRange.ParseAny( aRangeStr, &rDoc, aDetails ); if ( nFlags & ScRefFlags::VALID ) { if ( (nFlags & ScRefFlags::TAB_3D) == ScRefFlags::ZERO ) @@ -161,7 +161,7 @@ bool ScFormulaReferenceHelper::ParseWithNames( ScRangeList& rRanges, const OUStr aRange.aEnd.SetTab( aRange.aStart.Tab() ); rRanges.push_back( aRange ); } - else if ( ScRangeUtil::MakeRangeFromName( aRangeStr, pDoc, m_nRefTab, aRange, RUTL_NAMES, aDetails ) ) + else if ( ScRangeUtil::MakeRangeFromName( aRangeStr, &rDoc, m_nRefTab, aRange, RUTL_NAMES, aDetails ) ) rRanges.push_back( aRange ); else bError = true; @@ -294,7 +294,7 @@ void ScFormulaReferenceHelper::ReleaseFocus( formula::RefEdit* pEdit ) const ScViewData& rViewData = pViewShell->GetViewData(); ScDocument* pDoc = rViewData.GetDocument(); ScRangeList aRangeList; - if( ParseWithNames( aRangeList, m_pRefEdit->GetText(), pDoc ) ) + if( ParseWithNames( aRangeList, m_pRefEdit->GetText(), *pDoc ) ) { if ( !aRangeList.empty() ) { @@ -729,9 +729,9 @@ void ScRefHandler::ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* m_aHelper.ToggleCollapsed( pEdit, pButton ); } -bool ScRefHandler::ParseWithNames( ScRangeList& rRanges, const OUString& rStr, const ScDocument* pDoc ) +bool ScRefHandler::ParseWithNames( ScRangeList& rRanges, const OUString& rStr, const ScDocument& rDoc ) { - return m_aHelper.ParseWithNames( rRanges, rStr, pDoc ); + return m_aHelper.ParseWithNames( rRanges, rStr, rDoc ); } void ScRefHandler::HideReference( bool bDoneRefMode ) diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx index e7ff94257ee0..4ce5b8b6ba07 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -813,7 +813,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal // "changing cells" can be several ranges ScRangeList aVarRanges; - if ( !ParseWithNames( aVarRanges, m_xEdVariableCells->GetText(), &mrDoc ) ) + if ( !ParseWithNames( aVarRanges, m_xEdVariableCells->GetText(), mrDoc ) ) { ShowError( false, m_xEdVariableCells.get() ); return false; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits