diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-09-08 08:07:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-08 09:17:04 +0100 |
commit | da3ddf32d35f78ce8c9dce2719692570bc5d6034 (patch) | |
tree | c78c83f897f3e20a4a6fbe22d20bab888c769a95 /svx | |
parent | return RET_CANCEL for ui-previewer (diff) | |
download | core-da3ddf32d35f78ce8c9dce2719692570bc5d6034.tar.gz core-da3ddf32d35f78ce8c9dce2719692570bc5d6034.zip |
coverity#1237353 Unchecked dynamic_cast
Change-Id: If25d29eaa788e70972fd0cbbf3d03f4d05862f24
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/form/filtnav.cxx | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 828acb1ac2ba..c5c1c3504d35 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1466,29 +1466,25 @@ bool FmFilterNavigator::Select( SvTreeListEntry* pEntry, bool bSelect ) return false; } - void FmFilterNavigator::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) { - if ( dynamic_cast<const FmFilterInsertedHint*>(&rHint) ) + if (const FmFilterInsertedHint* pInsertHint = dynamic_cast<const FmFilterInsertedHint*>(&rHint)) { - const FmFilterInsertedHint* pHint = dynamic_cast<const FmFilterInsertedHint*>(&rHint); - Insert(pHint->GetData(), pHint->GetPos()); + Insert(pInsertHint->GetData(), pInsertHint->GetPos()); } else if( dynamic_cast<const FilterClearingHint*>(&rHint) ) { SvTreeListBox::Clear(); } - else if( dynamic_cast<const FmFilterRemovedHint*>(&rHint) ) + else if (const FmFilterRemovedHint* pRemoveHint = dynamic_cast<const FmFilterRemovedHint*>(&rHint)) { - const FmFilterRemovedHint* pHint = dynamic_cast<const FmFilterRemovedHint*>(&rHint); - Remove(pHint->GetData()); + Remove(pRemoveHint->GetData()); } - else if( dynamic_cast<const FmFilterTextChangedHint*>(&rHint) ) + else if (const FmFilterTextChangedHint *pChangeHint = dynamic_cast<const FmFilterTextChangedHint*>(&rHint)) { - const FmFilterTextChangedHint* pHint = dynamic_cast<const FmFilterTextChangedHint*>(&rHint); - SvTreeListEntry* pEntry = FindEntry(pHint->GetData()); + SvTreeListEntry* pEntry = FindEntry(pChangeHint->GetData()); if (pEntry) - SetEntryText( pEntry, pHint->GetData()->GetText()); + SetEntryText( pEntry, pChangeHint->GetData()->GetText()); } else if( dynamic_cast<const FmFilterCurrentChangedHint*>(&rHint) ) { @@ -1499,7 +1495,6 @@ void FmFilterNavigator::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) } } - SvTreeListEntry* FmFilterNavigator::FindEntry(const FmFilterData* pItem) const { SvTreeListEntry* pEntry = NULL; |