summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/metaact.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-12-21 20:40:13 +0100
committerArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-12-21 20:40:13 +0100
commitc15bb1c231307a09254adbc1338019d5a49b6024 (patch)
tree41360fbd2279c1d1a088d714389fbdd76959478f /vcl/source/gdi/metaact.cxx
parent3b790d2e0926c75a8a919e02bfad05d1b1aff800 (diff)
parent0c5348ff2c5cede4607555fdab45642db10b07ba (diff)
aw078: resync to DEV300m68for integration
Diffstat (limited to 'vcl/source/gdi/metaact.cxx')
-rw-r--r--vcl/source/gdi/metaact.cxx37
1 files changed, 31 insertions, 6 deletions
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 0587e661b7e8..1f27ad2afe7d 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -982,7 +982,7 @@ void MetaPolyLineAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
WRITE_BASE_COMPAT( rOStm, 3, pData );
Polygon aSimplePoly;
- maPoly.GetSimple( aSimplePoly );
+ maPoly.AdaptiveSubdivide( aSimplePoly );
rOStm << aSimplePoly; // Version 1
rOStm << maLineInfo; // Version 2
@@ -1070,7 +1070,7 @@ void MetaPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
WRITE_BASE_COMPAT( rOStm, 2, pData );
Polygon aSimplePoly; // Version 1
- maPoly.GetSimple( aSimplePoly );
+ maPoly.AdaptiveSubdivide( aSimplePoly );
rOStm << aSimplePoly;
sal_uInt8 bHasPolyFlags = maPoly.HasFlags(); // Version 2
@@ -1162,7 +1162,7 @@ void MetaPolyPolygonAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
const Polygon& rPoly = maPolyPoly.GetObject( i );
if ( rPoly.HasFlags() )
nNumberOfComplexPolygons++;
- rPoly.GetSimple( aSimplePoly );
+ rPoly.AdaptiveSubdivide( aSimplePoly );
rOStm << aSimplePoly;
}
@@ -2586,7 +2586,13 @@ sal_Bool MetaGradientExAction::Compare( const MetaAction& rMetaAction ) const
void MetaGradientExAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maPolyPoly << maGradient;
+
+ // #i105373# see comment at MetaTransparentAction::Write
+ PolyPolygon aNoCurvePolyPolygon;
+ maPolyPoly.AdaptiveSubdivide(aNoCurvePolyPolygon);
+
+ rOStm << aNoCurvePolyPolygon;
+ rOStm << maGradient;
}
// ------------------------------------------------------------------------
@@ -2654,7 +2660,13 @@ sal_Bool MetaHatchAction::Compare( const MetaAction& rMetaAction ) const
void MetaHatchAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maPolyPoly << maHatch;
+
+ // #i105373# see comment at MetaTransparentAction::Write
+ PolyPolygon aNoCurvePolyPolygon;
+ maPolyPoly.AdaptiveSubdivide(aNoCurvePolyPolygon);
+
+ rOStm << aNoCurvePolyPolygon;
+ rOStm << maHatch;
}
// ------------------------------------------------------------------------
@@ -3721,7 +3733,20 @@ sal_Bool MetaTransparentAction::Compare( const MetaAction& rMetaAction ) const
void MetaTransparentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- rOStm << maPolyPoly;
+
+ // #i105373# The PolyPolygon in this action may be a curve; this
+ // was ignored until now what is an error. To make older office
+ // versions work with MetaFiles, i opt for applying AdaptiveSubdivide
+ // to the PolyPoylgon.
+ // The alternative would be to really write the curve information
+ // like in MetaPolyPolygonAction::Write (where someone extended it
+ // correctly, but not here :-( ).
+ // The golden solution would be to combine both, but i think it's
+ // not necessary; a good subdivision will be sufficient.
+ PolyPolygon aNoCurvePolyPolygon;
+ maPolyPoly.AdaptiveSubdivide(aNoCurvePolyPolygon);
+
+ rOStm << aNoCurvePolyPolygon;
rOStm << mnTransPercent;
}