summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@Sun.COM>2010-06-02 13:50:51 +0200
committerArmin Le Grand <Armin.Le.Grand@Sun.COM>2010-06-02 13:50:51 +0200
commitda2cc96090744ed8ddfb7474cd6d8a920fb06d84 (patch)
tree69cbaf3d3b8284d24752c30c559425ee51d92b2a /drawinglayer
parent44ada130c3857b167e954b63c7a5490268b72c5b (diff)
#i111954# corrected hatch fill turnaround with Metafile and SdrObjects, also some smaller errors in ImpSdrGDIMetaFileImport
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/metafileprimitive2d.cxx3
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx26
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx21
3 files changed, 43 insertions, 7 deletions
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index 9d65643a27..53662c2d52 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -943,14 +943,17 @@ namespace
default : // case HATCH_SINGLE :
{
aHatchStyle = drawinglayer::attribute::HATCHSTYLE_SINGLE;
+ break;
}
case HATCH_DOUBLE :
{
aHatchStyle = drawinglayer::attribute::HATCHSTYLE_DOUBLE;
+ break;
}
case HATCH_TRIPLE :
{
aHatchStyle = drawinglayer::attribute::HATCHSTYLE_TRIPLE;
+ break;
}
}
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 6498ee34f1..f3ae8e5fb6 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1225,17 +1225,16 @@ namespace drawinglayer
{
// need to handle PolyPolygonHatchPrimitive2D here to support XPATHFILL_SEQ_BEGIN/XPATHFILL_SEQ_END
SvtGraphicFill* pSvtGraphicFill = 0;
+ const primitive2d::PolyPolygonHatchPrimitive2D& rHatchCandidate = static_cast< const primitive2d::PolyPolygonHatchPrimitive2D& >(rCandidate);
+ const attribute::FillHatchAttribute& rFillHatchAttribute = rHatchCandidate.getFillHatch();
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(rHatchCandidate.getB2DPolyPolygon());
+ aLocalPolyPolygon.transform(maCurrentTransformation);
if(!mnSvtGraphicFillCount)
{
- const primitive2d::PolyPolygonHatchPrimitive2D& rHatchCandidate = static_cast< const primitive2d::PolyPolygonHatchPrimitive2D& >(rCandidate);
- basegfx::B2DPolyPolygon aLocalPolyPolygon(rHatchCandidate.getB2DPolyPolygon());
- aLocalPolyPolygon.transform(maCurrentTransformation);
-
if(aLocalPolyPolygon.count())
{
// re-create a VCL hatch as base data
- const attribute::FillHatchAttribute& rFillHatchAttribute = rHatchCandidate.getFillHatch();
SvtGraphicFill::HatchType eHatch(SvtGraphicFill::hatchSingle);
switch(rFillHatchAttribute.getStyle())
@@ -1289,9 +1288,22 @@ namespace drawinglayer
// Do use decomposition; encapsulate with SvtGraphicFill
impStartSvtGraphicFill(pSvtGraphicFill);
- process(rCandidate.get2DDecomposition(getViewInformation2D()));
+
+ // #i111954# do NOT use decomposition, but use direct VCL-command
+ // process(rCandidate.get2DDecomposition(getViewInformation2D()));
+ const PolyPolygon aToolsPolyPolygon(aLocalPolyPolygon);
+ const HatchStyle aHatchStyle(
+ attribute::HATCHSTYLE_SINGLE == rFillHatchAttribute.getStyle() ? HATCH_SINGLE :
+ attribute::HATCHSTYLE_DOUBLE == rFillHatchAttribute.getStyle() ? HATCH_DOUBLE :
+ HATCH_TRIPLE);
+
+ mpOutputDevice->DrawHatch(aToolsPolyPolygon,
+ Hatch(aHatchStyle,
+ Color(rFillHatchAttribute.getColor()),
+ basegfx::fround(rFillHatchAttribute.getDistance()),
+ basegfx::fround(rFillHatchAttribute.getAngle() / F_PI1800)));
+
impEndSvtGraphicFill(pSvtGraphicFill);
-
break;
}
case PRIMITIVE2D_ID_POLYPOLYGONGRADIENTPRIMITIVE2D :
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 19f415faba..b3e5c83a75 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -299,6 +299,27 @@ namespace drawinglayer
mpOutputDevice->DrawTransparent(aLocalPolyPolygon, rUniTransparenceCandidate.getTransparence());
bDrawTransparentUsed = true;
}
+
+ if(!bDrawTransparentUsed)
+ {
+ const primitive2d::PolygonHairlinePrimitive2D* pPoHair = dynamic_cast< const primitive2d::PolygonHairlinePrimitive2D* >(xReference.get());
+
+ if(pPoHair && PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D == pPoHair->getPrimitive2DID())
+ {
+ // single transparent Hairline identified, use directly
+ const basegfx::BColor aHairColor(maBColorModifierStack.getModifiedColor(pPoHair->getBColor()));
+ mpOutputDevice->SetFillColor();
+ mpOutputDevice->SetLineColor(Color(aHairColor));
+
+ basegfx::B2DPolygon aLocalPolygon(pPoHair->getB2DPolygon());
+ aLocalPolygon.transform(maCurrentTransformation);
+
+ mpOutputDevice->DrawTransparent(
+ basegfx::B2DPolyPolygon(aLocalPolygon),
+ rUniTransparenceCandidate.getTransparence());
+ bDrawTransparentUsed = true;
+ }
+ }
}
if(!bDrawTransparentUsed)