From 96668295f54fe6c94167e3c198db15ffae7bdf36 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Tue, 24 Jun 2008 09:52:26 +0000 Subject: INTEGRATION: CWS canvas05 (1.5.26); FILE MERGED 2008/04/21 07:31:19 thb 1.5.26.2: RESYNC: (1.5-1.6); FILE MERGED 2007/10/01 13:02:02 thb 1.5.26.1: #i78888# #i78925# #i79258# #i79437# Merge from CWS picom --- canvas/source/tools/verifyinput.cxx | 88 ++++++++++++------------------------- 1 file changed, 28 insertions(+), 60 deletions(-) (limited to 'canvas/source') diff --git a/canvas/source/tools/verifyinput.cxx b/canvas/source/tools/verifyinput.cxx index 08eb67503e2e..a270f6158979 100644 --- a/canvas/source/tools/verifyinput.cxx +++ b/canvas/source/tools/verifyinput.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: verifyinput.cxx,v $ - * $Revision: 1.6 $ + * $Revision: 1.7 $ * * This file is part of OpenOffice.org. * @@ -44,10 +44,9 @@ #include #include #include -#include +#include #include #include -#include #include #include #include @@ -639,67 +638,36 @@ namespace canvas throw lang::IllegalArgumentException(); #endif } - - if( bitmapLayout.NumComponents < 0 ) - { -#if OSL_DEBUG_LEVEL > 0 - throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii(pStr) + - ::rtl::OUString::createFromAscii(": verifyInput(): bitmap layout's NumComponents is negative"), - xIf, - nArgPos ); -#else - throw lang::IllegalArgumentException(); -#endif - } - - if( bitmapLayout.ComponentMasks.getLength() != bitmapLayout.NumComponents ) - { -#if OSL_DEBUG_LEVEL > 0 - throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii(pStr) + - ::rtl::OUString::createFromAscii(": verifyInput(): bitmap layout's number of ComponentMasks elements mismatch NumComponents (is: ") + - ::rtl::OUString::valueOf(bitmapLayout.ComponentMasks.getLength()) + - ::rtl::OUString::createFromAscii(" expected: ") + - ::rtl::OUString::valueOf(bitmapLayout.NumComponents) + - ::rtl::OUString::createFromAscii(")"), - xIf, - nArgPos ); -#else - throw lang::IllegalArgumentException(); -#endif - } - - if( bitmapLayout.Endianness < rendering::Endianness::LITTLE || - bitmapLayout.Endianness > rendering::Endianness::BIG ) + else { + if( bitmapLayout.ColorSpace->getBitsPerPixel() < 0 ) + { #if OSL_DEBUG_LEVEL > 0 - throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii(pStr) + - ::rtl::OUString::createFromAscii(": verifyInput(): bitmap layout's Endianness value is out of range (") + - ::rtl::OUString::valueOf(sal::static_int_cast(bitmapLayout.Endianness)) + - ::rtl::OUString::createFromAscii(" not known)"), - xIf, - nArgPos ); + throw lang::IllegalArgumentException( + ::rtl::OUString::createFromAscii(pStr) + + ::rtl::OUString::createFromAscii(": verifyInput(): bitmap layout's ColorSpace getBitsPerPixel() is negative"), + xIf, + nArgPos ); #else - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException(); #endif - } + } - if( bitmapLayout.Format < rendering::IntegerBitmapFormat::CHUNKY_1BIT || - bitmapLayout.Format > rendering::IntegerBitmapFormat::PLANES_64BIT ) - { + if( bitmapLayout.ColorSpace->getEndianness() < util::Endianness::LITTLE || + bitmapLayout.ColorSpace->getEndianness() > util::Endianness::BIG ) + { #if OSL_DEBUG_LEVEL > 0 - throw lang::IllegalArgumentException( - ::rtl::OUString::createFromAscii(pStr) + - ::rtl::OUString::createFromAscii(": verifyInput(): bitmap layout's Format value is out of range (") + - ::rtl::OUString::valueOf(sal::static_int_cast(bitmapLayout.Format)) + - ::rtl::OUString::createFromAscii(" not known)"), - xIf, - nArgPos ); + throw lang::IllegalArgumentException( + ::rtl::OUString::createFromAscii(pStr) + + ::rtl::OUString::createFromAscii(": verifyInput(): bitmap layout's ColorSpace getEndianness() value is out of range (") + + ::rtl::OUString::valueOf(sal::static_int_cast(bitmapLayout.ColorSpace->getEndianness())) + + ::rtl::OUString::createFromAscii(" not known)"), + xIf, + nArgPos ); #else - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException(); #endif + } } } @@ -762,8 +730,8 @@ namespace canvas #endif } - if( bitmapLayout.Endianness < rendering::Endianness::LITTLE || - bitmapLayout.Endianness > rendering::Endianness::BIG ) + if( bitmapLayout.Endianness < util::Endianness::LITTLE || + bitmapLayout.Endianness > util::Endianness::BIG ) { #if OSL_DEBUG_LEVEL > 0 throw lang::IllegalArgumentException( @@ -778,8 +746,8 @@ namespace canvas #endif } - if( bitmapLayout.Format < rendering::IntegerBitmapFormat::CHUNKY_1BIT || - bitmapLayout.Format > rendering::IntegerBitmapFormat::PLANES_64BIT ) + if( bitmapLayout.Format < rendering::FloatingPointBitmapFormat::HALFFLOAT || + bitmapLayout.Format > rendering::FloatingPointBitmapFormat::DOUBLE ) { #if OSL_DEBUG_LEVEL > 0 throw lang::IllegalArgumentException( -- cgit v1.2.3