From c8bb0b241674f6eb834711e8ac18cd5fb6bc5c7f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 26 Jul 2014 21:11:11 +0100 Subject: coverity#704748 Dereference after null check Change-Id: I88552b40658df85bbfbf0848e94085aa8eb649b6 --- sd/source/ui/func/fucopy.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx index a93d7ded0d6f..e237f82e21f4 100644 --- a/sd/source/ui/func/fucopy.cxx +++ b/sd/source/ui/func/fucopy.cxx @@ -134,30 +134,30 @@ void FuCopy::DoExecute( SfxRequest& rReq ) const SfxPoolItem* pPoolItem = NULL; // Count - if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_NUMBER, true, &pPoolItem ) ) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_NUMBER, true, &pPoolItem ) ) nNumber = ( ( const SfxUInt16Item* ) pPoolItem )->GetValue(); // translation - if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_MOVE_X, true, &pPoolItem ) ) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_MOVE_X, true, &pPoolItem ) ) lSizeX = ( ( const SfxInt32Item* ) pPoolItem )->GetValue(); - if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_MOVE_Y, true, &pPoolItem ) ) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_MOVE_Y, true, &pPoolItem ) ) lSizeY = ( ( const SfxInt32Item* ) pPoolItem )->GetValue(); - if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_ANGLE, true, &pPoolItem ) ) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_ANGLE, true, &pPoolItem ) ) lAngle = ( ( const SfxInt32Item* )pPoolItem )->GetValue(); // scale - if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_WIDTH, true, &pPoolItem ) ) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_WIDTH, true, &pPoolItem ) ) lWidth = ( ( const SfxInt32Item* ) pPoolItem )->GetValue(); - if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_HEIGHT, true, &pPoolItem ) ) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_HEIGHT, true, &pPoolItem ) ) lHeight = ( ( const SfxInt32Item* ) pPoolItem )->GetValue(); // start/end color - if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) ) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_START_COLOR, true, &pPoolItem ) ) { aStartColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue(); bColor = true; } - if( SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_END_COLOR, true, &pPoolItem ) ) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( ATTR_COPY_END_COLOR, true, &pPoolItem ) ) { aEndColor = ( ( const XColorItem* ) pPoolItem )->GetColorValue(); if( aStartColor == aEndColor ) -- cgit