diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-14 12:19:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-14 15:02:43 +0100 |
commit | e00d88cb397374c7891850d4a447a9c477acb022 (patch) | |
tree | b0a74bcee81174c840cbf7343cfff896b1d92080 | |
parent | 90992d512cf4c8c83a02c329d7ac9757c8c3cfce (diff) |
coverity#735980 Unchecked dynamic_cast
Change-Id: I7aa14ff4c89676b41c5d96a75dfd1bcd60eccf80
-rw-r--r-- | sw/source/filter/xml/xmlimpit.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index 71cede038fde..ba243faafbb6 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -850,8 +850,7 @@ bool SvXMLImportItemMapper::PutXMLValue( case RES_FRM_SIZE: { - SwFormatFrmSize* pFrmSize = dynamic_cast<SwFormatFrmSize*>( &rItem ); - OSL_ENSURE( pFrmSize != NULL, "Wrong Which-ID" ); + SwFormatFrmSize& rFrmSize = dynamic_cast<SwFormatFrmSize&>(rItem); bool bSetHeight = false; bool bSetWidth = false; @@ -872,7 +871,7 @@ bool SvXMLImportItemMapper::PutXMLValue( else if( nValue > 100 ) nValue = 100; - pFrmSize->SetWidthPercent( (sal_Int8)nValue ); + rFrmSize.SetWidthPercent( (sal_Int8)nValue ); } } break; @@ -907,8 +906,8 @@ bool SvXMLImportItemMapper::PutXMLValue( else if( nValue > USHRT_MAX ) nValue = USHRT_MAX; - pFrmSize->SetWidth( (sal_uInt16)nValue ); - pFrmSize->SetHeightSizeType( ATT_VAR_SIZE ); + rFrmSize.SetWidth( (sal_uInt16)nValue ); + rFrmSize.SetHeightSizeType( ATT_VAR_SIZE ); bOk = true; } } @@ -923,11 +922,11 @@ bool SvXMLImportItemMapper::PutXMLValue( if( bOk ) { if( bSetWidth ) - pFrmSize->SetWidth( (sal_uInt16)nValue ); + rFrmSize.SetWidth( (sal_uInt16)nValue ); if( bSetHeight ) - pFrmSize->SetHeight( (sal_uInt16)nValue ); + rFrmSize.SetHeight( (sal_uInt16)nValue ); if( bSetSizeType ) - pFrmSize->SetHeightSizeType( eSizeType ); + rFrmSize.SetHeightSizeType( eSizeType ); } } } |