summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-12-05 12:47:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-12-07 10:34:17 +0000
commita08cb3b52ea4a071ce8eb5a1786ea45fd211ab78 (patch)
tree0667c60e438b660211a3df83c1b411e055b1de61 /filter
parent62283fed204e05e3f30a8ae703762d7f96c4e88a (diff)
convert PolyFlags to scoped enum
and remove the XPolyFlags enum, which has the same values and was being converted to PolyFlags anyhow Change-Id: Iaead84933c79a7603698a4e50257dd944df89c41 Reviewed-on: https://gerrit.libreoffice.org/31627 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/flash/swfwriter1.cxx8
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx16
-rw-r--r--filter/source/graphicfilter/icgm/actimpr.cxx6
-rw-r--r--filter/source/graphicfilter/icgm/class4.cxx8
-rw-r--r--filter/source/graphicfilter/icgm/outact.hxx2
-rw-r--r--filter/source/msfilter/escherex.cxx6
-rw-r--r--filter/source/msfilter/msdffimp.cxx2
-rw-r--r--filter/source/svg/svgwriter.cxx2
8 files changed, 25 insertions, 25 deletions
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index f5d4dba7a09f..ef3bbf5118bf 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -127,10 +127,10 @@ void Writer::Impl_addPolygon( BitStream& rBits, const tools::Polygon& rPoly, boo
PolyFlags P1( rPoly.GetFlags( i ) );
PolyFlags P4( rPoly.GetFlags( i + 3 ) );
- if( ( POLY_NORMAL == P1 || POLY_SMOOTH == P1 || POLY_SYMMTR == P1 ) &&
- ( POLY_CONTROL == rPoly.GetFlags( i + 1 ) ) &&
- ( POLY_CONTROL == rPoly.GetFlags( i + 2 ) ) &&
- ( POLY_NORMAL == P4 || POLY_SMOOTH == P4 || POLY_SYMMTR == P4 ) )
+ if( ( PolyFlags::Normal == P1 || PolyFlags::Smooth == P1 || PolyFlags::Symmetric == P1 ) &&
+ ( PolyFlags::Control == rPoly.GetFlags( i + 1 ) ) &&
+ ( PolyFlags::Control == rPoly.GetFlags( i + 2 ) ) &&
+ ( PolyFlags::Normal == P4 || PolyFlags::Smooth == P4 || PolyFlags::Symmetric == P4 ) )
{
Impl_quadBezierApprox( rBits, aLastPoint, d*d,
rPoly.GetPoint( i ).X(), rPoly.GetPoint( i ).Y(),
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 4b79fbc67f41..46a5ebf28b3b 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -718,9 +718,9 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
for(sal_uInt16 a(0); a + 1 < nPoints; a++)
{
if(bCurve
- && POLY_NORMAL != aPoly.GetFlags(a + 1)
+ && PolyFlags::Normal != aPoly.GetFlags(a + 1)
&& a + 2 < nPoints
- && POLY_NORMAL != aPoly.GetFlags(a + 2)
+ && PolyFlags::Normal != aPoly.GetFlags(a + 2)
&& a + 3 < nPoints)
{
const tools::Polygon aSnippet(4,
@@ -1503,10 +1503,10 @@ void PSWriter::ImplAddPath( const tools::Polygon & rPolygon )
ImplMoveTo( rPolygon.GetPoint( 0 ) );
while ( i < nPointCount )
{
- if ( ( rPolygon.GetFlags( i ) == POLY_CONTROL )
+ if ( ( rPolygon.GetFlags( i ) == PolyFlags::Control )
&& ( ( i + 2 ) < nPointCount )
- && ( rPolygon.GetFlags( i + 1 ) == POLY_CONTROL )
- && ( rPolygon.GetFlags( i + 2 ) != POLY_CONTROL ) )
+ && ( rPolygon.GetFlags( i + 1 ) == PolyFlags::Control )
+ && ( rPolygon.GetFlags( i + 2 ) != PolyFlags::Control ) )
{
ImplCurveTo( rPolygon[ i ], rPolygon[ i + 1 ], rPolygon[ i + 2 ], PS_WRAP );
i += 3;
@@ -1591,10 +1591,10 @@ void PSWriter::ImplPolyLine( const tools::Polygon & rPoly )
i = 1;
while ( i < nPointCount )
{
- if ( ( rPoly.GetFlags( i ) == POLY_CONTROL )
+ if ( ( rPoly.GetFlags( i ) == PolyFlags::Control )
&& ( ( i + 2 ) < nPointCount )
- && ( rPoly.GetFlags( i + 1 ) == POLY_CONTROL )
- && ( rPoly.GetFlags( i + 2 ) != POLY_CONTROL ) )
+ && ( rPoly.GetFlags( i + 1 ) == PolyFlags::Control )
+ && ( rPoly.GetFlags( i + 2 ) != PolyFlags::Control ) )
{
ImplCurveTo( rPoly[ i ], rPoly[ i + 1 ], rPoly[ i + 2 ], PS_WRAP );
i += 3;
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx
index 1ad3c3089f5f..0a63a8ea15dc 100644
--- a/filter/source/graphicfilter/icgm/actimpr.cxx
+++ b/filter/source/graphicfilter/icgm/actimpr.cxx
@@ -61,7 +61,7 @@ CGMImpressOutAct::CGMImpressOutAct( CGM& rCGM, const uno::Reference< frame::XMod
mnGroupActCount = mnGroupLevel = 0;
mpGroupLevel = new sal_uInt32[CGM_OUTACT_MAX_GROUP_LEVEL] ();
mpPoints = reinterpret_cast<Point*>(new sal_Int8[ 0x2000 * sizeof( Point ) ]);
- mpFlags = new sal_uInt8[ 0x2000 ];
+ mpFlags = new PolyFlags[ 0x2000 ];
mnIndex = 0;
mpGradient = nullptr;
@@ -941,7 +941,7 @@ void CGMImpressOutAct::RegPolyLine( tools::Polygon& rPolygon, bool bReverse )
for ( sal_uInt16 i = 0; i < nPoints; i++ )
{
mpPoints[ mnIndex + i ] = rPolygon.GetPoint( nPoints - i - 1 );
- mpFlags[ mnIndex + i ] = (sal_Int8)rPolygon.GetFlags( nPoints - i - 1 );
+ mpFlags[ mnIndex + i ] = rPolygon.GetFlags( nPoints - i - 1 );
}
}
else
@@ -949,7 +949,7 @@ void CGMImpressOutAct::RegPolyLine( tools::Polygon& rPolygon, bool bReverse )
for ( sal_uInt16 i = 0; i < nPoints; i++ )
{
mpPoints[ mnIndex + i ] = rPolygon.GetPoint( i );
- mpFlags[ mnIndex + i ] = (sal_Int8)rPolygon.GetFlags( i );
+ mpFlags[ mnIndex + i ] = rPolygon.GetFlags( i );
}
}
mnIndex = mnIndex + nPoints;
diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx
index b215b40f03f9..805b92785fd3 100644
--- a/filter/source/graphicfilter/icgm/class4.cxx
+++ b/filter/source/graphicfilter/icgm/class4.cxx
@@ -715,9 +715,9 @@ void CGM::ImplDoClass4()
for ( sal_uInt16 i = 0; i < nNumberOfPoints; i++ )
{
if ( ( i % 3 ) == 0 )
- aPolygon.SetFlags( i, POLY_NORMAL );
+ aPolygon.SetFlags( i, PolyFlags::Normal );
else
- aPolygon.SetFlags( i, POLY_CONTROL );
+ aPolygon.SetFlags( i, PolyFlags::Control );
}
}
else
@@ -727,8 +727,8 @@ void CGM::ImplDoClass4()
switch ( i & 3 )
{
case 0 :
- case 3 : aPolygon.SetFlags( i, POLY_NORMAL ); break;
- default : aPolygon.SetFlags( i, POLY_CONTROL ); break;
+ case 3 : aPolygon.SetFlags( i, PolyFlags::Normal ); break;
+ default : aPolygon.SetFlags( i, PolyFlags::Control ); break;
}
}
}
diff --git a/filter/source/graphicfilter/icgm/outact.hxx b/filter/source/graphicfilter/icgm/outact.hxx
index a94a4991c872..a83d3b199635 100644
--- a/filter/source/graphicfilter/icgm/outact.hxx
+++ b/filter/source/graphicfilter/icgm/outact.hxx
@@ -46,7 +46,7 @@ class CGMImpressOutAct
sal_uInt32* mpGroupLevel;
sal_uInt16 mnIndex; // figure
- sal_uInt8* mpFlags;
+ PolyFlags* mpFlags;
Point* mpPoints;
tools::PolyPolygon maPolyPolygon;
css::awt::Gradient* mpGradient;
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 8810f9fd57d1..c7d31c423a91 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1951,7 +1951,7 @@ bool EscherPropertyContainer::CreatePolygonProperties(
nTotalPoints += k;
for (sal_uInt16 j = 0; j < k; ++j)
{
- if ( aPolyPolygon[ i ].GetFlags( j ) != POLY_CONTROL )
+ if ( aPolyPolygon[ i ].GetFlags( j ) != PolyFlags::Control )
nTotalBezPoints++;
}
}
@@ -2013,7 +2013,7 @@ bool EscherPropertyContainer::CreatePolygonProperties(
if ( ( i + 1 ) != nPoints )
{
*pPtr++ = 1;
- if ( aPolygon.GetFlags( i + 1 ) == POLY_CONTROL )
+ if ( aPolygon.GetFlags( i + 1 ) == PolyFlags::Control )
{
*pPtr++ = 0x20;
i += 2;
@@ -4669,7 +4669,7 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( bool bFirst )
const tools::Polygon& rPoly = aPolyPoly.GetObject( a );
for ( b = 0; b < rPoly.GetSize(); b++ )
{
- if ( rPoly.GetFlags( b ) != POLY_NORMAL )
+ if ( rPoly.GetFlags( b ) != PolyFlags::Normal )
continue;
const Point& rPt = rPoly[ b ];
sal_uInt32 nDist = (sal_uInt32)hypot( aRefPoint.X - rPt.X(), aRefPoint.Y - rPt.Y() );
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 517a7e5b4fc1..841c546df0bd 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -545,7 +545,7 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
for ( j = 0; bNotFound && ( j < rPolygon.GetSize() ); j++ )
{
PolyFlags eFlags = rPolygon.GetFlags( j );
- if ( eFlags == POLY_NORMAL )
+ if ( eFlags == PolyFlags::Normal )
{
if ( nC == nPointCount )
{
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index a12fc06e3d52..0fdfaa046dc0 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1833,7 +1833,7 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo
{
aPathData += aBlank;
- if ( ( rPoly.GetFlags( n ) == POLY_CONTROL ) && ( ( n + 2 ) < nSize ) )
+ if ( ( rPoly.GetFlags( n ) == PolyFlags::Control ) && ( ( n + 2 ) < nSize ) )
{
if ( nCurrentMode != 'C' )
{