diff options
author | Armin Le Grand <alg@apache.org> | 2014-03-19 16:17:02 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-03-28 14:31:08 +0100 |
commit | 6e61ecd09679a66060f932835622821d39e92f01 (patch) | |
tree | 4ce71adaa6da133cab09660b3efc1341104022a2 /svx/source/sdr/primitive2d/sdrdecompositiontools.cxx | |
parent | c7190108f02921868cb617040aebdb2d22c02c1f (diff) |
Merge back branch alg_writerframes to trunk
(cherry picked from commit b635b4fa4e42053d30ab639643d2236a20243f62)
Conflicts:
comphelper/inc/comphelper/TypeGeneration.hxx
comphelper/source/property/TypeGeneration.cxx
cui/source/factory/dlgfact.hxx
cui/source/inc/cuitabarea.hxx
cui/source/tabpages/tabarea.cxx
cui/source/tabpages/tabarea.hrc
cui/source/tabpages/tabarea.src
cui/source/tabpages/tparea.cxx
drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
drawinglayer/source/texture/texture.cxx
editeng/inc/editeng/unotext.hxx
editeng/source/items/frmitems.cxx
include/drawinglayer/texture/texture.hxx
include/editeng/brushitem.hxx
include/svx/sdr/primitive2d/sdrdecompositiontools.hxx
include/svx/svxids.hrc
include/xmloff/xmltypes.hxx
reportdesign/source/ui/misc/UITools.cxx
sc/source/ui/drawfunc/drawsh.cxx
sfx2/source/dialog/tabdlg.cxx
svl/source/undo/undo.cxx
svx/inc/svx/unoshprp.hxx
sw/Library_sw.mk
sw/inc/doc.hxx
sw/inc/format.hxx
sw/inc/frmfmt.hxx
sw/inc/swatrset.hxx
sw/inc/unomap.hxx
sw/inc/unoprnms.hxx
sw/source/core/access/accpara.cxx
sw/source/core/attr/format.cxx
sw/source/core/attr/swatrset.cxx
sw/source/core/doc/docdraw.cxx
sw/source/core/doc/docfly.cxx
sw/source/core/doc/notxtfrm.cxx
sw/source/core/inc/frame.hxx
sw/source/core/inc/frmtool.hxx
sw/source/core/layout/atrfrm.cxx
sw/source/core/layout/paintfrm.cxx
sw/source/core/text/inftxt.cxx
sw/source/core/text/porfld.cxx
sw/source/core/text/txtfly.cxx
sw/source/core/txtnode/fntcache.cxx
sw/source/core/uibase/app/docst.cxx
sw/source/core/uibase/app/docstyle.cxx
sw/source/core/uibase/shells/drawdlg.cxx
sw/source/core/uibase/shells/frmsh.cxx
sw/source/core/unocore/unoframe.cxx
sw/source/core/unocore/unomap.cxx
sw/source/core/unocore/unoprnms.cxx
sw/source/core/unocore/unostyle.cxx
sw/source/ui/fmtui/tmpdlg.cxx
sw/source/ui/fmtui/tmpdlg.src
sw/source/ui/frmdlg/frmdlg.cxx
sw/source/ui/frmdlg/frmpage.src
sw/source/ui/inc/frmsh.hxx
xmloff/source/text/txtprhdl.cxx
xmloff/source/text/txtprmap.cxx
Change-Id: Id3ffaa83bb5594d287f1ac8f2c1c9cf55c70946d
Diffstat (limited to 'svx/source/sdr/primitive2d/sdrdecompositiontools.cxx')
-rw-r--r-- | svx/source/sdr/primitive2d/sdrdecompositiontools.cxx | 63 |
1 files changed, 44 insertions, 19 deletions
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index 5d48cbc6b454..f7512d519461 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -56,32 +56,62 @@ namespace drawinglayer namespace primitive2d { Primitive2DReference createPolyPolygonFillPrimitive( - const basegfx::B2DPolyPolygon& rUnitPolyPolygon, - const basegfx::B2DHomMatrix& rObjectTransform, + const basegfx::B2DPolyPolygon& rPolyPolygon, + const attribute::SdrFillAttribute& rFill, + const attribute::FillGradientAttribute& rFillGradient) + { + // when we have no given definition range, use the range of the given geometry + // also for definition (simplest case) + const basegfx::B2DRange aRange(basegfx::tools::getRange(rPolyPolygon)); + + return createPolyPolygonFillPrimitive( + rPolyPolygon, + aRange, + rFill, + rFillGradient); + } + + Primitive2DReference createPolyPolygonFillPrimitive( + const basegfx::B2DPolyPolygon& rPolyPolygon, + const basegfx::B2DRange& rDefinitionRange, const attribute::SdrFillAttribute& rFill, const attribute::FillGradientAttribute& rFillGradient) { + if(basegfx::fTools::moreOrEqual(rFill.getTransparence(), 1.0)) + { + return Primitive2DReference(); + } + // prepare fully scaled polygon - basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon); - aScaledPolyPolygon.transform(rObjectTransform); BasePrimitive2D* pNewFillPrimitive = 0; if(!rFill.getGradient().isDefault()) { - pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, rFill.getGradient()); + pNewFillPrimitive = new PolyPolygonGradientPrimitive2D( + rPolyPolygon, + rDefinitionRange, + rFill.getGradient()); } else if(!rFill.getHatch().isDefault()) { - pNewFillPrimitive = new PolyPolygonHatchPrimitive2D(aScaledPolyPolygon, rFill.getColor(), rFill.getHatch()); + pNewFillPrimitive = new PolyPolygonHatchPrimitive2D( + rPolyPolygon, + rDefinitionRange, + rFill.getColor(), + rFill.getHatch()); } else if(!rFill.getFillGraphic().isDefault()) { - const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon)); - pNewFillPrimitive = new PolyPolygonGraphicPrimitive2D(aScaledPolyPolygon, rFill.getFillGraphic().createFillGraphicAttribute(aRange)); + pNewFillPrimitive = new PolyPolygonGraphicPrimitive2D( + rPolyPolygon, + rDefinitionRange, + rFill.getFillGraphic().createFillGraphicAttribute(rDefinitionRange)); } else { - pNewFillPrimitive = new PolyPolygonColorPrimitive2D(aScaledPolyPolygon, rFill.getColor()); + pNewFillPrimitive = new PolyPolygonColorPrimitive2D( + rPolyPolygon, + rFill.getColor()); } if(0.0 != rFill.getTransparence()) @@ -99,7 +129,7 @@ namespace drawinglayer // create FillGradientPrimitive2D for transparence and add to new sequence // fillGradientPrimitive is enough here (compared to PolyPolygonGradientPrimitive2D) since float transparence will be masked anyways - const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon)); + const basegfx::B2DRange aRange(basegfx::tools::getRange(rPolyPolygon)); const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, rFillGradient)); const Primitive2DSequence aAlpha(&xRefB, 1L); @@ -114,32 +144,27 @@ namespace drawinglayer } Primitive2DReference createPolygonLinePrimitive( - const basegfx::B2DPolygon& rUnitPolygon, - const basegfx::B2DHomMatrix& rObjectTransform, + const basegfx::B2DPolygon& rPolygon, const attribute::SdrLineAttribute& rLine, const attribute::SdrLineStartEndAttribute& rStroke) { - // prepare fully scaled polygon - basegfx::B2DPolygon aScaledPolygon(rUnitPolygon); - aScaledPolygon.transform(rObjectTransform); - // create line and stroke attribute const attribute::LineAttribute aLineAttribute(rLine.getColor(), rLine.getWidth(), rLine.getJoin(), rLine.getCap()); const attribute::StrokeAttribute aStrokeAttribute(rLine.getDotDashArray(), rLine.getFullDotDashLen()); BasePrimitive2D* pNewLinePrimitive = 0L; - if(!rUnitPolygon.isClosed() && !rStroke.isDefault()) + if(!rPolygon.isClosed() && !rStroke.isDefault()) { attribute::LineStartEndAttribute aStart(rStroke.getStartWidth(), rStroke.getStartPolyPolygon(), rStroke.isStartCentered()); attribute::LineStartEndAttribute aEnd(rStroke.getEndWidth(), rStroke.getEndPolyPolygon(), rStroke.isEndCentered()); // create data - pNewLinePrimitive = new PolygonStrokeArrowPrimitive2D(aScaledPolygon, aLineAttribute, aStrokeAttribute, aStart, aEnd); + pNewLinePrimitive = new PolygonStrokeArrowPrimitive2D(rPolygon, aLineAttribute, aStrokeAttribute, aStart, aEnd); } else { // create data - pNewLinePrimitive = new PolygonStrokePrimitive2D(aScaledPolygon, aLineAttribute, aStrokeAttribute); + pNewLinePrimitive = new PolygonStrokePrimitive2D(rPolygon, aLineAttribute, aStrokeAttribute); } if(0.0 != rLine.getTransparence()) |