summaryrefslogtreecommitdiff
path: root/svx/source/form
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-10-14 10:11:32 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-10-14 10:59:48 +0100
commit093c4ee9de478ca2273c1fa6eda1f7a62b823b0a (patch)
tree96594e813110f892b8e480dee8ce05244636de85 /svx/source/form
parent72dff7984a26788d8c90f9dd63a1529931376d7f (diff)
coverity#735864 Unchecked dynamic_cast
Change-Id: I669ffab93976a61321f471586256fb52c9bd3451
Diffstat (limited to 'svx/source/form')
-rw-r--r--svx/source/form/filtnav.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 37b37c8a1039..3a021f1070f4 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -424,8 +424,9 @@ void FmFilterAdapter::predicateExpressionChanged( const FilterEvent& _Event ) th
const sal_Int32 nActiveTerm( xFilterController->getActiveTerm() );
- FmFilterItems* pFilter = dynamic_cast<FmFilterItems*>( pFormItem->GetChildren()[ nActiveTerm ] );
- FmFilterItem* pFilterItem = pFilter->Find( _Event.FilterComponent );
+ FmFilterData* pData = pFormItem->GetChildren()[nActiveTerm];
+ FmFilterItems& rFilter = dynamic_cast<FmFilterItems&>(*pData);
+ FmFilterItem* pFilterItem = rFilter.Find( _Event.FilterComponent );
if ( pFilterItem )
{
if ( !_Event.PredicateExpression.isEmpty())
@@ -446,8 +447,8 @@ void FmFilterAdapter::predicateExpressionChanged( const FilterEvent& _Event ) th
// searching the component by field name
OUString aFieldName( lcl_getLabelName_nothrow( xFilterController->getFilterComponent( _Event.FilterComponent ) ) );
- pFilterItem = new FmFilterItem( pFilter, aFieldName, _Event.PredicateExpression, _Event.FilterComponent );
- m_pModel->Insert(pFilter->GetChildren().end(), pFilterItem);
+ pFilterItem = new FmFilterItem(&rFilter, aFieldName, _Event.PredicateExpression, _Event.FilterComponent);
+ m_pModel->Insert(rFilter.GetChildren().end(), pFilterItem);
}
// ensure there's one empty term in the filter, just in case the active term was previously empty