summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2015-08-27 15:25:11 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-09-01 16:28:46 +0100
commit7fe85d7633a6cb7a921e93d9399c748a41c54bc1 (patch)
treea13cb02d4a7e9e5d355ec68ca46de4da7d75eb6b /filter
parentb5e3aa40586a4cca050b4f74a6f5d9bf90ff8b3a (diff)
Switching to 64-bit checksum: substituted sal_uLong with BitmapChecksum
A typedef sal_uLong BitmapChecksum; has been added to include/vcl/checksum.hxx Wherever needed sal_uLong and sal_Int32 has been substituted with BitmapChecksum. A BITMAP_CHECKSUM_BITS constant equal to the amount of bits used by the BitmapChecksum type has been defined and used in `GraphicID::GetIDString` (vstools/source/graphic/grfcache.cxx). Change-Id: I74bd285089e58a8b18c06233d75b87023c7bf31b
Diffstat (limited to 'filter')
-rw-r--r--filter/source/flash/swfexporter.cxx14
-rw-r--r--filter/source/flash/swfexporter.hxx7
-rw-r--r--filter/source/flash/swfwriter.hxx3
-rw-r--r--filter/source/flash/swfwriter1.cxx2
-rw-r--r--filter/source/svg/svgexport.cxx10
-rw-r--r--filter/source/svg/svgwriter.cxx6
-rw-r--r--filter/source/svg/svgwriter.hxx2
7 files changed, 23 insertions, 21 deletions
diff --git a/filter/source/flash/swfexporter.cxx b/filter/source/flash/swfexporter.cxx
index 8b6be55e7341..8021b087c5a1 100644
--- a/filter/source/flash/swfexporter.cxx
+++ b/filter/source/flash/swfexporter.cxx
@@ -431,8 +431,8 @@ sal_uInt16 FlashExporter::exportDrawPageBackground(sal_uInt16 nPage, Reference<
getMetaFile( xCompMaster, aMtfMaster, true );
getMetaFile( xComponent, aMtfPrivate, true );
- sal_uInt32 masterchecksum = aMtfMaster.GetChecksum();
- sal_uInt32 privatechecksum = aMtfPrivate.GetChecksum();
+ BitmapChecksum masterchecksum = aMtfMaster.GetChecksum();
+ BitmapChecksum privatechecksum = aMtfPrivate.GetChecksum();
// AS: If the slide has its own background
if (privatechecksum)
@@ -484,7 +484,7 @@ sal_uInt16 FlashExporter::exportMasterPageObjects(sal_uInt16 nPage, Reference< X
{
Reference< XShapes > xShapes( xMasterPage, UNO_QUERY );
- sal_uInt32 shapesum = ActionSummer(xShapes);
+ BitmapChecksum shapesum = ActionSummer(xShapes);
ChecksumCache::iterator it = gObjectCache.find(shapesum);
@@ -631,7 +631,7 @@ void FlashExporter::exportShape( const Reference< XShape >& xShape, bool bMaster
getMetaFile( xComponent, aMtf, false, true );
sal_uInt16 nID;
- sal_uInt32 checksum = aMtf.GetChecksum();
+ BitmapChecksum checksum = aMtf.GetChecksum();
ChecksumCache::iterator it = gMetafileCache.find(checksum);
@@ -748,7 +748,7 @@ bool FlashExporter::getMetaFile( Reference< XComponent >&xComponent, GDIMetaFile
return rMtf.GetActionSize() != 0;
}
-sal_uInt32 FlashExporter::ActionSummer(Reference< XShape >& xShape)
+BitmapChecksum FlashExporter::ActionSummer(Reference< XShape >& xShape)
{
Reference< XShapes > xShapes( xShape, UNO_QUERY );
@@ -767,10 +767,10 @@ sal_uInt32 FlashExporter::ActionSummer(Reference< XShape >& xShape)
}
}
-sal_uInt32 FlashExporter::ActionSummer(Reference< XShapes >& xShapes)
+BitmapChecksum FlashExporter::ActionSummer(Reference< XShapes >& xShapes)
{
sal_uInt32 nShapeCount = xShapes->getCount();
- sal_uInt32 shapecount = 0;
+ BitmapChecksum shapecount = 0;
Reference< XShape > xShape2;
diff --git a/filter/source/flash/swfexporter.hxx b/filter/source/flash/swfexporter.hxx
index b1c50240c401..7b086693cd72 100644
--- a/filter/source/flash/swfexporter.hxx
+++ b/filter/source/flash/swfexporter.hxx
@@ -29,11 +29,12 @@
#include <com/sun/star/presentation/ClickAction.hpp>
#include <com/sun/star/presentation/FadeEffect.hpp>
#include <osl/file.hxx>
+#include <vcl/checksum.hxx>
#include <vector>
#include <map>
-typedef ::std::map<sal_uInt32, sal_uInt16> ChecksumCache;
+typedef ::std::map<BitmapChecksum, sal_uInt16> ChecksumCache;
class GDIMetaFile;
@@ -179,8 +180,8 @@ private:
void exportShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes, bool bStream, bool bMaster );
void exportShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, bool bMaster);
- sal_uInt32 ActionSummer(::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape);
- sal_uInt32 ActionSummer(::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes);
+ BitmapChecksum ActionSummer(::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape);
+ BitmapChecksum ActionSummer(::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xShapes);
bool getMetaFile( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >&xComponent, GDIMetaFile& rMtf, bool bOnlyBackground = false, bool bExportAsJPEG = false );
diff --git a/filter/source/flash/swfwriter.hxx b/filter/source/flash/swfwriter.hxx
index 19e5235ad0cf..a9a795f34de7 100644
--- a/filter/source/flash/swfwriter.hxx
+++ b/filter/source/flash/swfwriter.hxx
@@ -23,6 +23,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <vcl/checksum.hxx>
#include <vcl/font.hxx>
#include <vcl/gradient.hxx>
#include <vcl/vclptr.hxx>
@@ -106,7 +107,7 @@ sal_uInt32 getFixed( double fValue );
-typedef ::std::map<sal_uInt32, sal_uInt16> ChecksumCache;
+typedef ::std::map<BitmapChecksum, sal_uInt16> ChecksumCache;
/** unsigned int 16 compare operation for stl */
struct ltuint16
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index db9f332d7b8a..ac7f94dfed62 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -787,7 +787,7 @@ void getBitmapData( const BitmapEx& aBmpEx, sal_uInt8*& tgadata, sal_uInt8*& tga
sal_uInt16 Writer::defineBitmap( const BitmapEx &bmpSource, sal_Int32 nJPEGQualityLevel )
{
- const sal_uInt32 bmpChecksum = bmpSource.GetChecksum();
+ BitmapChecksum bmpChecksum = bmpSource.GetChecksum();
ChecksumCache::iterator it = mBitmapCache.find(bmpChecksum);
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 87891dcce71d..1773740f5754 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -424,9 +424,9 @@ bool ObjectRepresentation::operator==( const ObjectRepresentation& rPresentation
namespace
{
-sal_uInt32 GetBitmapChecksum( const MetaAction* pAction )
+BitmapChecksum GetBitmapChecksum( const MetaAction* pAction )
{
- sal_uInt32 nChecksum = 0;
+ BitmapChecksum nChecksum = 0;
const MetaActionType nType = pAction->GetType();
switch( nType )
@@ -509,8 +509,8 @@ bool EqualityBitmap::operator()( const ObjectRepresentation& rObjRep1,
const GDIMetaFile& aMtf2 = rObjRep2.GetRepresentation();
if( aMtf1.GetActionSize() == 1 && aMtf2.GetActionSize() == 1 )
{
- const sal_uInt32 nChecksum1 = GetBitmapChecksum( aMtf1.GetAction( 0 ) );
- const sal_uInt32 nChecksum2 = GetBitmapChecksum( aMtf2.GetAction( 0 ) );
+ BitmapChecksum nChecksum1 = GetBitmapChecksum( aMtf1.GetAction( 0 ) );
+ BitmapChecksum nChecksum2 = GetBitmapChecksum( aMtf2.GetAction( 0 ) );
return ( nChecksum1 == nChecksum2 );
}
else
@@ -1302,7 +1302,7 @@ bool SVGFilter::implExportTextEmbeddedBitmaps()
MetaAction* pAction = aMtf.GetAction( 0 );
if( pAction )
{
- const sal_uInt32 nId = GetBitmapChecksum( pAction );
+ BitmapChecksum nId = GetBitmapChecksum( pAction );
sId = "bitmap(" + OUString::number( nId ) + ")";
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sId );
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 73c01f2f7fdc..62b9f29afd26 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1359,7 +1359,7 @@ void SVGTextWriter::writeBitmapPlaceholder( const MetaBitmapActionType* pAction
}
// bitmap placeholder element
- const sal_uInt32 nId = SVGActionWriter::GetChecksum( pAction );
+ BitmapChecksum nId = SVGActionWriter::GetChecksum( pAction );
OUString sId = "bitmap-placeholder(" + msShapeId + "." +
OUString::number( nId ) + ")";
@@ -1381,7 +1381,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps()
const GDIMetaFile& rMtf = *mpTextEmbeddedBitmapMtf;
OUString sId, sRefId;
- sal_uInt32 nChecksum = 0;
+ BitmapChecksum nId, nChecksum = 0;
Point aPt;
Size aSz;
sal_uLong nCount = rMtf.GetActionSize();
@@ -1779,7 +1779,7 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo
return aPathData;
}
-sal_uInt32 SVGActionWriter::GetChecksum( const MetaAction* pAction )
+BitmapChecksum SVGActionWriter::GetChecksum( const MetaAction* pAction )
{
GDIMetaFile aMtf;
MetaAction* pA = const_cast<MetaAction*>(pAction);
diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index e96e5169ff08..280bd52c18f7 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -357,7 +357,7 @@ private:
public:
static OUString GetPathString( const tools::PolyPolygon& rPolyPoly, bool bLine );
- static sal_uInt32 GetChecksum( const MetaAction* pAction );
+ static BitmapChecksum GetChecksum( const MetaAction* pAction );
public: