[Libreoffice-commits] core.git: tools/source
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Tue Nov 17 16:55:35 UTC 2020
tools/source/generic/poly.cxx | 43 +++++++-----------------------------------
1 file changed, 8 insertions(+), 35 deletions(-)
New commits:
commit 97f084b10caa971ee08730c80a3c3cde85c9475e
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Nov 17 15:00:53 2020 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Nov 17 17:54:56 2020 +0100
Fix vcl_svm_test after making tools::Long 64-bit on _WIN64
Just don't rely on details of Point implementation.
Change-Id: I0cd0d6b7cacbf2751803a854d78e4b099ccf197f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105978
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
Tested-by: Jenkins
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 5a4a79be984c..a88a9fd9ec00 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -1621,24 +1621,12 @@ SvStream& ReadPolygon( SvStream& rIStream, tools::Polygon& rPoly )
rPoly.mpImplPolygon->ImplSetSize( nPoints, false );
- // Determine whether we need to write through operators
-#if (SAL_TYPES_SIZEOFLONG) == 4
-#ifdef OSL_BIGENDIAN
- if ( rIStream.GetEndian() == SvStreamEndian::BIG )
-#else
- if ( rIStream.GetEndian() == SvStreamEndian::LITTLE )
-#endif
- rIStream.ReadBytes(rPoly.mpImplPolygon->mxPointAry.get(), nPoints*sizeof(Point));
- else
-#endif
+ for (i = 0; i < nPoints; i++)
{
- for( i = 0; i < nPoints; i++ )
- {
- sal_Int32 nTmpX(0), nTmpY(0);
- rIStream.ReadInt32( nTmpX ).ReadInt32( nTmpY );
- rPoly.mpImplPolygon->mxPointAry[i].setX( nTmpX );
- rPoly.mpImplPolygon->mxPointAry[i].setY( nTmpY );
- }
+ sal_Int32 nTmpX(0), nTmpY(0);
+ rIStream.ReadInt32(nTmpX).ReadInt32(nTmpY);
+ rPoly.mpImplPolygon->mxPointAry[i].setX(nTmpX);
+ rPoly.mpImplPolygon->mxPointAry[i].setY(nTmpY);
}
return rIStream;
@@ -1652,25 +1640,10 @@ SvStream& WritePolygon( SvStream& rOStream, const tools::Polygon& rPoly )
// Write number of points
rOStream.WriteUInt16( nPoints );
- // Determine whether we need to write through operators
-#if (SAL_TYPES_SIZEOFLONG) == 4
-#ifdef OSL_BIGENDIAN
- if ( rOStream.GetEndian() == SvStreamEndian::BIG )
-#else
- if ( rOStream.GetEndian() == SvStreamEndian::LITTLE )
-#endif
- {
- if ( nPoints )
- rOStream.WriteBytes(rPoly.mpImplPolygon->mxPointAry.get(), nPoints*sizeof(Point));
- }
- else
-#endif
+ for (i = 0; i < nPoints; i++)
{
- for( i = 0; i < nPoints; i++ )
- {
- rOStream.WriteInt32( rPoly.mpImplPolygon->mxPointAry[i].X() )
- .WriteInt32( rPoly.mpImplPolygon->mxPointAry[i].Y() );
- }
+ rOStream.WriteInt32(rPoly.mpImplPolygon->mxPointAry[i].X())
+ .WriteInt32(rPoly.mpImplPolygon->mxPointAry[i].Y());
}
return rOStream;
More information about the Libreoffice-commits
mailing list