From 8b033402916923c8aa2f40b8c0d630ea89aa3002 Mon Sep 17 00:00:00 2001 From: Pascal Junck Date: Wed, 3 Nov 2004 09:34:18 +0000 Subject: INTEGRATION: CWS aw019 (1.3.6); FILE MERGED 2004/10/21 15:53:25 aw 1.3.6.1: #i34831# --- .../customshapes/EnhancedCustomShapeEngine.cxx | 7 ++- .../customshapes/EnhancedCustomShapeFontWork.cxx | 67 +++++++++++++++++----- 2 files changed, 56 insertions(+), 18 deletions(-) (limited to 'svx/source/customshapes') diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx index ff5d779e03..2aa2c39025 100644 --- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx @@ -2,9 +2,9 @@ * * $RCSfile: EnhancedCustomShapeEngine.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: hr $ $Date: 2004-10-12 14:11:48 $ + * last change: $Author: pjunck $ $Date: 2004-11-03 10:34:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -326,7 +326,8 @@ com::sun::star::drawing::PolyPolygonBezierCoords SAL_CALL EnhancedCustomShapeEng { sal_uInt16 i; for ( i = 0; i < pPP->Count(); i++ ) - aXPolyPoly.Insert( XOutCreatePolygon( pPP->GetObject( i ), NULL, 100 ), XPOLYPOLY_APPEND ); + aXPolyPoly.Insert( XOutCreatePolygon( pPP->GetObject( i )), XPOLYPOLY_APPEND ); +//BFS09 aXPolyPoly.Insert( XOutCreatePolygon( pPP->GetObject( i ), NULL, 100 ), XPOLYPOLY_APPEND ); } delete pNewObj; } diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 4c729f3c39..5891ac82b6 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -2,9 +2,9 @@ * * $RCSfile: EnhancedCustomShapeFontWork.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: hr $ $Date: 2004-10-12 14:12:01 $ + * last change: $Author: pjunck $ $Date: 2004-11-03 10:34:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -126,6 +126,14 @@ #include #include +#ifndef _BGFX_POLYPOLYGON_B2DPOLYGONTOOLS_HXX +#include +#endif + +#ifndef _BGFX_POLYGON_B2DPOLYGONTOOLS_HXX +#include +#endif + using namespace com::sun::star::uno; typedef std::vector< std::vector< double > > PolyPolygonDistances; @@ -570,9 +578,11 @@ void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape ) } } -PolyPolygon GetOutlinesFromShape2d( const SdrObject* pShape2d ) +//BFS09PolyPolygon GetOutlinesFromShape2d( const SdrObject* pShape2d ) +::basegfx::B2DPolyPolygon GetOutlinesFromShape2d( const SdrObject* pShape2d ) { - PolyPolygon aOutlines2d; +//BFS09 PolyPolygon aOutlines2d; + ::basegfx::B2DPolyPolygon aOutlines2d; SdrObjListIter aObjListIter( *pShape2d, IM_DEEPWITHGROUPS ); while( aObjListIter.IsMore() ) @@ -583,17 +593,26 @@ PolyPolygon GetOutlinesFromShape2d( const SdrObject* pShape2d ) if (!((SdrShadowItem&)pPartObj->GetMergedItem( SDRATTR_SHADOW )).GetValue()) { const XPolyPolygon& rXPolyPoly = ((SdrPathObj*)pPartObj)->GetPathPoly(); - sal_uInt16 i, nCount = rXPolyPoly.Count(); - for ( i = 0; i < nCount; i++ ) + ::basegfx::B2DPolyPolygon aCandidate(rXPolyPoly.getB2DPolyPolygon()); + if(aCandidate.areControlPointsUsed()) { - Polygon aPoly( XOutCreatePolygonBezier( rXPolyPoly.GetObject( i ), NULL ) ); - Polygon aSimplePoly; - aPoly.GetSimple( aSimplePoly ); - aOutlines2d.Insert( aSimplePoly, POLYPOLY_APPEND ); + aCandidate = ::basegfx::tools::adaptiveSubdivideByAngle(aCandidate); } + aOutlines2d.append(aCandidate); + +//BFS09 sal_uInt16 i, nCount = rXPolyPoly.Count(); +//BFS09 for ( i = 0; i < nCount; i++ ) +//BFS09 { +//BFS09//BFS09 Polygon aPoly( XOutCreatePolygonBezier( rXPolyPoly.GetObject( i ), NULL ) ); +//BFS09 Polygon aPoly( XOutCreatePolygonBezier( rXPolyPoly.GetObject( i )) ); +//BFS09 Polygon aSimplePoly; +//BFS09 aPoly.GetSimple( aSimplePoly ); +//BFS09 aOutlines2d.Insert( aSimplePoly, POLYPOLY_APPEND ); +//BFS09 } } } } + return aOutlines2d; } @@ -796,13 +815,28 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW sal_uInt16 i, nPolyCount = rPolyPoly.Count(); for ( i = 0; i < nPolyCount; i++ ) { - Polygon& rPoly = rPolyPoly[ i ]; - InsertMissingOutlinePoints( rOutlinePoly, vDistances, rTextAreaBoundRect, rPoly ); - InsertMissingOutlinePoints( rOutlinePoly2, vDistances2, rTextAreaBoundRect, rPoly ); - sal_uInt16 j, nPointCount = rPoly.GetSize(); + // #i35928# + ::basegfx::B2DPolygon aCandidate(rPolyPoly[ i ].getB2DPolygon()); + + if(aCandidate.areControlVectorsUsed()) + { + aCandidate = ::basegfx::tools::adaptiveSubdivideByAngle(aCandidate); + } + + // create local polygon copy to work on + Polygon aLocalPoly(aCandidate); + + InsertMissingOutlinePoints( rOutlinePoly, vDistances, rTextAreaBoundRect, aLocalPoly ); + InsertMissingOutlinePoints( rOutlinePoly2, vDistances2, rTextAreaBoundRect, aLocalPoly ); + +//BFS09 Polygon& rPoly = rPolyPoly[ i ]; +//BFS09 InsertMissingOutlinePoints( rOutlinePoly, vDistances, rTextAreaBoundRect, rPoly ); +//BFS09 InsertMissingOutlinePoints( rOutlinePoly2, vDistances2, rTextAreaBoundRect, rPoly ); + + sal_uInt16 j, nPointCount = aLocalPoly.GetSize(); for ( j = 0; j < nPointCount; j++ ) { - Point& rPoint = rPoly[ j ]; + Point& rPoint = aLocalPoly[ j ]; rPoint.X() -= nLeft; rPoint.Y() -= nTop; double fX = (double)rPoint.X() / (double)nWidth; @@ -816,6 +850,9 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW rPoint.X() = (sal_Int32)( fx1 + fWidth * fY ); rPoint.Y() = (sal_Int32)( fy1 + fHeight* fY ); } + + // write back polygon + rPolyPoly[ i ] = aLocalPoly; } aOutlineIter++; } -- cgit v1.2.3