sc/inc/address.hxx | 2 +- sc/inc/rangeutl.hxx | 2 +- sc/source/core/tool/address.cxx | 4 ++-- sc/source/core/tool/interpr1.cxx | 4 ++-- sc/source/core/tool/rangeutl.cxx | 12 ++++++------ sc/source/ui/dbgui/PivotLayoutDialog.cxx | 2 +- sc/source/ui/dbgui/consdlg.cxx | 4 ++-- sc/source/ui/miscdlgs/tabopdlg.cxx | 2 +- sc/source/ui/optdlg/tpusrlst.cxx | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-)
New commits: commit c678eba2f06ce7f16939879eedb918f303a4e1b1 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Sep 14 12:26:27 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Sep 15 14:12:36 2020 +0200 ScRangeUtil::IsAbsPos ScDocument* arg dereferenced on all branches Change-Id: Ie42e6eb280886c237b7042948298eef0bd38eebf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102720 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/inc/rangeutl.hxx b/sc/inc/rangeutl.hxx index 601fdee3803f..e0d0f65c2b88 100644 --- a/sc/inc/rangeutl.hxx +++ b/sc/inc/rangeutl.hxx @@ -65,7 +65,7 @@ public: ScAddress::Details const & rDetails = ScAddress::detailsOOOa1 ); static bool IsAbsPos ( const OUString& rPosStr, - const ScDocument* pDoc, + const ScDocument& rDoc, SCTAB nTab, OUString* pCompleteStr, ScRefAddress* pPosTripel = nullptr, diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index 2e5c09ac2b2f..24f62c9c5de5 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -208,7 +208,7 @@ bool ScRangeUtil::IsAbsArea( const OUString& rAreaStr, } bool ScRangeUtil::IsAbsPos( const OUString& rPosStr, - const ScDocument* pDoc, + const ScDocument& rDoc, SCTAB nTab, OUString* pCompleteStr, ScRefAddress* pPosTripel, @@ -216,7 +216,7 @@ bool ScRangeUtil::IsAbsPos( const OUString& rPosStr, { ScRefAddress thePos; - bool bIsAbsPos = ConvertSingleRef( pDoc, rPosStr, nTab, thePos, rDetails ); + bool bIsAbsPos = ConvertSingleRef( &rDoc, rPosStr, nTab, thePos, rDetails ); thePos.SetRelCol( false ); thePos.SetRelRow( false ); thePos.SetRelTab( false ); @@ -226,7 +226,7 @@ bool ScRangeUtil::IsAbsPos( const OUString& rPosStr, if ( pPosTripel ) *pPosTripel = thePos; if ( pCompleteStr ) - *pCompleteStr = thePos.GetRefString( pDoc, MAXTAB+1, rDetails ); + *pCompleteStr = thePos.GetRefString( &rDoc, MAXTAB+1, rDetails ); } return bIsAbsPos; @@ -294,7 +294,7 @@ bool ScRangeUtil::MakeRangeFromName ( { CutPosString( aStrArea, aStrArea ); - if ( IsAbsPos( aStrArea, &rDoc, nTable, + if ( IsAbsPos( aStrArea, rDoc, nTable, nullptr, &aStartPos, rDetails ) ) { nTab = aStartPos.Tab(); diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx index 18a571a3077d..db9f53681a18 100644 --- a/sc/source/ui/dbgui/consdlg.cxx +++ b/sc/source/ui/dbgui/consdlg.cxx @@ -303,7 +303,7 @@ bool ScConsolidateDlg::VerifyEdit( formula::RefEdit* pEd ) OUString aPosStr; ScRangeUtil::CutPosString( pEd->GetText(), aPosStr ); - bEditOk = ScRangeUtil::IsAbsPos( aPosStr, pDoc, + bEditOk = ScRangeUtil::IsAbsPos( aPosStr, *pDoc, nTab, &theCompleteStr, nullptr, eConv ); } @@ -339,7 +339,7 @@ IMPL_LINK_NOARG(ScConsolidateDlg, OkHdl, weld::Button&, void) OUString aDestPosStr( m_xEdDestArea->GetText() ); const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); - if ( ScRangeUtil::IsAbsPos( aDestPosStr, pDoc, nTab, nullptr, &aDestAddress, eConv ) ) + if ( ScRangeUtil::IsAbsPos( aDestPosStr, *pDoc, nTab, nullptr, &aDestAddress, eConv ) ) { ScConsolidateParam theOutParam( theConsData ); std::unique_ptr<ScArea[]> pDataAreas(new ScArea[nDataAreaCount]); diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index 9dbb50e52bdb..e0e4ed90e3c2 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -654,7 +654,7 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, weld::Button&, rBtn, void ) if ( !bAreaOk ) { bAreaOk = ScRangeUtil::IsAbsPos( theAreaStr, - pDoc, + *pDoc, pViewData->GetTabNo(), &theAreaStr, &theStartPos, commit 4e5407429ff3c25ab699b3673ef4ebdeaaceef75 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Sep 14 12:23:55 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Sep 15 14:12:18 2020 +0200 ConvertDoubleRef never passed a null ScDocument* Change-Id: I37702a7070fdafc3c9db962a9746ac9e97adf7de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102719 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index 8a4d9b6afc98..c2304965b240 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -964,7 +964,7 @@ bool ConvertSingleRef( const ScDocument* pDocument, const OUString& rRefString, const ScAddress::Details& rDetails, ScAddress::ExternalInfo* pExtInfo = nullptr ); -bool ConvertDoubleRef( const ScDocument* pDocument, const OUString& rRefString, +bool ConvertDoubleRef( const ScDocument& rDocument, const OUString& rRefString, SCTAB nDefTab, ScRefAddress& rStartRefAddress, ScRefAddress& rEndRefAddress, const ScAddress::Details& rDetails, diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index ffa9fa0ab705..dc820a73582c 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1515,7 +1515,7 @@ bool ConvertSingleRef( const ScDocument* pDoc, const OUString& rRefString, return bRet; } -bool ConvertDoubleRef( const ScDocument* pDoc, const OUString& rRefString, SCTAB nDefTab, +bool ConvertDoubleRef( const ScDocument& rDoc, const OUString& rRefString, SCTAB nDefTab, ScRefAddress& rStartRefAddress, ScRefAddress& rEndRefAddress, const ScAddress::Details& rDetails, ScAddress::ExternalInfo* pExtInfo /* = NULL */ ) @@ -1524,7 +1524,7 @@ bool ConvertDoubleRef( const ScDocument* pDoc, const OUString& rRefString, SCTAB if (pExtInfo || (ScGlobal::FindUnquoted( rRefString, SC_COMPILER_FILE_TAB_SEP) == -1)) { ScRange aRange( ScAddress( 0, 0, nDefTab)); - ScRefFlags nRes = aRange.Parse( rRefString, pDoc, rDetails, pExtInfo); + ScRefFlags nRes = aRange.Parse( rRefString, &rDoc, rDetails, pExtInfo); if ( nRes & ScRefFlags::VALID ) { rStartRefAddress.Set( aRange.aStart, diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 3601881e3404..3c6dea7ce105 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -8092,8 +8092,8 @@ void ScInterpreter::ScIndirect() OUString sRefStr = GetString().getString(); ScRefAddress aRefAd, aRefAd2; ScAddress::ExternalInfo aExtInfo; - if ( ConvertDoubleRef(&mrDoc, sRefStr, nTab, aRefAd, aRefAd2, aDetails, &aExtInfo) || - ( bTryXlA1 && ConvertDoubleRef(&mrDoc, sRefStr, nTab, aRefAd, + if ( ConvertDoubleRef(mrDoc, sRefStr, nTab, aRefAd, aRefAd2, aDetails, &aExtInfo) || + ( bTryXlA1 && ConvertDoubleRef(mrDoc, sRefStr, nTab, aRefAd, aRefAd2, aDetailsXlA1, &aExtInfo) ) ) { if (aExtInfo.mbExternal) diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index 1e709a4b7100..2e5c09ac2b2f 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -56,7 +56,7 @@ bool ScRangeUtil::MakeArea( const OUString& rAreaStr, aStrArea += ":" + rAreaStr.copy( nPointPos+1 ); // do not include '.' in copy } - bSuccess = ConvertDoubleRef( &rDoc, aStrArea, nTab, startPos, endPos, rDetails ); + bSuccess = ConvertDoubleRef( rDoc, aStrArea, nTab, startPos, endPos, rDetails ); if ( bSuccess ) rArea = ScArea( startPos.Tab(), @@ -179,7 +179,7 @@ bool ScRangeUtil::IsAbsArea( const OUString& rAreaStr, ScRefAddress startPos; ScRefAddress endPos; - bool bIsAbsArea = ConvertDoubleRef( &rDoc, rAreaStr, nTab, startPos, endPos, rDetails ); + bool bIsAbsArea = ConvertDoubleRef( rDoc, rAreaStr, nTab, startPos, endPos, rDetails ); if ( bIsAbsArea ) { diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index 294771e955be..fa4be02ab400 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -418,7 +418,7 @@ void ScPivotLayoutDialog::UpdateSourceRange() ScRefAddress aStart; ScRefAddress aEnd; - ConvertDoubleRef(&mrDocument, aSourceString, 1, aStart, aEnd, maAddressDetails); + ConvertDoubleRef(mrDocument, aSourceString, 1, aStart, aEnd, maAddressDetails); aSourceRange.aStart = aStart.GetAddress(); aSourceRange.aEnd = aEnd.GetAddress(); } diff --git a/sc/source/ui/miscdlgs/tabopdlg.cxx b/sc/source/ui/miscdlgs/tabopdlg.cxx index 625b9ca4b393..5fda368f1c40 100644 --- a/sc/source/ui/miscdlgs/tabopdlg.cxx +++ b/sc/source/ui/miscdlgs/tabopdlg.cxx @@ -213,7 +213,7 @@ static bool lcl_Parse( const OUString& rString, const ScDocument& rDoc, SCTAB nC bool bRet = false; const formula::FormulaGrammar::AddressConvention eConv = rDoc.GetAddressConvention(); if ( rString.indexOf(':') != -1 ) - bRet = ConvertDoubleRef( &rDoc, rString, nCurTab, rStart, rEnd, eConv ); + bRet = ConvertDoubleRef( rDoc, rString, nCurTab, rStart, rEnd, eConv ); else { bRet = ConvertSingleRef( &rDoc, rString, nCurTab, rStart, eConv ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits