diff options
-rw-r--r-- | drawinglayer/source/primitive2d/polygonprimitive2d.cxx | 3 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape2d.cxx | 16 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 2 |
3 files changed, 19 insertions, 2 deletions
diff --git a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx index ee73d74b5c24..6a656445db40 100644 --- a/drawinglayer/source/primitive2d/polygonprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/polygonprimitive2d.cxx @@ -509,10 +509,11 @@ namespace drawinglayer { // copy local polygon, it may be changed basegfx::B2DPolygon aLocalPolygon(getB2DPolygon()); + aLocalPolygon.removeDoublePoints(); basegfx::B2DPolyPolygon aArrowA; basegfx::B2DPolyPolygon aArrowB; - if(!aLocalPolygon.isClosed()) + if(!aLocalPolygon.isClosed() && aLocalPolygon.count() > 1) { // apply arrows const double fPolyLength(basegfx::tools::getLength(aLocalPolygon)); diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 09db03fc7538..200aa1e6b35e 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -1735,6 +1735,22 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm if(aNewB2DPolyPolygon.count()) { + if( !bLineGeometryNeededOnly ) + { + // hack aNewB2DPolyPolygon to fill logic rect - this is + // needed to produce gradient fills that look like mso + aNewB2DPolygon.clear(); + aNewB2DPolygon.append(basegfx::B2DPoint(0,0)); + aNewB2DPolygon.setClosed(true); + aNewB2DPolyPolygon.append(aNewB2DPolygon); + + aNewB2DPolygon.clear(); + aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(), + aLogicRect.GetHeight())); + aNewB2DPolygon.setClosed(true); + aNewB2DPolyPolygon.append(aNewB2DPolygon); + } + // #i37011# bool bForceCreateTwoObjects(false); diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 78d0dda8e57a..8118264ccbc9 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -633,7 +633,7 @@ void InsertMissingOutlinePoints( const Polygon& /*rOutlinePoly*/, const std::vec void GetPoint( const Polygon& rPoly, const std::vector< double >& rDistances, const double& fX, double& fx1, double& fy1 ) { fy1 = fx1 = 0.0; - if ( rPoly.GetSize() ) + if ( rPoly.GetSize() > 1 ) { std::vector< double >::const_iterator aIter = std::lower_bound( rDistances.begin(), rDistances.end(), fX ); sal_uInt16 nIdx = sal::static_int_cast<sal_uInt16>( std::distance( rDistances.begin(), aIter ) ); |