summaryrefslogtreecommitdiff
path: root/drawinglayer/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-07-13 16:17:00 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-08-03 06:37:16 +0000
commit2660d24a07866e083c5135ea263030f3e3a2e729 (patch)
tree0089d6018d4fc33a7fde955e585e77191cdd258b /drawinglayer/source
parentbaba1d14766282bd2c592bffd79ed69f9078cfe1 (diff)
new loplugin: refcounting
This was a feature requested by mmeeks, as a result of tdf#92611. It validates that things that extend XInterface are not directly heap/stack-allocated, but have their lifecycle managed via css::uno::Reference or rtl::Reference. Change-Id: I28e3b8b236f6a4a56d0a6d6f26ad54e44b36e692 Reviewed-on: https://gerrit.libreoffice.org/16924 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'drawinglayer/source')
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx38
1 files changed, 19 insertions, 19 deletions
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 651e4068fd96..e6a12cda3399 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1165,11 +1165,11 @@ namespace drawinglayer
// per polygon. If there are more, split the polygon in half and call recursively
basegfx::B2DPolygon aLeft, aRight;
splitLinePolygon(rBasePolygon, aLeft, aRight);
- const primitive2d::PolygonHairlinePrimitive2D aPLeft(aLeft, rHairlinePrimitive.getBColor());
- const primitive2d::PolygonHairlinePrimitive2D aPRight(aRight, rHairlinePrimitive.getBColor());
+ uno::Reference< primitive2d::PolygonHairlinePrimitive2D > xPLeft(new primitive2d::PolygonHairlinePrimitive2D(aLeft, rHairlinePrimitive.getBColor()));
+ uno::Reference< primitive2d::PolygonHairlinePrimitive2D > xPRight(new primitive2d::PolygonHairlinePrimitive2D(aRight, rHairlinePrimitive.getBColor()));
- processBasePrimitive2D(aPLeft);
- processBasePrimitive2D(aPRight);
+ processBasePrimitive2D(*xPLeft.get());
+ processBasePrimitive2D(*xPRight.get());
}
else
{
@@ -1213,13 +1213,13 @@ namespace drawinglayer
// per polygon. If there are more, split the polygon in half and call recursively
basegfx::B2DPolygon aLeft, aRight;
splitLinePolygon(rBasePolygon, aLeft, aRight);
- const primitive2d::PolygonStrokePrimitive2D aPLeft(
- aLeft, rStrokePrimitive.getLineAttribute(), rStrokePrimitive.getStrokeAttribute());
- const primitive2d::PolygonStrokePrimitive2D aPRight(
- aRight, rStrokePrimitive.getLineAttribute(), rStrokePrimitive.getStrokeAttribute());
+ uno::Reference< primitive2d::PolygonStrokePrimitive2D > xPLeft(new primitive2d::PolygonStrokePrimitive2D(
+ aLeft, rStrokePrimitive.getLineAttribute(), rStrokePrimitive.getStrokeAttribute()));
+ uno::Reference< primitive2d::PolygonStrokePrimitive2D > xPRight(new primitive2d::PolygonStrokePrimitive2D(
+ aRight, rStrokePrimitive.getLineAttribute(), rStrokePrimitive.getStrokeAttribute()));
- processBasePrimitive2D(aPLeft);
- processBasePrimitive2D(aPRight);
+ processBasePrimitive2D(*xPLeft.get());
+ processBasePrimitive2D(*xPRight.get());
}
else
{
@@ -1294,21 +1294,21 @@ namespace drawinglayer
basegfx::B2DPolygon aLeft, aRight;
splitLinePolygon(rBasePolygon, aLeft, aRight);
const attribute::LineStartEndAttribute aEmpty;
- const primitive2d::PolygonStrokeArrowPrimitive2D aPLeft(
+ uno::Reference< primitive2d::PolygonStrokeArrowPrimitive2D > xPLeft(new primitive2d::PolygonStrokeArrowPrimitive2D(
aLeft,
rStrokeArrowPrimitive.getLineAttribute(),
rStrokeArrowPrimitive.getStrokeAttribute(),
rStrokeArrowPrimitive.getStart(),
- aEmpty);
- const primitive2d::PolygonStrokeArrowPrimitive2D aPRight(
+ aEmpty));
+ uno::Reference< primitive2d::PolygonStrokeArrowPrimitive2D > xPRight(new primitive2d::PolygonStrokeArrowPrimitive2D(
aRight,
rStrokeArrowPrimitive.getLineAttribute(),
rStrokeArrowPrimitive.getStrokeAttribute(),
aEmpty,
- rStrokeArrowPrimitive.getEnd());
+ rStrokeArrowPrimitive.getEnd()));
- processBasePrimitive2D(aPLeft);
- processBasePrimitive2D(aPRight);
+ processBasePrimitive2D(*xPLeft.get());
+ processBasePrimitive2D(*xPRight.get());
}
else
{
@@ -1372,11 +1372,11 @@ namespace drawinglayer
{
// #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
// per polygon. If there are more use the splitted polygon and call recursively
- const primitive2d::PolyPolygonGraphicPrimitive2D aSplitted(
+ uno::Reference< primitive2d::PolyPolygonGraphicPrimitive2D > xSplitted(new primitive2d::PolyPolygonGraphicPrimitive2D(
aLocalPolyPolygon,
- rBitmapCandidate.getFillGraphic());
+ rBitmapCandidate.getFillGraphic()));
- processBasePrimitive2D(aSplitted);
+ processBasePrimitive2D(*xSplitted.get());
}
else
{