diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-10-27 15:01:25 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-10-27 15:01:25 +0000 |
commit | 475a5ec764e1963f179df43cfa91e1c73b5a97c5 (patch) | |
tree | 9cd518d1e366cd88dc92cdef1355c2d72561a04d /vcl | |
parent | 728c8eb458b5613eb5b8bbe8201dfc33a8a9cd78 (diff) |
CWS-TOOLING: integrate CWS impress178
2009-10-16 19:54:41 +0200 sj r276995 : removed warning
2009-10-16 17:46:12 +0200 sj r276993 : #i103757# applied patch (fixed crash if model changes)
2009-10-16 16:06:07 +0200 sj r276985 : CWS-TOOLING: rebase CWS impress178 to branches/OOO320@276942 (milestone: OOO320:m2)
2009-10-08 13:51:23 +0200 sj r276790 : #i105654# fixed closing of line geometry
2009-10-07 17:26:56 +0200 sj r276762 : #i105606# fixed object shadow
2009-10-07 17:25:39 +0200 sj r276761 : minor improvements
2009-10-07 11:48:26 +0200 af r276745 : #i103047# Prevent context menu of LayoutMenu from being shown when user clicks on background.
2009-10-07 11:33:59 +0200 af r276743 : #i99866# Set position of the design control manually.
2009-10-06 17:18:23 +0200 sj r276721 : minor improvements
2009-10-05 18:34:23 +0200 sj r276692 : #105606# fixed fontsize problem
2009-10-05 17:26:21 +0200 af r276691 : #i105354# Never process more than one request in a row.
2009-10-02 13:24:25 +0200 af r276639 : #i94242# Taking insertion position of slide sorter correctly into account.
2009-10-01 13:46:47 +0200 aw r276602 : #i102224# some Polygon/PolyPolygon usages in SVMConverter ignored the possible curve status of tools::Polygon; added at least an AdaptiveSubdivide
2009-10-01 12:33:56 +0200 aw r276588 : #i102224# ImplWritePolyPolygon killed the curve information at the PolyPolygon by NOT copying the flags
2009-09-30 17:48:56 +0200 aw r276567 : #i102224# removed GetSimple() from Polygon and PolyPolygon, replaced completely with AdaptiveSubdivide
2009-09-30 15:45:46 +0200 aw r276559 : #i102048# secured primitive creation for dimension lines with linestyle none
2009-09-30 14:56:41 +0200 af r276556 : #i105471# Reordered statements in ~SdModule.
2009-09-30 14:47:12 +0200 aw r276555 : #i105373# corrected curve ignoring places in MetaFile export
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/cvtsvm.cxx | 40 | ||||
-rw-r--r-- | vcl/source/gdi/metaact.cxx | 37 | ||||
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/region.cxx | 8 |
4 files changed, 71 insertions, 16 deletions
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index c1c02b673658..4ecb89ec5a8e 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -90,12 +90,17 @@ void ImplReadPoly( SvStream& rIStm, Polygon& rPoly ) void ImplWritePoly( SvStream& rOStm, const Polygon& rPoly ) { - INT32 nSize = rPoly.GetSize(); + // #i102224# Here the evtl. curved nature of Polygon was + // ignored (for all those Years). Adapted to at least write + // a polygon representing the curve as good as possible + Polygon aSimplePoly; + rPoly.AdaptiveSubdivide(aSimplePoly); + INT32 nSize = aSimplePoly.GetSize(); rOStm << nSize; for( INT32 i = 0; i < nSize; i++ ) - rOStm << rPoly[ (USHORT) i ]; + rOStm << aSimplePoly[ (USHORT) i ]; } // ------------------------------------------------------------------------ @@ -131,13 +136,18 @@ void ImplWritePolyPolyAction( SvStream& rOStm, const PolyPolygon& rPolyPoly ) for( n = 0; n < nPoly; n++ ) { + // #i102224# Here the evtl. curved nature of Polygon was + // ignored (for all those Years). Adapted to at least write + // a polygon representing the curve as good as possible const Polygon& rPoly = rPolyPoly[ n ]; - const USHORT nSize = rPoly.GetSize(); + Polygon aSimplePoly; + rPoly.AdaptiveSubdivide(aSimplePoly); + const USHORT nSize = aSimplePoly.GetSize(); rOStm << (INT32) nSize; for( USHORT j = 0; j < nSize; j++ ) - rOStm << rPoly[ j ]; + rOStm << aSimplePoly[ j ]; } } @@ -1354,8 +1364,15 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { MetaPolyLineAction* pAct = (MetaPolyLineAction*) pAction; const Polygon& rPoly = pAct->GetPolygon(); + + // #i102224# Here the evtl. curved nature of Polygon was + // ignored (for all those Years). Adapted to at least write + // a polygon representing the curve as good as possible + Polygon aSimplePoly; + rPoly.AdaptiveSubdivide(aSimplePoly); + const LineInfo& rInfo = pAct->GetLineInfo(); - const USHORT nPoints = rPoly.GetSize(); + const USHORT nPoints = aSimplePoly.GetSize(); const BOOL bFatLine = ( !rInfo.IsDefault() && ( LINE_NONE != rInfo.GetStyle() ) ); if( bFatLine ) @@ -1369,7 +1386,7 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, rOStm << (INT32) nPoints; for( USHORT n = 0; n < nPoints; n++ ) - rOStm << rPoly[ n ]; + rOStm << aSimplePoly[ n ]; nCount++; @@ -1385,14 +1402,21 @@ ULONG SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { MetaPolygonAction* pAct = (MetaPolygonAction*) pAction; const Polygon& rPoly = pAct->GetPolygon(); - const USHORT nPoints = rPoly.GetSize(); + + // #i102224# Here the evtl. curved nature of Polygon was + // ignored (for all those Years). Adapted to at least write + // a polygon representing the curve as good as possible + Polygon aSimplePoly; + rPoly.AdaptiveSubdivide(aSimplePoly); + + const USHORT nPoints = aSimplePoly.GetSize(); rOStm << (INT16) GDI_POLYGON_ACTION; rOStm << (INT32) ( 8 + ( nPoints << 3 ) ); rOStm << (INT32) nPoints; for( USHORT n = 0; n < nPoints; n++ ) - rOStm << rPoly[ n ]; + rOStm << aSimplePoly[ n ]; nCount++; } diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 4fe9a41be797..82566b2b4362 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -989,7 +989,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 @@ -1077,7 +1077,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 @@ -1169,7 +1169,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; } @@ -2581,7 +2581,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; } // ------------------------------------------------------------------------ @@ -2649,7 +2655,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; } // ------------------------------------------------------------------------ @@ -3716,7 +3728,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; } diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 0a7a8b765b6b..8a057b3f3c7b 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -4835,7 +4835,7 @@ void OutputDevice::ImplGetEmphasisMark( PolyPolygon& rPolyPoly, BOOL& rPolyLine, double dScale = ((double)nDotSize)/1000.0; aPoly.Scale( dScale, dScale ); Polygon aTemp; - aPoly.GetSimple( aTemp ); + aPoly.AdaptiveSubdivide( aTemp ); Rectangle aBoundRect = aTemp.GetBoundRect(); rWidth = aBoundRect.GetWidth(); nDotSize = aBoundRect.GetHeight(); diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index b98712419cf1..2393270a32f0 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -2534,7 +2534,13 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion ) rOStrm << bHasPolyPolygon; if( bHasPolyPolygon ) - rOStrm << rRegion.GetPolyPolygon(); + { + // #i105373# + PolyPolygon aNoCurvePolyPolygon; + rRegion.GetPolyPolygon().AdaptiveSubdivide(aNoCurvePolyPolygon); + + rOStrm << aNoCurvePolyPolygon; + } } return rOStrm; |