summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-03-25 20:14:41 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-03-27 18:51:52 +0100
commitc62d31f791d7e09fdca5dd185603c78b47f19597 (patch)
tree4a297cc7c8de076a92b6a2edb37ef2da5e637a85 /tools
parent8e5f5d3eb5598bbebcdd4b6536d8af6f0e96b039 (diff)
Simplify #if blocks a little
Change-Id: I2867917e02ef808e4f74175bc146fcbb9bcba7be
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/poly.cxx30
1 files changed, 13 insertions, 17 deletions
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 3d7c1fb788dd..180b67af519b 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -1522,14 +1522,14 @@ SvStream& ReadPolygon( SvStream& rIStream, Polygon& rPoly )
{
// Determine whether we need to write through operators
-#if (SAL_TYPES_SIZEOFLONG) != 4
- if ( true )
-#else
+#if (SAL_TYPES_SIZEOFLONG) == 4
#ifdef OSL_BIGENDIAN
- if ( rIStream.GetNumberFormatInt() != NUMBERFORMAT_INT_BIGENDIAN )
+ if ( rIStream.GetNumberFormatInt() == NUMBERFORMAT_INT_BIGENDIAN )
#else
- if ( rIStream.GetNumberFormatInt() != NUMBERFORMAT_INT_LITTLEENDIAN )
+ if ( rIStream.GetNumberFormatInt() == NUMBERFORMAT_INT_LITTLEENDIAN )
#endif
+ rIStream.Read( rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point) );
+ else
#endif
{
for( i = 0; i < nPoints; i++ )
@@ -1541,8 +1541,6 @@ SvStream& ReadPolygon( SvStream& rIStream, Polygon& rPoly )
rPoly.mpImplPolygon->mpPointAry[i].Y() = nTmpY;
}
}
- else
- rIStream.Read( rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point) );
}
return rIStream;
@@ -1560,14 +1558,17 @@ SvStream& WritePolygon( SvStream& rOStream, const Polygon& rPoly )
{
// Determine whether we need to write through operators
-#if (SAL_TYPES_SIZEOFLONG) != 4
- if ( true )
-#else
+#if (SAL_TYPES_SIZEOFLONG) == 4
#ifdef OSL_BIGENDIAN
- if ( rOStream.GetNumberFormatInt() != NUMBERFORMAT_INT_BIGENDIAN )
+ if ( rOStream.GetNumberFormatInt() == NUMBERFORMAT_INT_BIGENDIAN )
#else
- if ( rOStream.GetNumberFormatInt() != NUMBERFORMAT_INT_LITTLEENDIAN )
+ if ( rOStream.GetNumberFormatInt() == NUMBERFORMAT_INT_LITTLEENDIAN )
#endif
+ {
+ if ( nPoints )
+ rOStream.Write( rPoly.mpImplPolygon->mpPointAry, nPoints*sizeof(Point) );
+ }
+ else
#endif
{
for( i = 0; i < nPoints; i++ )
@@ -1577,11 +1578,6 @@ SvStream& WritePolygon( SvStream& rOStream, const Polygon& rPoly )
.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;