Kaydet (Commit) c62d31f7 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Simplify #if blocks a little

Change-Id: I2867917e02ef808e4f74175bc146fcbb9bcba7be
üst 8e5f5d3e
...@@ -1522,14 +1522,14 @@ SvStream& ReadPolygon( SvStream& rIStream, Polygon& rPoly ) ...@@ -1522,14 +1522,14 @@ SvStream& ReadPolygon( SvStream& rIStream, Polygon& rPoly )
{ {
// Determine whether we need to write through operators // Determine whether we need to write through operators
#if (SAL_TYPES_SIZEOFLONG) != 4 #if (SAL_TYPES_SIZEOFLONG) == 4
if ( true )
#else
#ifdef OSL_BIGENDIAN #ifdef OSL_BIGENDIAN
if ( rIStream.GetNumberFormatInt() != NUMBERFORMAT_INT_BIGENDIAN ) if ( rIStream.GetNumberFormatInt() == NUMBERFORMAT_INT_BIGENDIAN )
#else #else
if ( rIStream.GetNumberFormatInt() != NUMBERFORMAT_INT_LITTLEENDIAN ) if ( rIStream.GetNumberFormatInt() == NUMBERFORMAT_INT_LITTLEENDIAN )
#endif #endif
rIStream.Read( rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point) );
else
#endif #endif
{ {
for( i = 0; i < nPoints; i++ ) for( i = 0; i < nPoints; i++ )
...@@ -1541,8 +1541,6 @@ SvStream& ReadPolygon( SvStream& rIStream, Polygon& rPoly ) ...@@ -1541,8 +1541,6 @@ SvStream& ReadPolygon( SvStream& rIStream, Polygon& rPoly )
rPoly.mpImplPolygon->mpPointAry[i].Y() = nTmpY; rPoly.mpImplPolygon->mpPointAry[i].Y() = nTmpY;
} }
} }
else
rIStream.Read( rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point) );
} }
return rIStream; return rIStream;
...@@ -1560,14 +1558,17 @@ SvStream& WritePolygon( SvStream& rOStream, const Polygon& rPoly ) ...@@ -1560,14 +1558,17 @@ SvStream& WritePolygon( SvStream& rOStream, const Polygon& rPoly )
{ {
// Determine whether we need to write through operators // Determine whether we need to write through operators
#if (SAL_TYPES_SIZEOFLONG) != 4 #if (SAL_TYPES_SIZEOFLONG) == 4
if ( true )
#else
#ifdef OSL_BIGENDIAN #ifdef OSL_BIGENDIAN
if ( rOStream.GetNumberFormatInt() != NUMBERFORMAT_INT_BIGENDIAN ) if ( rOStream.GetNumberFormatInt() == NUMBERFORMAT_INT_BIGENDIAN )
#else #else
if ( rOStream.GetNumberFormatInt() != NUMBERFORMAT_INT_LITTLEENDIAN ) if ( rOStream.GetNumberFormatInt() == NUMBERFORMAT_INT_LITTLEENDIAN )
#endif #endif
{
if ( nPoints )
rOStream.Write( rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point) );
}
else
#endif #endif
{ {
for( i = 0; i < nPoints; i++ ) for( i = 0; i < nPoints; i++ )
...@@ -1577,11 +1578,6 @@ SvStream& WritePolygon( SvStream& rOStream, const Polygon& rPoly ) ...@@ -1577,11 +1578,6 @@ SvStream& WritePolygon( SvStream& rOStream, const Polygon& rPoly )
.WriteInt32( sal::static_int_cast<sal_Int32>( rPoly.mpImplPolygon->mpPointAry[i].Y() ) ); .WriteInt32( sal::static_int_cast<sal_Int32>( rPoly.mpImplPolygon->mpPointAry[i].Y() ) );
} }
} }
else
{
if ( nPoints )
rOStream.Write( rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point) );
}
} }
return rOStream; return rOStream;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment