summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2015-08-29 14:28:34 +0200
committerMarco Cecchetti <marco.cecchetti@collabora.com>2015-08-31 19:31:15 +0200
commitbf3ae441076e8c10381407b79a20811deacb9ce8 (patch)
treed52a59380d7d4fc89a0d42169e0b755ad6b8e9c2
parent51e1d5790575567420dd420fb1fa9633e7949ce6 (diff)
truncate checksum to 32-bit when it slips inside a file stream
Change-Id: I2cedf8acf73f71529f4090ff2f9fce7ab7663e68
-rw-r--r--filter/source/svg/svgexport.cxx2
-rw-r--r--filter/source/svg/svgwriter.cxx12
-rw-r--r--filter/source/svg/svgwriter.hxx2
3 files changed, 8 insertions, 8 deletions
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 794c71342091..bad1dc555c1c 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1301,7 +1301,7 @@ bool SVGFilter::implExportTextEmbeddedBitmaps()
MetaAction* pAction = aMtf.GetAction( 0 );
if( pAction )
{
- BitmapChecksum nId = GetBitmapChecksum( pAction );
+ sal_uInt32 nId = (sal_uInt32)(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 98e8484ff5c1..9ec32e65cdd1 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
- BitmapChecksum nId = SVGActionWriter::GetChecksum( pAction );
+ sal_uInt32 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;
- BitmapChecksum nId, nChecksum = 0;
+ sal_uInt32 nId, nChecksum = 0;
Point aPt;
Size aSz;
sal_uLong nCount = rMtf.GetActionSize();
@@ -1398,7 +1398,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps()
case( MetaActionType::BMPSCALE ):
{
const MetaBmpScaleAction* pA = static_cast<const MetaBmpScaleAction*>(pAction);
- nChecksum = pA->GetBitmap().GetChecksum();
+ nChecksum = (sal_uInt32)(pA->GetBitmap().GetChecksum());
aPt = pA->GetPoint();
aSz = pA->GetSize();
}
@@ -1406,7 +1406,7 @@ void SVGTextWriter::implWriteEmbeddedBitmaps()
case( MetaActionType::BMPEXSCALE ):
{
const MetaBmpExScaleAction* pA = static_cast<const MetaBmpExScaleAction*>(pAction);
- nChecksum = pA->GetBitmapEx().GetChecksum();
+ nChecksum = (sal_uInt32)(pA->GetBitmapEx().GetChecksum());
aPt = pA->GetPoint();
aSz = pA->GetSize();
}
@@ -1781,13 +1781,13 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo
return aPathData;
}
-BitmapChecksum SVGActionWriter::GetChecksum( const MetaAction* pAction )
+sal_uInt32 SVGActionWriter::GetChecksum( const MetaAction* pAction )
{
GDIMetaFile aMtf;
MetaAction* pA = const_cast<MetaAction*>(pAction);
pA->Duplicate();
aMtf.AddAction( pA );
- return aMtf.GetChecksum();
+ return (sal_uInt32)(aMtf.GetChecksum());
}
void SVGActionWriter::ImplWriteLine( const Point& rPt1, const Point& rPt2,
diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index 808bbadfad6b..b891cc1aa13d 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 BitmapChecksum GetChecksum( const MetaAction* pAction );
+ static sal_uInt32 GetChecksum( const MetaAction* pAction );
public: