diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-10 10:10:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-10 11:36:29 +0000 |
commit | a7b766def2ba508a256e6360a4df9da39d375b6f (patch) | |
tree | 40a666509277dd40cb04ef27ab91782602e36d6c /sw | |
parent | 7413ada041357dcdd529da67203339e8427ca694 (diff) |
coverity#1130356 Unchecked dynamic_cast
Change-Id: I1481729063c20b75841372363ab936154c989b3f
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/frmedt/fefly1.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index a149de874b43..cbcdbcfadaf2 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -794,7 +794,10 @@ void SwFEShell::Insert( const OUString& rGrfName, const OUString& rFltName, StartAllAction(); SwShellCrsr *pStartCursor = dynamic_cast<SwShellCrsr*>(this->GetSwCrsr()); SwShellCrsr *pCursor = pStartCursor; - do { + do + { + if (!pCursor) + break; // Has the anchor not been set or been set incompletely? if( pFlyAttrSet ) @@ -839,8 +842,8 @@ void SwFEShell::Insert( const OUString& rGrfName, const OUString& rFltName, pGrfAttrSet, pFrmFmt ); OSL_ENSURE( pFmt, "Doc->Insert(notxt) failed." ); - } while( (pCursor = dynamic_cast<SwShellCrsr*>(pCursor->GetNext())) - != pStartCursor ); + pCursor = dynamic_cast<SwShellCrsr*>(pCursor->GetNext()); + } while( pCursor != pStartCursor ); EndAllAction(); |