diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-15 09:46:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-16 09:42:34 +0200 |
commit | 8ef82d25fc806885b42ac9cafe45eb41bd3e1b7b (patch) | |
tree | d9f3b06304aef63d27b96f63301abdb93dedc446 /sc | |
parent | c04ee66c7cfeb725d637b0f9ec3e3b1f8776bfe9 (diff) |
FillProtectedChartRangesVector never passed a null ScDocument*
Change-Id: If090786c7e5834ea3cf990b0b4e9dbd2ec2a56a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102786
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/charthelper.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/charthelper.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/app/drwtrans.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/sc/inc/charthelper.hxx b/sc/inc/charthelper.hxx index 1dc55ffd312a..4889c9de8eff 100644 --- a/sc/inc/charthelper.hxx +++ b/sc/inc/charthelper.hxx @@ -46,7 +46,7 @@ public: const css::uno::Sequence< OUString >& rRanges ); static void AddRangesIfProtectedChart( ScRangeListVector& rRangesVector, const ScDocument* pDocument, SdrObject* pObject ); - static void FillProtectedChartRangesVector( ScRangeListVector& rRangesVector, const ScDocument* pDocument, const SdrPage* pPage ); + static void FillProtectedChartRangesVector( ScRangeListVector& rRangesVector, const ScDocument& rDocument, const SdrPage* pPage ); static void GetChartNames( ::std::vector< OUString >& rChartNames, const SdrPage* pPage ); static void CreateProtectedChartListenersAndNotify( ScDocument& rDoc, const SdrPage* pPage, ScModelObj* pModelObj, SCTAB nTab, const ScRangeListVector& rRangesVector, const ::std::vector< OUString >& rExcludedChartNames, bool bSameDoc = true ); diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx index 13bb73b86f8a..669a622f02ff 100644 --- a/sc/source/core/tool/charthelper.cxx +++ b/sc/source/core/tool/charthelper.cxx @@ -323,15 +323,15 @@ void ScChartHelper::AddRangesIfProtectedChart( ScRangeListVector& rRangesVector, } } -void ScChartHelper::FillProtectedChartRangesVector( ScRangeListVector& rRangesVector, const ScDocument* pDocument, const SdrPage* pPage ) +void ScChartHelper::FillProtectedChartRangesVector( ScRangeListVector& rRangesVector, const ScDocument& rDocument, const SdrPage* pPage ) { - if ( pDocument && pPage ) + if ( pPage ) { SdrObjListIter aIter( pPage, SdrIterMode::DeepNoGroups ); SdrObject* pObject = aIter.Next(); while ( pObject ) { - AddRangesIfProtectedChart( rRangesVector, pDocument, pObject ); + AddRangesIfProtectedChart( rRangesVector, &rDocument, pObject ); pObject = aIter.Next(); } } diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index 2c3c11ca6b9b..246c549c6105 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -201,7 +201,7 @@ ScDrawTransferObj::ScDrawTransferObj( std::unique_ptr<SdrModel> pClipModel, ScDo ScDocument& rDoc = pContainerShell->GetDocument(); if ( pPage ) { - ScChartHelper::FillProtectedChartRangesVector( m_aProtectedChartRangesVector, &rDoc, pPage ); + ScChartHelper::FillProtectedChartRangesVector( m_aProtectedChartRangesVector, rDoc, pPage ); } } } diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 989037bc6369..407c10782fc2 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -269,7 +269,7 @@ bool ScViewFunc::CopyToClipSingleRange( ScDocument* pClipDoc, const ScRangeList& SdrPage* pPage = pDrawLayer->GetPage( static_cast< sal_uInt16 >( nTab ) ); if ( pPage ) { - ScChartHelper::FillProtectedChartRangesVector( rRangesVector, &rDoc, pPage ); + ScChartHelper::FillProtectedChartRangesVector( rRangesVector, rDoc, pPage ); } } } |