Author: alg Date: Mon Jul 15 14:22:12 2013 New Revision: 1503264 URL: http://svn.apache.org/r1503264 Log: i122724 Better handling of line-only paths
Modified: openoffice/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx Modified: openoffice/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx?rev=1503264&r1=1503263&r2=1503264&view=diff ============================================================================== --- openoffice/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx (original) +++ openoffice/trunk/main/svgio/source/svgreader/svgstyleattributes.cxx Mon Jul 15 14:22:12 2013 @@ -997,12 +997,9 @@ namespace svgio const basegfx::B2DPolyPolygon& rPath, drawinglayer::primitive2d::Primitive2DSequence& rTarget) const { - const bool bIsLine(1 == rPath.count() - && !rPath.areControlPointsUsed() - && 2 == rPath.getB2DPolygon(0).count()); - if(!rPath.count()) { + // no geometry at all return; } @@ -1010,13 +1007,7 @@ namespace svgio if(aGeoRange.isEmpty()) { - return; - } - - if(!bIsLine && // not for lines - (basegfx::fTools::equalZero(aGeoRange.getWidth()) - || basegfx::fTools::equalZero(aGeoRange.getHeight()))) - { + // no geometry range return; } @@ -1024,11 +1015,21 @@ namespace svgio if(basegfx::fTools::equalZero(fOpacity)) { + // not visible return; } + // check if it's a line + const bool bNoWidth(basegfx::fTools::equalZero(aGeoRange.getWidth())); + const bool bNoHeight(basegfx::fTools::equalZero(aGeoRange.getHeight())); + const bool bIsTwoPointLine(1 == rPath.count() + && !rPath.areControlPointsUsed() + && 2 == rPath.getB2DPolygon(0).count()); + const bool bIsLine(bIsTwoPointLine || bNoWidth || bNoHeight); + if(!bIsLine) { + // create fill basegfx::B2DPolyPolygon aPath(rPath); const bool bNeedToCheckClipRule(SVGTokenPath == mrOwner.getType() || SVGTokenPolygon == mrOwner.getType()); const bool bClipPathIsNonzero(!bIsLine && bNeedToCheckClipRule && mbIsClipPathContent && FillRule_nonzero == maClipRule); @@ -1043,6 +1044,7 @@ namespace svgio add_fill(aPath, rTarget, aGeoRange); } + // create stroke add_stroke(rPath, rTarget, aGeoRange); // Svg supports markers for path, polygon, polyline and line