drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx |   17 ++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit b844605b101bd752c8a0c07117b5d3faf2b2aebb
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Dec 22 09:46:58 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Thu Dec 22 10:57:48 2022 +0000

    loplugin:redundantstatic (clang-cl)
    
    ("salhelper::SimpleReferenceObject subclass being directly stack managed, 
should
    be managed via rtl::Reference, const 
primitive2d::PolyPolygonColorPrimitive2D")
    
    Change-Id: I53246ac9f1af1eb1d1ad91ef4d5f59dc19fd2825
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144742
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
index 64c458dbb651..5604e05b3037 100644
--- a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
@@ -864,11 +864,11 @@ void D2DPixelProcessor2D::processBitmapPrimitive2D(
             basegfx::B2DPolygon aPolygon(basegfx::utils::createUnitPolygon());
             aPolygon.transform(aLocalTransform);
 
-            // shortcut with local temporary instance
-            const primitive2d::PolyPolygonColorPrimitive2D 
aTemp(basegfx::B2DPolyPolygon(aPolygon),
-                                                                 
aModifiedColor);
+            rtl::Reference<primitive2d::PolyPolygonColorPrimitive2D> aTemp(
+                new 
primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPolygon),
+                                                             aModifiedColor));
 
-            processPolyPolygonColorPrimitive2D(aTemp);
+            processPolyPolygonColorPrimitive2D(*aTemp);
             return;
         }
     }
@@ -1507,10 +1507,11 @@ void 
D2DPixelProcessor2D::processPolygonStrokePrimitive2D(
         const attribute::LineAttribute aRed(
             basegfx::BColor(1.0, 0.0, 0.0), rLineAttribute.getWidth(), 
rLineAttribute.getLineJoin(),
             rLineAttribute.getLineCap(), 
rLineAttribute.getMiterMinimumAngle());
-        const primitive2d::PolygonStrokePrimitive2D aCopy(
-            rPolygonStrokeCandidate.getB2DPolygon(), aRed,
-            rPolygonStrokeCandidate.getStrokeAttribute());
-        process(aCopy);
+        rtl::Reference<primitive2d::PolygonStrokePrimitive2D> aCopy(
+            new primitive2d::PolygonStrokePrimitive2D(
+                rPolygonStrokeCandidate.getB2DPolygon(), aRed,
+                rPolygonStrokeCandidate.getStrokeAttribute()));
+        process(*aCopy);
     }
 
     bool bDone(false);

Reply via email to