Hi Christian,
I have modified the codes according to your suggestion. And
I have submitted the codes into my cws. I think the codes is
easier to be read than last time.
> in Writer::Impl_writePolyPolygon you use the method
parameter rPolyPoly.
> You should not do it as it is not clipped. You should
only use aPolyPoly
> as it contains the already clipped polygon. Else you
loose the clipping.
> The following code in Impl_writePolyPolygon seems to be
wrong by using
> both aPolyPoly and aPolyPolgon which was created with
unclipped
> rPolyPoly. This needs a rework.
I am now only using aPolyPoly to have a compare.
map(aPolyPoly) leads to an epsilon in the result, so I
overloaded the IsEqual in Polygon and PolyPolygon.The codes
are like this:
sal_Bool Polygon::IsEqual( const Polygon& rPoly,USHORT
nEpsilon ) const
{
sal_Bool bIsEqual = sal_True;;
sal_uInt16 i;
if ( GetSize() != rPoly.GetSize() )
bIsEqual = sal_False;
else
{
for ( i = 0; i < GetSize(); i++ )
{
if ( ( GetPoint( i ) != rPoly.GetPoint( i ) )
||
( GetFlags( i ) != rPoly.GetFlags( i ) )
)
{
//add fangyq 070822 issue 80199
//a little difference that can be thought
equal
Point aDiffPoint= GetPoint( i
)-rPoly.GetPoint( i );
if((abs(aDiffPoint.getX())<=nEpsilon)&&(abs(aDiff
Point.getY())<=nEpsilon))
continue;
//end issue 80199
bIsEqual = sal_False;
break;
}
}
}
return bIsEqual;
}
> Also I would love to see that the minimum point is
stored inside the
> maShapeIds. The usage of the maIdMinPointMap here seems
overly complex.
> It would be much simpier to store the minimum point
inside the
> sequential maShapeIds vector.
I have add a vector maIdMinPointVector instead maShapeIds.
The codes are like this:
typedef std::pair<sal_uInt16, ::basegfx::B2DPoint>
IdMinPointPair;
std::vector<IdMinPointPair> maIdMinPointVector;
> Please note that the file
"tools/inc/poly.hxx" was moved on the
> master cvs to "tools/inc/tools/poly.hxx". So
before the cws
> can be integrated, it must be resynched and the changes
made
> to "tools/inc/poly.hxx" must be manually
transfered to
> "tools/inc/tools/poly.hxx".
My codes are based on m205, so I will change the codes into
m217 later.
My cws ID is 5598, name is "flashexport01",
milestone is "m205".
I submit a issue about it, it is issue 80199
I add two modules on this cws, they are "filter"
and "tools"
The files I have modified are:
filter/source/flash/swfwrite.hxx add class
PolyPolygonCacheKey
filter/source/flash/swfwrite.cxx add class
PolyPolygonCacheKey
filter/source/flash/swfwrite1.cxx add a cache for complex
charactors
filter/source/flash/swfwrite2.cxx add operator == for class
FillStyle
tools/inc/poly.hxx add operator < for
class PolyPolygon
tools/source/generic/poly2.cxx add operator < and
overload IsEqual() for class PolyPolygon
tools/source/generic/poly.cxx overload IsEqual() for
class Polygon
Looking forward to your suggestions sincerely.
Best regards,
Fang
Fang Yaqiong fangyq ch2000.com.cn
2007-08-23
Regards&Thanks!
Tel:010-5802-2828 Ext.693
Beijing Redflag CH2000 Software Co., Ltd.
|