summaryrefslogtreecommitdiff
path: root/svtools/bmpmaker
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-04-24 12:01:46 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-04-24 12:01:46 +0000
commit3b52155319c1bebe0fe5b475003a274271bfb2fd (patch)
tree3c756b2c657f6f4cbb1c2e5813fbdfe3e5705554 /svtools/bmpmaker
parentbe6415680983725dc8a753c39437a0638f85b4a2 (diff)
INTEGRATION: CWS ause03 (1.10.4.1.24); FILE MERGED
2003/04/01 11:18:05 ka 1.10.4.1.24.1: usage of different color depths is now possible
Diffstat (limited to 'svtools/bmpmaker')
-rw-r--r--svtools/bmpmaker/bmpcore.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/svtools/bmpmaker/bmpcore.cxx b/svtools/bmpmaker/bmpcore.cxx
index afbd4a6e0e33..ef2ecda8e5cb 100644
--- a/svtools/bmpmaker/bmpcore.cxx
+++ b/svtools/bmpmaker/bmpcore.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: bmpcore.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: hr $ $Date: 2003-03-27 14:35:54 $
+ * last change: $Author: vg $ $Date: 2003-04-24 13:01:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -196,7 +196,8 @@ void BmpCreator::ImplCreate( SvStream& rStm,
// create bit vector to hold flags for valid bitmaps
- ::std::bit_vector aValidBmpBitVector( aNameVector.size(), false );
+ ::std::bit_vector aValidBmpBitVector( aNameVector.size(), false );
+ sal_Bool bTrueColor = sal_False;
for( sal_uInt32 n = 0; n < aNameVector.size(); n++ )
{
@@ -246,8 +247,6 @@ void BmpCreator::ImplCreate( SvStream& rStm,
if( ( aSize.Width() > aOneSize.Width() ) || ( aSize.Height() > aOneSize.Height() ) )
Message( String( RTL_CONSTASCII_USTRINGPARAM( "ERROR: Different dimensions in file: " ) ).Append( aString ), EXIT_DIMENSIONERROR );
- else if( aBmp.GetBitCount() != aTotalBmp.GetBitCount() )
- Message( String( RTL_CONSTASCII_USTRINGPARAM( "ERROR: Different color depth in file: ") ).Append( aString ), EXIT_COLORDEPTHERROR );
else
{
Point aPoint;
@@ -256,6 +255,17 @@ void BmpCreator::ImplCreate( SvStream& rStm,
if( !aTotalBmp.IsEmpty() && !aBmp.IsEmpty() && !aDst.IsEmpty() && !aSrc.IsEmpty() )
{
+ const long nBitCount = aBmp.GetBitCount();
+
+ if( ( nBitCount != aTotalBmp.GetBitCount() ) && !bTrueColor )
+ {
+ aTotalBmp.Convert( BMP_CONVERSION_24BIT );
+ bTrueColor = sal_True;
+ }
+
+ if( bTrueColor && ( nBitCount != 24 ) )
+ aBmp.Convert( BMP_CONVERSION_24BIT );
+
aTotalBmp.CopyPixel( aDst, aSrc, &aBmp );
aValidBmpBitVector[ n ] = true;
}