[Libreoffice-commits] core.git: vcl/inc

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Aug 24 07:04:47 UTC 2018


 vcl/inc/BitmapScaleConvolutionFilter.hxx |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 9f529c2bbfc1b331a3037cdd2bf25363389ab032
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Aug 23 16:00:56 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Aug 24 09:04:23 2018 +0200

    loplugin:useuniqueptr in BitmapScaleConvolutionFilter
    
    Change-Id: If83aecb555b3b73b2e4fd19ecfa782236bc546e6
    Reviewed-on: https://gerrit.libreoffice.org/59507
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/vcl/inc/BitmapScaleConvolutionFilter.hxx b/vcl/inc/BitmapScaleConvolutionFilter.hxx
index 6b4642eb6455..bb5fb38409e1 100644
--- a/vcl/inc/BitmapScaleConvolutionFilter.hxx
+++ b/vcl/inc/BitmapScaleConvolutionFilter.hxx
@@ -21,6 +21,7 @@
 #define VCL_INC_BITMAPSCALECONVOLUTIONFILTER_HXX
 
 #include <vcl/BitmapFilter.hxx>
+#include <o3tl/make_unique.hxx>
 
 #include "ResampleKernel.hxx"
 
@@ -29,8 +30,8 @@ namespace vcl
 class VCL_DLLPUBLIC BitmapScaleConvolutionFilter : public BitmapFilter
 {
 protected:
-    BitmapScaleConvolutionFilter(const double& rScaleX, const double& rScaleY, Kernel* pKernel)
-        : mxKernel(pKernel)
+    BitmapScaleConvolutionFilter(const double& rScaleX, const double& rScaleY, std::unique_ptr<Kernel> pKernel)
+        : mxKernel(std::move(pKernel))
         , mrScaleX(rScaleX)
         , mrScaleY(rScaleY)
     {
@@ -48,7 +49,7 @@ class VCL_DLLPUBLIC BitmapScaleBilinearFilter : public BitmapScaleConvolutionFil
 {
 public:
     BitmapScaleBilinearFilter(const double& rScaleX, const double& rScaleY)
-        : BitmapScaleConvolutionFilter(rScaleX, rScaleY, new BilinearKernel)
+        : BitmapScaleConvolutionFilter(rScaleX, rScaleY, o3tl::make_unique<BilinearKernel>())
     {
     }
 };
@@ -57,7 +58,7 @@ class VCL_DLLPUBLIC BitmapScaleBicubicFilter : public BitmapScaleConvolutionFilt
 {
 public:
     BitmapScaleBicubicFilter(const double& rScaleX, const double& rScaleY)
-      : BitmapScaleConvolutionFilter(rScaleX, rScaleY, new BicubicKernel)
+      : BitmapScaleConvolutionFilter(rScaleX, rScaleY, o3tl::make_unique<BicubicKernel>())
     {
     }
 };
@@ -66,7 +67,7 @@ class VCL_DLLPUBLIC BitmapScaleLanczos3Filter : public BitmapScaleConvolutionFil
 {
 public:
     BitmapScaleLanczos3Filter(const double& rScaleX, const double& rScaleY)
-        : BitmapScaleConvolutionFilter(rScaleX, rScaleY, new Lanczos3Kernel)
+        : BitmapScaleConvolutionFilter(rScaleX, rScaleY, o3tl::make_unique<Lanczos3Kernel>())
     {
     }
 };


More information about the Libreoffice-commits mailing list