summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2015-08-26 13:50:57 +0200
committerAndras Timar <andras.timar@collabora.com>2015-09-18 10:09:57 +0200
commit0a26c37c80da1c14c27557d8114896522b8e6006 (patch)
tree4a59c386804adbae38183f250c1f63e8a76dc8b7 /filter
parentea1beb0796076274652c2672cef86e91340c9061 (diff)
tdf#93532 - Switching to 64-bit checksum
Added a C++ and a GLSL implementation of a 64-bit CRC algorithm. Changed hardcoded checksum value in ooxmlimport unit test (testN777345). Change-Id: I16bb985a14866775efda49e21fe033ff64645896 Reviewed-on: https://gerrit.libreoffice.org/18254 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
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 f7e5250102de..b9bd58dd39c0 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 2e78abdf7031..bfad3eecac4f 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;
@@ -185,8 +186,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);
void animateShape( ShapeAnimationInfo& rAnimInfo );
void animatePage( PageInfo* pPageInfo );
diff --git a/filter/source/flash/swfwriter.hxx b/filter/source/flash/swfwriter.hxx
index be08fb2fab43..215777bfef26 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 1ffdd486c003..e901529ce8ab 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 )
{
- sal_uLong 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 a697793e5473..794c71342091 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -422,9 +422,9 @@ bool ObjectRepresentation::operator==( const ObjectRepresentation& rPresentation
-sal_uLong GetBitmapChecksum( const MetaAction* pAction )
+BitmapChecksum GetBitmapChecksum( const MetaAction* pAction )
{
- sal_uLong nChecksum = 0;
+ BitmapChecksum nChecksum = 0;
const MetaActionType nType = pAction->GetType();
switch( nType )
@@ -506,8 +506,8 @@ bool EqualityBitmap::operator()( const ObjectRepresentation& rObjRep1,
const GDIMetaFile& aMtf2 = rObjRep2.GetRepresentation();
if( aMtf1.GetActionSize() == 1 && aMtf2.GetActionSize() == 1 )
{
- sal_uLong nChecksum1 = GetBitmapChecksum( aMtf1.GetAction( 0 ) );
- sal_uLong nChecksum2 = GetBitmapChecksum( aMtf2.GetAction( 0 ) );
+ BitmapChecksum nChecksum1 = GetBitmapChecksum( aMtf1.GetAction( 0 ) );
+ BitmapChecksum nChecksum2 = GetBitmapChecksum( aMtf2.GetAction( 0 ) );
return ( nChecksum1 == nChecksum2 );
}
else
@@ -1301,7 +1301,7 @@ bool SVGFilter::implExportTextEmbeddedBitmaps()
MetaAction* pAction = aMtf.GetAction( 0 );
if( pAction )
{
- sal_uLong 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 56c5f76199e3..98e8484ff5c1 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1361,7 +1361,7 @@ void SVGTextWriter::writeBitmapPlaceholder( const MetaBitmapActionType* pAction
}
// bitmap placeholder element
- sal_uLong nId = SVGActionWriter::GetChecksum( pAction );
+ BitmapChecksum nId = SVGActionWriter::GetChecksum( pAction );
OUString sId = "bitmap-placeholder(" + msShapeId + "." +
OUString::number( nId ) + ")";
@@ -1383,7 +1383,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps()
const GDIMetaFile& rMtf = *mpTextEmbeddedBitmapMtf;
OUString sId, sRefId;
- sal_uLong nId, nChecksum = 0;
+ BitmapChecksum nId, nChecksum = 0;
Point aPt;
Size aSz;
sal_uLong nCount = rMtf.GetActionSize();
@@ -1781,7 +1781,7 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo
return aPathData;
}
-sal_uLong 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 42efe63add03..c99e4cbbd6b0 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -371,7 +371,7 @@ private:
public:
static OUString GetPathString( const tools::PolyPolygon& rPolyPoly, bool bLine );
- static sal_uLong GetChecksum( const MetaAction* pAction );
+ static BitmapChecksum GetChecksum( const MetaAction* pAction );
public: