Kaydet (Commit) d9ae37a3 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1257109 Unchecked dynamic_cast

and

coverity#1257108 Unchecked dynamic_cast

Change-Id: Ib0d42b7fcd3b2b87a95301b111cebe80f54dd13f
üst ab61d71c
...@@ -81,7 +81,7 @@ void SwDPage::lateInit(const SwDPage& rPage, SwDrawModel* const pNewModel) ...@@ -81,7 +81,7 @@ void SwDPage::lateInit(const SwDPage& rPage, SwDrawModel* const pNewModel)
SwDrawModel* pSwDrawModel = pNewModel; SwDrawModel* pSwDrawModel = pNewModel;
if ( !pModel ) if ( !pModel )
{ {
pSwDrawModel = dynamic_cast< SwDrawModel* >( GetModel() ); pSwDrawModel = &dynamic_cast<SwDrawModel&>(*GetModel());
assert( pSwDrawModel ); assert( pSwDrawModel );
} }
pDoc = &pSwDrawModel->GetDoc(); pDoc = &pSwDrawModel->GetDoc();
...@@ -98,7 +98,7 @@ SwDPage* SwDPage::Clone(SdrModel* const pNewModel) const ...@@ -98,7 +98,7 @@ SwDPage* SwDPage::Clone(SdrModel* const pNewModel) const
SwDrawModel* pSwDrawModel = 0; SwDrawModel* pSwDrawModel = 0;
if ( pNewModel ) if ( pNewModel )
{ {
pSwDrawModel = dynamic_cast< SwDrawModel* >( pNewModel ); pSwDrawModel = &dynamic_cast<SwDrawModel&>(*pNewModel);
assert( pSwDrawModel ); assert( pSwDrawModel );
} }
pNewPage->lateInit( *this, pSwDrawModel ); pNewPage->lateInit( *this, pSwDrawModel );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment