diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-13 20:56:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-13 22:38:35 +0100 |
commit | c458fbad3ed7d5cdea6b2f1c28d98ecec2d3b10e (patch) | |
tree | dac391105e6cfd3c32de343cdec96b2764a9ed6f /svx | |
parent | 5c90069d93ac45e359718a9186ff2366043f43ed (diff) |
coverity#1326210 Unchecked dynamic_cast
Change-Id: I729af592a74aff7c40a5ae5311d8c5aff2ddee04
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index b354ecbc57d6..9ab92b114d78 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -260,18 +260,16 @@ void DbGridColumn::impl_toggleScriptManager_nothrow( bool _bAttach ) } } - void DbGridColumn::UpdateFromField(const DbGridRow* pRow, const Reference< XNumberFormatter >& xFormatter) { - if (m_pCell && dynamic_cast<const FmXFilterCell*>( m_pCell) != nullptr) - dynamic_cast<FmXFilterCell*>( m_pCell)->Update( ); + if (FmXFilterCell* pCell = dynamic_cast<FmXFilterCell*>(m_pCell)) + pCell->Update(); else if (pRow && pRow->IsValid() && m_nFieldPos >= 0 && m_pCell && pRow->HasField(m_nFieldPos)) { - dynamic_cast<FmXDataCell*>( m_pCell)->UpdateFromField( pRow->GetField( m_nFieldPos ).getColumn(), xFormatter ); + dynamic_cast<FmXDataCell&>(*m_pCell).UpdateFromField( pRow->GetField( m_nFieldPos ).getColumn(), xFormatter ); } } - bool DbGridColumn::Commit() { bool bResult = true; |