diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-21 20:45:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-21 20:45:23 +0000 |
commit | 761af268383e4e7b62e993b262df012f6e1fb332 (patch) | |
tree | 9bcc3c080dd09e77f4e1f421f68db676c78b97c0 /vcl | |
parent | 56af72b6fa52df8722a6f5b369ec1c2bb39285dd (diff) |
coverity#1399156 split ImplCreateSwapInfo and ImplClearGraphics
Change-Id: Iab449967c70a55c03c3e6b95de8e7d973cb68089
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/impgraph.hxx | 3 | ||||
-rw-r--r-- | vcl/source/gdi/impgraph.cxx | 16 |
2 files changed, 12 insertions, 7 deletions
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 4dea38c03874..6b4babd41db8 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -69,7 +69,8 @@ private: bool operator==( const ImpGraphic& rImpGraphic ) const; bool operator!=( const ImpGraphic& rImpGraphic ) const { return !( *this == rImpGraphic ); } - void ImplClearGraphics( bool bCreateSwapInfo ); + void ImplCreateSwapInfo(); + void ImplClearGraphics(); void ImplClear(); GraphicType ImplGetType() const { return meType;} diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 2fba2a6bc167..1a330c3047a8 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -293,14 +293,17 @@ bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const return bRet; } -void ImpGraphic::ImplClearGraphics( bool bCreateSwapInfo ) +void ImpGraphic::ImplCreateSwapInfo() { - if( bCreateSwapInfo && !ImplIsSwapOut() ) + if (!ImplIsSwapOut()) { maSwapInfo.maPrefMapMode = ImplGetPrefMapMode(); maSwapInfo.maPrefSize = ImplGetPrefSize(); } +} +void ImpGraphic::ImplClearGraphics() +{ maEx.Clear(); maMetaFile.Clear(); @@ -345,12 +348,11 @@ void ImpGraphic::ImplClear() mbSwapOut = false; // cleanup - ImplClearGraphics( false ); + ImplClearGraphics(); meType = GraphicType::NONE; mnSizeBytes = 0; } - void ImpGraphic::ImplSetDefaultType() { ImplClear(); @@ -1180,7 +1182,8 @@ bool ImpGraphic::ImplSwapOut() void ImpGraphic::ImplSwapOutAsLink() { - ImplClearGraphics( true ); + ImplCreateSwapInfo(); + ImplClearGraphics(); mbSwapOut = true; } @@ -1198,7 +1201,8 @@ bool ImpGraphic::ImplSwapOut( SvStream* xOStm ) if( !xOStm->GetError() ) { - ImplClearGraphics( true ); + ImplCreateSwapInfo(); + ImplClearGraphics(); bRet = mbSwapOut = true; } } |