remove GetSwapFloat nonsense from all 3 EMF readers
SvStream::ReadFloat already does that, and SvStream is initialised to SvStreamEndian::LITTLE by default. Change-Id: I5859e43014533bcebef9d4b8f0678c516193b92e
This commit is contained in:
@@ -133,20 +133,6 @@ namespace cppcanvas
|
||||
eDy = eDx*f.eM12 + eDy*f.eM22 + f.eDy;
|
||||
}
|
||||
|
||||
#ifdef OSL_BIGENDIAN
|
||||
// little endian <-> big endian switch
|
||||
static float GetSwapFloat( SvStream& rSt )
|
||||
{
|
||||
float fTmp;
|
||||
sal_Int8* pPtr = (sal_Int8*)&fTmp;
|
||||
rSt.ReadSChar( pPtr[3] );
|
||||
rSt.ReadSChar( pPtr[2] );
|
||||
rSt.ReadSChar( pPtr[1] );
|
||||
rSt.ReadSChar( pPtr[0] );
|
||||
return fTmp;
|
||||
}
|
||||
#endif
|
||||
|
||||
friend SvStream& ReadXForm( SvStream& rIn, XForm& rXForm )
|
||||
{
|
||||
if ( sizeof( float ) != 4 )
|
||||
@@ -156,17 +142,8 @@ static float GetSwapFloat( SvStream& rSt )
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef OSL_BIGENDIAN
|
||||
rXForm.eM11 = GetSwapFloat( rIn );
|
||||
rXForm.eM12 = GetSwapFloat( rIn );
|
||||
rXForm.eM21 = GetSwapFloat( rIn );
|
||||
rXForm.eM22 = GetSwapFloat( rIn );
|
||||
rXForm.eDx = GetSwapFloat( rIn );
|
||||
rXForm.eDy = GetSwapFloat( rIn );
|
||||
#else
|
||||
rIn.ReadFloat( rXForm.eM11 ).ReadFloat( rXForm.eM12 ).ReadFloat( rXForm.eM21 ).ReadFloat( rXForm.eM22 )
|
||||
.ReadFloat( rXForm.eDx ).ReadFloat( rXForm.eDy );
|
||||
#endif
|
||||
}
|
||||
return rIn;
|
||||
}
|
||||
|
@@ -43,20 +43,6 @@
|
||||
namespace emfplushelper
|
||||
{
|
||||
|
||||
#ifdef OSL_BIGENDIAN
|
||||
// little endian <-> big endian switch
|
||||
static float GetSwapFloat(SvStream& rStream)
|
||||
{
|
||||
float fTmp;
|
||||
sal_Int8* pPtr = (sal_Int8*)&fTmp;
|
||||
rStream.ReadSChar(pPtr[3]);
|
||||
rStream.ReadSChar(pPtr[2]);
|
||||
rStream.ReadSChar(pPtr[1]);
|
||||
rStream.ReadSChar(pPtr[0]);
|
||||
return fTmp;
|
||||
}
|
||||
#endif
|
||||
|
||||
const char* emfTypeToName(sal_uInt16 type)
|
||||
{
|
||||
switch (type)
|
||||
@@ -265,16 +251,7 @@ namespace emfplushelper
|
||||
float eM22(0.0);
|
||||
float eDx(0.0);
|
||||
float eDy(0.0);
|
||||
#ifdef OSL_BIGENDIAN
|
||||
eM11 = GetSwapFloat(rIn);
|
||||
eM12 = GetSwapFloat(rIn);
|
||||
eM21 = GetSwapFloat(rIn);
|
||||
eM22 = GetSwapFloat(rIn);
|
||||
eDx = GetSwapFloat(rIn);
|
||||
eDy = GetSwapFloat(rIn);
|
||||
#else
|
||||
rIn.ReadFloat(eM11).ReadFloat(eM12).ReadFloat(eM21).ReadFloat(eM22).ReadFloat(eDx).ReadFloat(eDy);
|
||||
#endif
|
||||
rTarget = basegfx::B2DHomMatrix(
|
||||
eM11, eM21, eDx,
|
||||
eM12, eM22, eDy);
|
||||
|
@@ -305,20 +305,6 @@ record_type_name(sal_uInt32 nRecType)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef OSL_BIGENDIAN
|
||||
// little endian <-> big endian switch
|
||||
static float GetSwapFloat(SvStream& rStream)
|
||||
{
|
||||
float fTmp;
|
||||
sal_Int8* pPtr = (sal_Int8*)&fTmp;
|
||||
rStream.ReadSChar(pPtr[3]);
|
||||
rStream.ReadSChar(pPtr[2]);
|
||||
rStream.ReadSChar(pPtr[1]);
|
||||
rStream.ReadSChar(pPtr[0]);
|
||||
return fTmp;
|
||||
}
|
||||
#endif
|
||||
|
||||
struct BLENDFUNCTION
|
||||
{
|
||||
unsigned char aBlendOperation;
|
||||
|
@@ -56,21 +56,12 @@ namespace emfio
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef OSL_BIGENDIAN
|
||||
rXForm.eM11 = GetSwapFloat(rInStream);
|
||||
rXForm.eM12 = GetSwapFloat(rInStream);
|
||||
rXForm.eM21 = GetSwapFloat(rInStream);
|
||||
rXForm.eM22 = GetSwapFloat(rInStream);
|
||||
rXForm.eDx = GetSwapFloat(rInStream);
|
||||
rXForm.eDy = GetSwapFloat(rInStream);
|
||||
#else
|
||||
rInStream.ReadFloat(rXForm.eM11);
|
||||
rInStream.ReadFloat(rXForm.eM12);
|
||||
rInStream.ReadFloat(rXForm.eM21);
|
||||
rInStream.ReadFloat(rXForm.eM22);
|
||||
rInStream.ReadFloat(rXForm.eDx);
|
||||
rInStream.ReadFloat(rXForm.eDy);
|
||||
#endif
|
||||
}
|
||||
return rInStream;
|
||||
}
|
||||
|
Reference in New Issue
Block a user