diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-28 10:33:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-29 08:51:48 +0200 |
commit | 1ffba0e356608fb6dbf568248e2a953b4d7fb5d6 (patch) | |
tree | 5da59640441292421f2137bc85ee7291daed137e /canvas | |
parent | ce9a41dc387966c74c1af92783a97565b5af3668 (diff) |
loplugin:flatten check for throw in then clause
also make the plugin ignore the case where we have var decl's in the
clause we want to flatten, which could lead to problematic extension of
variable lifetime
Change-Id: I3061f7104e8c6a460bf74f5eac325a516ec50c59
Reviewed-on: https://gerrit.libreoffice.org/42889
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/tools/verifyinput.cxx | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/canvas/source/tools/verifyinput.cxx b/canvas/source/tools/verifyinput.cxx index c5764b38f7aa..9e15738302b4 100644 --- a/canvas/source/tools/verifyinput.cxx +++ b/canvas/source/tools/verifyinput.cxx @@ -550,34 +550,31 @@ namespace canvas throw lang::IllegalArgumentException(); #endif } - else + if( bitmapLayout.ColorSpace->getBitsPerPixel() < 0 ) { - if( bitmapLayout.ColorSpace->getBitsPerPixel() < 0 ) - { #if OSL_DEBUG_LEVEL > 0 - throw lang::IllegalArgumentException( - OUString::createFromAscii(pStr) + - ": verifyInput(): bitmap layout's ColorSpace getBitsPerPixel() is negative", - xIf, nArgPos ); + throw lang::IllegalArgumentException( + OUString::createFromAscii(pStr) + + ": verifyInput(): bitmap layout's ColorSpace getBitsPerPixel() is negative", + xIf, nArgPos ); #else - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException(); #endif - } + } - if( bitmapLayout.ColorSpace->getEndianness() < util::Endianness::LITTLE || - bitmapLayout.ColorSpace->getEndianness() > util::Endianness::BIG ) - { + if( bitmapLayout.ColorSpace->getEndianness() < util::Endianness::LITTLE || + bitmapLayout.ColorSpace->getEndianness() > util::Endianness::BIG ) + { #if OSL_DEBUG_LEVEL > 0 - throw lang::IllegalArgumentException( - OUString::createFromAscii(pStr) + - ": verifyInput(): bitmap layout's ColorSpace getEndianness() value is out of range (" + - OUString::number(sal::static_int_cast<sal_Int32>(bitmapLayout.ColorSpace->getEndianness())) + - " not known)", - xIf, nArgPos ); + throw lang::IllegalArgumentException( + OUString::createFromAscii(pStr) + + ": verifyInput(): bitmap layout's ColorSpace getEndianness() value is out of range (" + + OUString::number(sal::static_int_cast<sal_Int32>(bitmapLayout.ColorSpace->getEndianness())) + + " not known)", + xIf, nArgPos ); #else - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException(); #endif - } } } |