diff options
Diffstat (limited to 'drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx')
-rw-r--r-- | drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx index 09a82bdd89ca..c855460824e7 100644 --- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx @@ -21,10 +21,12 @@ #include <texture/texture.hxx> #include <drawinglayer/primitive2d/PolygonHairlinePrimitive2D.hxx> #include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx> +#include <drawinglayer/primitive2d/groupprimitive2d.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx> +#include <utility> using namespace com::sun::star; @@ -32,10 +34,10 @@ using namespace com::sun::star; namespace drawinglayer::primitive2d { - void FillHatchPrimitive2D::create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& /*rViewInformation*/) const + Primitive2DReference FillHatchPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const { if(getFillHatch().isDefault()) - return; + return nullptr; // create hatch const basegfx::BColor aHatchColor(getFillHatch().getColor()); @@ -99,12 +101,12 @@ namespace drawinglayer::primitive2d // prepare return value const bool bFillBackground(getFillHatch().isFillBackground()); - + Primitive2DContainer aContainer; // evtl. create filled background if(bFillBackground) { // create primitive for background - rContainer.push_back( + aContainer.push_back( new PolyPolygonColorPrimitive2D( basegfx::B2DPolyPolygon( basegfx::utils::createPolygonFromRect(getOutputRange())), getBColor())); @@ -123,17 +125,18 @@ namespace drawinglayer::primitive2d aNewLine.append(rMatrix * aEnd); // create hairline - rContainer.push_back(new PolygonHairlinePrimitive2D(aNewLine, aHatchColor)); + aContainer.push_back(new PolygonHairlinePrimitive2D(std::move(aNewLine), aHatchColor)); } + return new GroupPrimitive2D(std::move(aContainer)); } FillHatchPrimitive2D::FillHatchPrimitive2D( const basegfx::B2DRange& rOutputRange, const basegfx::BColor& rBColor, - const attribute::FillHatchAttribute& rFillHatch) + attribute::FillHatchAttribute aFillHatch) : maOutputRange(rOutputRange), maDefinitionRange(rOutputRange), - maFillHatch(rFillHatch), + maFillHatch(std::move(aFillHatch)), maBColor(rBColor) { } @@ -142,10 +145,10 @@ namespace drawinglayer::primitive2d const basegfx::B2DRange& rOutputRange, const basegfx::B2DRange& rDefinitionRange, const basegfx::BColor& rBColor, - const attribute::FillHatchAttribute& rFillHatch) + attribute::FillHatchAttribute aFillHatch) : maOutputRange(rOutputRange), maDefinitionRange(rDefinitionRange), - maFillHatch(rFillHatch), + maFillHatch(std::move(aFillHatch)), maBColor(rBColor) { } |