Hi Christian,
You said "use a pair to hold id and minimum point inside the maShapeIds vector"
I find it is hard to do so as many other places that use the maShapeIds vector.
If I change it, and other place should be changed too. Not all of them has the
pair with id and minimum point.
>> I used to only use aPolyPoly, but I find that the same aPolypoly cannot be
>> compared to the the same when they are minused the minPoint.
>> But if I use rPolyPoly, the same rPolyPoly is the same after they are
>> minused the minPoint. I don't know why.
> I'm confused here, why do you want to compare a polypolygon with itself?
> If it is still needed you can always create a temporary
> PolyPolygon but please base it on the already clipped APolyPoly.
What I mean is that if I change the code like below, if there are two complext
charactors like "aa", the aPolyPoly of the first "a" minuses its minPoint will
not turn to the result that it is equal with the aPolyPoly of the second "a"
minuses its minPoint.
But the rPolyPoly of the first "a" minuses its minPoint will turn to the result
that it is equal with the rPolyPoly of the second "a" minuses its minPoint.
That's what I puzzled about.
void Writer::Impl_writePolyPolygon( const PolyPolygon& rPolyPoly, sal_Bool
bFilled, const Color& rFillColor, const Color& rLineColor )
{
PolyPolygon aPolyPoly( rPolyPoly );
if( aPolyPoly.Count() )
{
map( aPolyPoly );
if( mpClipPolyPolygon )
rPolyPoly.GetIntersection( *mpClipPolyPolygon, aPolyPoly );
sal_uInt16 nID;
if( bFilled )
{
Color aFillColor( rFillColor );
if( 0 != mnGlobalTransparency )
aFillColor.SetTransparency( mnGlobalTransparency );
FillStyle aStyle( aFillColor );
PolyPolygonCacheKey aPolyPolygonFillStyle(aPolyPoly,aStyle);
::basegfx::B2DPoint aMinB2DPoint =
aPolyPolygonFillStyle.getMinPoint(aPolyPoly);
Point aMinPoint(-aMinB2DPoint.getX(),-aMinB2DPoint.getY());
aPolyPoly.Translate(aMinPoint);
PolyPolygonCacheKey aPolyPolygonFillStyle1(aPolyPoly,aStyle);
std::map<PolyPolygonCacheKey, sal_uInt16>::const_iterator
aIter(maPolyPolygonCacheMap.find(aPolyPolygonFillStyle1));
sal_uInt16 nShapeId=0;
IdMinPoint aIdMinPoint;
if( aIter != maPolyPolygonCacheMap.end() )
{
nShapeId = aIter->second;
maIdMinPointMap.insert(make_pair(nShapeId,aMinB2DPoint));
nID = nShapeId;
}
//end 070720 issue 80199
else
{
nID = defineShape( aPolyPoly, aStyle );
maPolyPolygonCacheMap[aPolyPolygonFillStyle1]=nID;
maIdMinPointMap.insert(make_pair(nID,aMinB2DPoint));
}
}
else
{
Color aLineColor( rLineColor );
if( 0 != mnGlobalTransparency )
aLineColor.SetTransparency( mnGlobalTransparency );
nID = defineShape( aPolyPoly, 1, aLineColor );
}
maShapeIds.push_back( nID );
}
}
Fang Yaqiong [EMAIL PROTECTED]
2007-08-11
Regards&Thanks!
Tel:010-5802-2828 Ext.693
Beijing Redflag CH2000 Software Co., Ltd.