From c458fbad3ed7d5cdea6b2f1c28d98ecec2d3b10e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 13 Oct 2015 20:56:17 +0100 Subject: coverity#1326210 Unchecked dynamic_cast Change-Id: I729af592a74aff7c40a5ae5311d8c5aff2ddee04 --- svx/source/fmcomp/gridcell.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'svx') 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( m_pCell) != nullptr) - dynamic_cast( m_pCell)->Update( ); + if (FmXFilterCell* pCell = dynamic_cast(m_pCell)) + pCell->Update(); else if (pRow && pRow->IsValid() && m_nFieldPos >= 0 && m_pCell && pRow->HasField(m_nFieldPos)) { - dynamic_cast( m_pCell)->UpdateFromField( pRow->GetField( m_nFieldPos ).getColumn(), xFormatter ); + dynamic_cast(*m_pCell).UpdateFromField( pRow->GetField( m_nFieldPos ).getColumn(), xFormatter ); } } - bool DbGridColumn::Commit() { bool bResult = true; -- cgit