diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-02-02 15:46:33 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-02-02 15:46:33 +0100 |
commit | 72c1fb8c3c6be3c75b9cb26755adafb7d58b10b0 (patch) | |
tree | b2c18f8e3679acaf71c9a9236bf840970845bf08 /sfx2/source | |
parent | 869c73d0d2512e483ceedcc895b7cb86e0974ab2 (diff) |
Avoid unncessary, premature null deref
...when SfxTabPage::Reset (sfx2/source/dialog/tabdlg.cxx) calls into
DoApplyFlags/DoRest with a null rSet (but which apparently isn't actually used
then), e.g. upon "File - Export as PDF..." in Impress.
Change-Id: Ie2f255694212356fa8fc994287c45f2b4730a5bd
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/dialog/itemconnect.cxx | 34 | ||||
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 4 |
2 files changed, 19 insertions, 19 deletions
diff --git a/sfx2/source/dialog/itemconnect.cxx b/sfx2/source/dialog/itemconnect.cxx index 54446c61d5dc..f5c60ab41896 100644 --- a/sfx2/source/dialog/itemconnect.cxx +++ b/sfx2/source/dialog/itemconnect.cxx @@ -222,16 +222,16 @@ bool ItemConnectionBase::IsActive() const return !(mnFlags & ITEMCONN_INACTIVE); } -void ItemConnectionBase::DoApplyFlags( const SfxItemSet& rItemSet ) +void ItemConnectionBase::DoApplyFlags( const SfxItemSet* pItemSet ) { if( IsActive() ) - ApplyFlags( rItemSet ); + ApplyFlags( pItemSet ); } -void ItemConnectionBase::DoReset( const SfxItemSet& rItemSet ) +void ItemConnectionBase::DoReset( const SfxItemSet* pItemSet ) { if( IsActive() ) - Reset( rItemSet ); + Reset( pItemSet ); } bool ItemConnectionBase::DoFillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet ) @@ -260,13 +260,13 @@ DummyItemConnection::DummyItemConnection( sal_uInt16 nSlot, vcl::Window& rWindow { } -void DummyItemConnection::ApplyFlags( const SfxItemSet& rItemSet ) +void DummyItemConnection::ApplyFlags( const SfxItemSet* pItemSet ) { - bool bKnown = ItemWrapperHelper::IsKnownItem( rItemSet, mnSlot ); + bool bKnown = ItemWrapperHelper::IsKnownItem( *pItemSet, mnSlot ); ModifyControl( GetEnableState( bKnown ), GetShowState( bKnown ) ); } -void DummyItemConnection::Reset( const SfxItemSet& /*rItemSet*/ ) +void DummyItemConnection::Reset( const SfxItemSet* ) { } @@ -284,8 +284,8 @@ class ItemConnectionArrayImpl public: void Append( ItemConnectionBase* pConnection ); - void ApplyFlags( const SfxItemSet& rItemSet ); - void Reset( const SfxItemSet& rItemSet ); + void ApplyFlags( const SfxItemSet* pItemSet ); + void Reset( const SfxItemSet* pItemSet ); bool FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet ); private: @@ -302,16 +302,16 @@ void ItemConnectionArrayImpl::Append( ItemConnectionBase* pConnection ) maList.push_back( ItemConnectionRef( pConnection ) ); } -void ItemConnectionArrayImpl::ApplyFlags( const SfxItemSet& rItemSet ) +void ItemConnectionArrayImpl::ApplyFlags( const SfxItemSet* pItemSet ) { for( ItemConnectionListIt aIt = maList.begin(), aEnd = maList.end(); aIt != aEnd; ++aIt ) - (*aIt)->DoApplyFlags( rItemSet ); + (*aIt)->DoApplyFlags( pItemSet ); } -void ItemConnectionArrayImpl::Reset( const SfxItemSet& rItemSet ) +void ItemConnectionArrayImpl::Reset( const SfxItemSet* pItemSet ) { for( ItemConnectionListIt aIt = maList.begin(), aEnd = maList.end(); aIt != aEnd; ++aIt ) - (*aIt)->DoReset( rItemSet ); + (*aIt)->DoReset( pItemSet ); } bool ItemConnectionArrayImpl::FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet ) @@ -338,14 +338,14 @@ void ItemConnectionArray::AddConnection( ItemConnectionBase* pConnection ) mxImpl->Append( pConnection ); } -void ItemConnectionArray::ApplyFlags( const SfxItemSet& rItemSet ) +void ItemConnectionArray::ApplyFlags( const SfxItemSet* pItemSet ) { - mxImpl->ApplyFlags( rItemSet ); + mxImpl->ApplyFlags( pItemSet ); } -void ItemConnectionArray::Reset( const SfxItemSet& rItemSet ) +void ItemConnectionArray::Reset( const SfxItemSet* pItemSet ) { - mxImpl->Reset( rItemSet ); + mxImpl->Reset( pItemSet ); } bool ItemConnectionArray::FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet ) diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 795b7015c298..e67eb62de8c1 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -188,8 +188,8 @@ bool SfxTabPage::FillItemSet( SfxItemSet* rSet ) void SfxTabPage::Reset( const SfxItemSet* rSet ) { - pImpl->maItemConn.DoApplyFlags( *rSet ); - pImpl->maItemConn.DoReset( *rSet ); + pImpl->maItemConn.DoApplyFlags( rSet ); + pImpl->maItemConn.DoReset( rSet ); } void SfxTabPage::ActivatePage( const SfxItemSet& ) |