summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2015-08-27 22:57:15 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-09-01 16:28:46 +0100
commit209951a8ae71ae38d57457a5a85005be8f46dcdf (patch)
tree9bab49617fc392444cc74753d53312531cbe676f /vcl
parentb545728fddad2e70b6a38515b60455fc229e63af (diff)
switch to 64-bit checksum: conversion from BitmapChecksum to an octet array
Defined BitmapChecksumOctetArray which is an array of bytes whose size is the same of BitmapChecksum. Defined a routine for converting a BitmapChecksum into a BitmapChecksumOctetArray. Change-Id: I70d17ab8b841795ae27c60b418d6b090bff604bb
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/animate.cxx5
-rw-r--r--vcl/source/gdi/bitmapex.cxx5
-rw-r--r--vcl/source/gdi/gdimtf.cxx49
3 files changed, 31 insertions, 28 deletions
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index c5803e4ca1ea..4e5b333a81d4 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -209,6 +209,7 @@ sal_uLong Animation::GetSizeBytes() const
BitmapChecksum Animation::GetChecksum() const
{
SVBT32 aBT32;
+ BitmapChecksumOctetArray aBCOA;
BitmapChecksum nCrc = GetBitmapEx().GetChecksum();
UInt32ToSVBT32( maList.size(), aBT32 );
@@ -225,8 +226,8 @@ BitmapChecksum Animation::GetChecksum() const
for( size_t i = 0, nCount = maList.size(); i < nCount; i++ )
{
- UInt32ToSVBT32( maList[ i ]->GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( maList[ i ]->GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
}
return nCrc;
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index ab935d21bc9e..02c29e229b4a 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -312,6 +312,7 @@ BitmapChecksum BitmapEx::GetChecksum() const
{
BitmapChecksum nCrc = aBitmap.GetChecksum();
SVBT32 aBT32;
+ BitmapChecksumOctetArray aBCOA;
UInt32ToSVBT32( (long) eTransparent, aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -321,8 +322,8 @@ BitmapChecksum BitmapEx::GetChecksum() const
if( ( TRANSPARENT_BITMAP == eTransparent ) && !aMask.IsEmpty() )
{
- UInt32ToSVBT32( aMask.GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( aMask.GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
}
return nCrc;
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index d69914e699b0..3201a72cc859 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -2342,12 +2342,13 @@ GDIMetaFile GDIMetaFile::GetMonochromeMtf( const Color& rColor ) const
BitmapChecksum GDIMetaFile::GetChecksum() const
{
- GDIMetaFile aMtf;
- SvMemoryStream aMemStm( 65535, 65535 );
- ImplMetaWriteData aWriteData;
- SVBT16 aBT16;
- SVBT32 aBT32;
- BitmapChecksum nCrc = 0;
+ GDIMetaFile aMtf;
+ SvMemoryStream aMemStm( 65535, 65535 );
+ ImplMetaWriteData aWriteData;
+ SVBT16 aBT16;
+ SVBT32 aBT32;
+ BitmapChecksumOctetArray aBCOA;
+ BitmapChecksum nCrc = 0;
aWriteData.meActualCharSet = aMemStm.GetStreamCharSet();
for( size_t i = 0, nObjCount = GetActionSize(); i < nObjCount; i++ )
@@ -2363,8 +2364,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmap().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2381,8 +2382,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmap().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2405,8 +2406,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmap().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetDestPoint().X(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2441,8 +2442,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmapEx().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmapEx().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2459,8 +2460,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmapEx().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmapEx().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetPoint().X(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2483,8 +2484,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmapEx().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmapEx().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetDestPoint().X(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2519,8 +2520,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmap().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetColor().GetColor(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2540,8 +2541,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmap().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetColor().GetColor(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
@@ -2567,8 +2568,8 @@ BitmapChecksum GDIMetaFile::GetChecksum() const
ShortToSVBT16( static_cast<sal_uInt16>(pAct->GetType()), aBT16 );
nCrc = vcl_get_checksum( nCrc, aBT16, 2 );
- UInt32ToSVBT32( pAct->GetBitmap().GetChecksum(), aBT32 );
- nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
+ BCToBCOA( pAct->GetBitmap().GetChecksum(), aBCOA );
+ nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
UInt32ToSVBT32( pAct->GetColor().GetColor(), aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );