diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-06-24 09:52:26 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-06-24 09:52:26 +0000 |
commit | 96668295f54fe6c94167e3c198db15ffae7bdf36 (patch) | |
tree | 5b937eb1ecb543491d44a311d62b267f6251faab /canvas | |
parent | cc8ef06efdbb033eb3d2998afad9266f55ee9ab1 (diff) |
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
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/tools/verifyinput.cxx | 88 |
1 files changed, 28 insertions, 60 deletions
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 <com/sun/star/rendering/XCanvas.hpp> #include <com/sun/star/rendering/CompositeOperation.hpp> #include <com/sun/star/rendering/TexturingMode.hpp> -#include <com/sun/star/rendering/Endianness.hpp> +#include <com/sun/star/util/Endianness.hpp> #include <com/sun/star/rendering/PathCapType.hpp> #include <com/sun/star/rendering/PathJoinType.hpp> -#include <com/sun/star/rendering/IntegerBitmapFormat.hpp> #include <com/sun/star/rendering/IntegerBitmapLayout.hpp> #include <com/sun/star/rendering/FloatingPointBitmapFormat.hpp> #include <com/sun/star/rendering/FloatingPointBitmapLayout.hpp> @@ -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<sal_Int32>(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<sal_Int32>(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<sal_Int32>(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( |