diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-15 10:18:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-15 12:13:42 +0100 |
commit | 5b74eb68113d3721e1a3f9fa40024bf9b2a15f0c (patch) | |
tree | 1c959ccc7769fd8530a16cc904b5424d04faa208 /vcl/workben | |
parent | b4aa631867638b993fda98b1c4fcfc47e5c6a1aa (diff) |
loplugin:flatten in vcl
Change-Id: I3527477277a9ae96eaf9fd068232f672da7c28c3
Reviewed-on: https://gerrit.libreoffice.org/44753
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/workben')
-rw-r--r-- | vcl/workben/svpclient.cxx | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx index 253ba304fb77..fbd6089617a2 100644 --- a/vcl/workben/svpclient.cxx +++ b/vcl/workben/svpclient.cxx @@ -251,29 +251,30 @@ IMPL_LINK_NOARG( MyWin, SelectHdl, ListBox&, void) { OUString aEntry = m_aSvpBitmaps->GetSelectedEntry(); sal_Int32 nPos = aEntry.indexOf( ": " ); - if( nPos != -1 ) - { - OStringBuffer aCommand( 64 ); - aCommand.append( "get " ); - aCommand.append( OUStringToOString( aEntry.copy( nPos+2 ), RTL_TEXTENCODING_ASCII_US ) ); - OString aAnswer( processCommand( aCommand.makeStringAndClear() ) ); - SvMemoryStream aStream( aAnswer.getLength() ); - aStream.WriteBytes( aAnswer.getStr(), aAnswer.getLength() ); - aStream.Seek( STREAM_SEEK_TO_BEGIN ); - - Graphic aGraphicResult; - GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter(); - rFilter.ImportGraphic( aGraphicResult, OUString("import"), aStream ); - - Bitmap aBitmap = aGraphicResult.GetBitmap(); - - SAL_INFO("vcl", "got bitmap of size " << aBitmap.GetSizePixel().Width() << "x" << aBitmap.GetSizePixel().Height()); - Size aFixedSize( aBitmap.GetSizePixel() ); - aFixedSize.Width() += 10; - aFixedSize.Height() += 10; - m_aImage->SetSizePixel( aFixedSize ); - m_aImage->SetImage( Image( BitmapEx( aBitmap ) ) ); - } + if( nPos == -1 ) + return; + + OStringBuffer aCommand( 64 ); + aCommand.append( "get " ); + aCommand.append( OUStringToOString( aEntry.copy( nPos+2 ), RTL_TEXTENCODING_ASCII_US ) ); + OString aAnswer( processCommand( aCommand.makeStringAndClear() ) ); + SvMemoryStream aStream( aAnswer.getLength() ); + aStream.WriteBytes( aAnswer.getStr(), aAnswer.getLength() ); + aStream.Seek( STREAM_SEEK_TO_BEGIN ); + + Graphic aGraphicResult; + GraphicFilter &rFilter = GraphicFilter::GetGraphicFilter(); + rFilter.ImportGraphic( aGraphicResult, OUString("import"), aStream ); + + Bitmap aBitmap = aGraphicResult.GetBitmap(); + + SAL_INFO("vcl", "got bitmap of size " << aBitmap.GetSizePixel().Width() << "x" << aBitmap.GetSizePixel().Height()); + Size aFixedSize( aBitmap.GetSizePixel() ); + aFixedSize.Width() += 10; + aFixedSize.Height() += 10; + m_aImage->SetSizePixel( aFixedSize ); + m_aImage->SetImage( Image( BitmapEx( aBitmap ) ) ); + } |