[Libreoffice-commits] core.git: canvas/source cui/source sd/source svx/source vcl/qa vcl/source vcl/unx vcl/workben

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Sep 10 14:24:21 UTC 2018


 canvas/source/vcl/canvashelper.cxx                   |    3 -
 canvas/source/vcl/spritehelper.cxx                   |    3 -
 cui/source/dialogs/cuigrfflt.cxx                     |   44 ++++++-------------
 sd/source/ui/dlg/vectdlg.cxx                         |    3 -
 svx/source/dialog/grfflt.cxx                         |   24 +++-------
 vcl/qa/cppunit/BitmapTest.cxx                        |    3 -
 vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx   |    3 -
 vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx |    3 -
 vcl/source/bitmap/BitmapSmoothenFilter.cxx           |   10 ----
 vcl/source/gdi/animate.cxx                           |    5 --
 vcl/source/gdi/bitmap3.cxx                           |   42 +++++-------------
 vcl/source/gdi/bitmapex.cxx                          |    6 --
 vcl/source/graphic/UnoGraphicTransformer.cxx         |    3 -
 vcl/source/image/Image.cxx                           |    6 --
 vcl/source/image/ImplImageTree.cxx                   |    8 ---
 vcl/source/outdev/bitmap.cxx                         |    3 -
 vcl/source/outdev/font.cxx                           |    2 
 vcl/unx/generic/dtrans/bmp.cxx                       |    6 --
 vcl/workben/outdevgrind.cxx                          |    3 -
 vcl/workben/vcldemo.cxx                              |    3 -
 20 files changed, 57 insertions(+), 126 deletions(-)

New commits:
commit 40110d917b26f0d0e84938df2792abfedb461c45
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Sep 10 12:37:56 2018 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Mon Sep 10 16:23:59 2018 +0200

    No more need for extra local variables
    
    ...after 453fde35bb838febf73bfda0bd981ee270c9b12e "BitmapFilter::execute can be
    const".  This reverts the call-site changes of
    bce47223099bb3349d96af9d6b1fe88bcdd539df "clang-tidy bugprone-use-after-move in
    BitmapFilter::Filter" again.
    
    Change-Id: I5ce4eb7ddce90fb779ddfb1c5864fd4785708175
    Reviewed-on: https://gerrit.libreoffice.org/60255
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index c89a216ce092..cdbf15cd6b88 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -720,8 +720,7 @@ namespace vclcanvas
                     // transparency is fully transparent
                     if( aBmpEx.IsAlpha() )
                     {
-                        BitmapAlphaClampFilter filter(253);
-                        BitmapFilter::Filter(aBmpEx, filter);
+                        BitmapFilter::Filter(aBmpEx, BitmapAlphaClampFilter(253));
                     }
 
                     mp2ndOutDevProvider->getOutDev().DrawBitmapEx( vcl::unotools::pointFromB2DPoint( aOutputPos ),
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index 1a1bc30f585f..123a6b64b2e4 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -158,8 +158,7 @@ namespace vclcanvas
                         OSL_FAIL("CanvasCustomSprite::redraw(): Mask bitmap is not "
                                    "monochrome (performance!)");
                         BitmapEx aMaskEx(aMask);
-                        BitmapMonochromeFilter filter(255);
-                        BitmapFilter::Filter(aMaskEx, filter);
+                        BitmapFilter::Filter(aMaskEx, BitmapMonochromeFilter(255));
                         aMask = aMaskEx.GetBitmap();
                     }
 #endif
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index bf1b425e15f7..e9f84d1789ef 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -244,14 +244,11 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
     if( rGraphic.IsAnimated() )
     {
         Animation aAnim( rGraphic.GetAnimation() );
-        BitmapMosaicFilter mosiacFilter(aSize.getWidth(), aSize.getHeight());
-        if (BitmapFilter::Filter(aAnim, mosiacFilter))
+
+        if (BitmapFilter::Filter(aAnim, BitmapMosaicFilter(aSize.getWidth(), aSize.getHeight())))
         {
             if( IsEnhanceEdges() )
-            {
-                BitmapSharpenFilter sharpenFilter;
-                (void)BitmapFilter::Filter(aAnim, sharpenFilter);
-            }
+                (void)BitmapFilter::Filter(aAnim, BitmapSharpenFilter());
 
             aRet = aAnim;
         }
@@ -260,14 +257,10 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
     {
         BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
 
-        BitmapMosaicFilter mosiacFilter(aSize.getWidth(), aSize.getHeight());
-        if (BitmapFilter::Filter(aBmpEx, mosiacFilter))
+        if (BitmapFilter::Filter(aBmpEx, BitmapMosaicFilter(aSize.getWidth(), aSize.getHeight())))
         {
             if( IsEnhanceEdges() )
-            {
-                BitmapSharpenFilter sharpenFilter;
-                BitmapFilter::Filter(aBmpEx, sharpenFilter);
-            }
+                BitmapFilter::Filter(aBmpEx, BitmapSharpenFilter());
 
             aRet = aBmpEx;
         }
@@ -317,8 +310,7 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double
     {
         Animation aAnim( rGraphic.GetAnimation() );
 
-        BitmapSmoothenFilter filter(nRadius);
-        if (BitmapFilter::Filter(aAnim, filter))
+        if (BitmapFilter::Filter(aAnim, BitmapSmoothenFilter(nRadius)))
         {
             aRet = aAnim;
         }
@@ -327,8 +319,7 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double
     {
         BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
 
-        BitmapSmoothenFilter filter(nRadius);
-        if (BitmapFilter::Filter(aBmpEx, filter))
+        if (BitmapFilter::Filter(aBmpEx, BitmapSmoothenFilter(nRadius)))
         {
             aRet = aBmpEx;
         }
@@ -389,8 +380,7 @@ Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic, doub
     {
         Animation aAnim( rGraphic.GetAnimation() );
 
-        BitmapSolarizeFilter filter(nGreyThreshold);
-        if (BitmapFilter::Filter(aAnim, filter))
+        if (BitmapFilter::Filter(aAnim, BitmapSolarizeFilter(nGreyThreshold)))
         {
             if( IsInvert() )
                 aAnim.Invert();
@@ -402,8 +392,7 @@ Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic, doub
     {
         BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
 
-        BitmapSolarizeFilter filter(nGreyThreshold);
-        if (BitmapFilter::Filter(aBmpEx, filter))
+        if (BitmapFilter::Filter(aBmpEx, BitmapSolarizeFilter(nGreyThreshold)))
         {
             if( IsInvert() )
                 aBmpEx.Invert();
@@ -452,16 +441,14 @@ Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic, double,
     {
         Animation aAnim( rGraphic.GetAnimation() );
 
-        BitmapSepiaFilter filter(nSepiaPct);
-        if (BitmapFilter::Filter(aAnim, filter))
+        if (BitmapFilter::Filter(aAnim, BitmapSepiaFilter(nSepiaPct)))
             aRet = aAnim;
     }
     else
     {
         BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
 
-        BitmapSepiaFilter filter(nSepiaPct);
-        if (BitmapFilter::Filter(aBmpEx, filter))
+        if (BitmapFilter::Filter(aBmpEx, BitmapSepiaFilter(nSepiaPct)))
             aRet = aBmpEx;
     }
 
@@ -518,8 +505,7 @@ Graphic GraphicFilterPoster::GetFilteredGraphic( const Graphic& rGraphic, double
     {
         BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
 
-        BitmapColorQuantizationFilter filter(nPosterCount);
-        if (BitmapFilter::Filter(aBmpEx, filter))
+        if (BitmapFilter::Filter(aBmpEx, BitmapColorQuantizationFilter(nPosterCount)))
             aRet = aBmpEx;
     }
 
@@ -596,16 +582,14 @@ Graphic GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic, double
     {
         Animation aAnim( rGraphic.GetAnimation() );
 
-        BitmapEmbossGreyFilter filter(nAzim, nElev);
-        if (BitmapFilter::Filter(aAnim, filter))
+        if (BitmapFilter::Filter(aAnim, BitmapEmbossGreyFilter(nAzim, nElev)))
             aRet = aAnim;
     }
     else
     {
         BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
 
-        BitmapEmbossGreyFilter filter(nAzim, nElev);
-        if (BitmapFilter::Filter(aBmpEx, filter))
+        if (BitmapFilter::Filter(aBmpEx, BitmapEmbossGreyFilter(nAzim, nElev)))
             aRet = aBmpEx;
     }
 
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx
index 4c95572d3d2b..2bbc2810b203 100644
--- a/sd/source/ui/dlg/vectdlg.cxx
+++ b/sd/source/ui/dlg/vectdlg.cxx
@@ -119,8 +119,7 @@ Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap const & rBmp, Fraction& rScale
         rScale = Fraction( 1, 1 );
 
     BitmapEx aNewBmpEx(aNew);
-    BitmapSimpleColorQuantizationFilter filter(m_xNmLayers->get_value());
-    BitmapFilter::Filter(aNewBmpEx, filter);
+    BitmapFilter::Filter(aNewBmpEx, BitmapSimpleColorQuantizationFilter(m_xNmLayers->get_value()));
     aNew = aNewBmpEx.GetBitmap();
 
     return aNew;
diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx
index 51ebc78fe894..6ec799628327 100644
--- a/svx/source/dialog/grfflt.cxx
+++ b/svx/source/dialog/grfflt.cxx
@@ -90,16 +90,14 @@ SvxGraphicFilterResult SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const
                 {
                     Animation aAnimation( rGraphic.GetAnimation() );
 
-                    BitmapSharpenFilter filter;
-                    if (BitmapFilter::Filter(aAnimation, filter))
+                    if (BitmapFilter::Filter(aAnimation, BitmapSharpenFilter()))
                         aGraphic = aAnimation;
                 }
                 else
                 {
                     BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
 
-                    BitmapSharpenFilter filter;
-                    if (BitmapFilter::Filter(aBmpEx, filter))
+                    if (BitmapFilter::Filter(aBmpEx, BitmapSharpenFilter()))
                         aGraphic = aBmpEx;
                 }
 
@@ -117,16 +115,14 @@ SvxGraphicFilterResult SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const
                 {
                     Animation aAnimation( rGraphic.GetAnimation() );
 
-                    BitmapMedianFilter filter;
-                    if (BitmapFilter::Filter(aAnimation, filter))
+                    if (BitmapFilter::Filter(aAnimation, BitmapMedianFilter()))
                         aGraphic = aAnimation;
                 }
                 else
                 {
                     BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
 
-                    BitmapMedianFilter filter;
-                    if (BitmapFilter::Filter(aBmpEx, filter))
+                    if (BitmapFilter::Filter(aBmpEx, BitmapMedianFilter()))
                         aGraphic = aBmpEx;
                 }
 
@@ -144,16 +140,14 @@ SvxGraphicFilterResult SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const
                 {
                     Animation aAnimation( rGraphic.GetAnimation() );
 
-                    BitmapSobelGreyFilter filter;
-                    if (BitmapFilter::Filter(aAnimation, filter))
+                    if (BitmapFilter::Filter(aAnimation, BitmapSobelGreyFilter()))
                         aGraphic = aAnimation;
                 }
                 else
                 {
                     BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
 
-                    BitmapSobelGreyFilter filter;
-                    if (BitmapFilter::Filter(aBmpEx, filter))
+                    if (BitmapFilter::Filter(aBmpEx, BitmapSobelGreyFilter()))
                         aGraphic = aBmpEx;
                 }
 
@@ -198,16 +192,14 @@ SvxGraphicFilterResult SvxGraphicFilter::ExecuteGrfFilterSlot( SfxRequest const
                 {
                     Animation aAnimation( rGraphic.GetAnimation() );
 
-                    BitmapPopArtFilter filter;
-                    if (BitmapFilter::Filter(aAnimation, filter))
+                    if (BitmapFilter::Filter(aAnimation, BitmapPopArtFilter()))
                         aGraphic = aAnimation;
                 }
                 else
                 {
                     BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
 
-                    BitmapPopArtFilter filter;
-                    if (BitmapFilter::Filter(aBmpEx, filter))
+                    if (BitmapFilter::Filter(aBmpEx, BitmapPopArtFilter()))
                         aGraphic = aBmpEx;
                 }
 
diff --git a/vcl/qa/cppunit/BitmapTest.cxx b/vcl/qa/cppunit/BitmapTest.cxx
index 8da2a58dd67d..706fb1f58690 100644
--- a/vcl/qa/cppunit/BitmapTest.cxx
+++ b/vcl/qa/cppunit/BitmapTest.cxx
@@ -213,8 +213,7 @@ void BitmapTest::testMonochrome()
     Bitmap aBmp = createTestBitmap();
 
     BitmapEx aBmpEx(aBmp);
-    BitmapMonochromeFilter filter(63);
-    BitmapFilter::Filter(aBmpEx, filter);
+    BitmapFilter::Filter(aBmpEx, BitmapMonochromeFilter(63));
     aBmp = aBmpEx.GetBitmap();
     BitmapReadAccess aBmpReadAccess(aBmp);
 
diff --git a/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx b/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx
index cbc5dc34d837..13e238bc1ecf 100644
--- a/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx
+++ b/vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx
@@ -223,8 +223,7 @@ BitmapEx BitmapInterpolateScaleFilter::execute(BitmapEx const& rBitmapEx) const
     {
         // fallback to fast scale filter
         BitmapEx aBmpEx(aBitmap);
-        BitmapFastScaleFilter filter(mfScaleX, mfScaleY);
-        bRet = BitmapFilter::Filter(aBmpEx, filter);
+        bRet = BitmapFilter::Filter(aBmpEx, BitmapFastScaleFilter(mfScaleX, mfScaleY));
         aBitmap = aBmpEx.GetBitmap();
     }
 
diff --git a/vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx b/vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx
index 0ee1fd3159b2..85a5774f1a1d 100644
--- a/vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx
+++ b/vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx
@@ -28,8 +28,7 @@ BitmapEx BitmapSeparableUnsharpenFilter::execute(BitmapEx const& rBitmapEx) cons
     Bitmap aBlur(aBitmap);
     BitmapEx aBlurEx(aBlur);
 
-    BitmapGaussianSeparableBlurFilter filter(-mfRadius);
-    BitmapFilter::Filter(aBlurEx, filter);
+    BitmapFilter::Filter(aBlurEx, BitmapGaussianSeparableBlurFilter(-mfRadius));
     aBlur = aBlurEx.GetBitmap();
 
     // Amount of unsharpening effect on image - currently set to a fixed value
diff --git a/vcl/source/bitmap/BitmapSmoothenFilter.cxx b/vcl/source/bitmap/BitmapSmoothenFilter.cxx
index 3e6f3148cd3d..fbc464d880ca 100644
--- a/vcl/source/bitmap/BitmapSmoothenFilter.cxx
+++ b/vcl/source/bitmap/BitmapSmoothenFilter.cxx
@@ -23,15 +23,9 @@ BitmapEx BitmapSmoothenFilter::execute(BitmapEx const& rBitmapEx) const
     bool bRet = false;
 
     if (mfRadius > 0.0) // Blur for positive values of mnRadius
-    {
-        BitmapGaussianSeparableBlurFilter filter(mfRadius);
-        bRet = BitmapFilter::Filter(aBitmapEx, filter);
-    }
+        bRet = BitmapFilter::Filter(aBitmapEx, BitmapGaussianSeparableBlurFilter(mfRadius));
     else if (mfRadius < 0.0) // Unsharpen mask for negative values of mnRadius
-    {
-        BitmapSeparableUnsharpenFilter filter(mfRadius);
-        bRet = BitmapFilter::Filter(aBitmapEx, filter);
-    }
+        bRet = BitmapFilter::Filter(aBitmapEx, BitmapSeparableUnsharpenFilter(mfRadius));
 
     if (bRet)
         return rBitmapEx;
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 7e801a9cb01f..22519fa5b810 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -525,13 +525,12 @@ bool Animation::ReduceColors( sal_uInt16 nNewColorCount )
     {
         bRet = true;
 
-        BitmapColorQuantizationFilter filter(nNewColorCount);
         for (size_t i = 0, n = maList.size(); (i < n) && bRet; ++i)
         {
-            bRet = BitmapFilter::Filter(maList[i]->aBmpEx, filter);
+            bRet = BitmapFilter::Filter(maList[i]->aBmpEx, BitmapColorQuantizationFilter(nNewColorCount));
         }
 
-        BitmapFilter::Filter(maBitmapEx, filter);
+        BitmapFilter::Filter(maBitmapEx, BitmapColorQuantizationFilter(nNewColorCount));
     }
     else
     {
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 8a02e37bdffa..2994bbc610aa 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -249,8 +249,7 @@ bool Bitmap::Convert( BmpConversion eConversion )
         case BmpConversion::N1BitThreshold:
         {
             BitmapEx aBmpEx(*this);
-            BitmapMonochromeFilter filter(128);
-            bRet = BitmapFilter::Filter(aBmpEx, filter);
+            bRet = BitmapFilter::Filter(aBmpEx, BitmapMonochromeFilter(128));
             *this = aBmpEx.GetBitmap();
         }
         break;
@@ -776,49 +775,32 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag n
     switch(nScaleFlag)
     {
         case BmpScaleFlag::Fast:
-        {
-            BitmapFastScaleFilter filter(rScaleX, rScaleY);
-            bRetval = BitmapFilter::Filter(aBmpEx, filter);
+            bRetval = BitmapFilter::Filter(aBmpEx, BitmapFastScaleFilter(rScaleX, rScaleY));
             break;
-        }
+
         case BmpScaleFlag::Interpolate:
-        {
-            BitmapInterpolateScaleFilter filter(rScaleX, rScaleY);
-            bRetval = BitmapFilter::Filter(aBmpEx, filter);
+            bRetval = BitmapFilter::Filter(aBmpEx, BitmapInterpolateScaleFilter(rScaleX, rScaleY));
             break;
-        }
+
         case BmpScaleFlag::Default:
             if (GetSizePixel().Width() < 2 || GetSizePixel().Height() < 2)
-            {
-                BitmapFastScaleFilter filter(rScaleX, rScaleY);
-                bRetval = BitmapFilter::Filter(aBmpEx, filter);
-            }
+                bRetval = BitmapFilter::Filter(aBmpEx, BitmapFastScaleFilter(rScaleX, rScaleY));
             else
-            {
-                BitmapScaleSuperFilter filter(rScaleX, rScaleY);
-                bRetval = BitmapFilter::Filter(aBmpEx, filter);
-            }
+                bRetval = BitmapFilter::Filter(aBmpEx, BitmapScaleSuperFilter(rScaleX, rScaleY));
             break;
 
         case BmpScaleFlag::Lanczos:
         case BmpScaleFlag::BestQuality:
-        {
-            vcl::BitmapScaleLanczos3Filter filter(rScaleX, rScaleY);
-            bRetval = BitmapFilter::Filter(aBmpEx, filter);
+            bRetval = BitmapFilter::Filter(aBmpEx, vcl::BitmapScaleLanczos3Filter(rScaleX, rScaleY));
             break;
-        }
+
         case BmpScaleFlag::BiCubic:
-        {
-            vcl::BitmapScaleBicubicFilter filter(rScaleX, rScaleY);
-            bRetval = BitmapFilter::Filter(aBmpEx, filter);
+            bRetval = BitmapFilter::Filter(aBmpEx, vcl::BitmapScaleBicubicFilter(rScaleX, rScaleY));
             break;
-        }
+
         case BmpScaleFlag::BiLinear:
-        {
-            vcl::BitmapScaleBilinearFilter filter(rScaleX, rScaleY);
-            bRetval = BitmapFilter::Filter(aBmpEx, filter);
+            bRetval = BitmapFilter::Filter(aBmpEx, vcl::BitmapScaleBilinearFilter(rScaleX, rScaleY));
             break;
-        }
     }
 
     if (bRetval)
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 6edfeb231e33..ae7e5bcd858d 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -128,8 +128,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) :
     {
         SAL_WARN( "vcl", "BitmapEx: forced mask to monochrome");
         BitmapEx aMaskEx(maMask);
-        BitmapMonochromeFilter filter(255);
-        BitmapFilter::Filter(aMaskEx, filter);
+        BitmapFilter::Filter(aMaskEx, BitmapMonochromeFilter(255));
         maMask = aMaskEx.GetBitmap();
     }
 
@@ -256,8 +255,7 @@ Bitmap BitmapEx::GetMask() const
         return maMask;
 
     BitmapEx aMaskEx(maMask);
-    BitmapMonochromeFilter filter(255);
-    BitmapFilter::Filter(aMaskEx, filter);
+    BitmapFilter::Filter(aMaskEx, BitmapMonochromeFilter(255));
     return aMaskEx.GetBitmap();
 }
 
diff --git a/vcl/source/graphic/UnoGraphicTransformer.cxx b/vcl/source/graphic/UnoGraphicTransformer.cxx
index b749014ffe44..2fba69d01c93 100644
--- a/vcl/source/graphic/UnoGraphicTransformer.cxx
+++ b/vcl/source/graphic/UnoGraphicTransformer.cxx
@@ -122,8 +122,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::applyDuotone(
     Bitmap      aBitmap( aBitmapEx.GetBitmap() );
 
     BitmapEx    aTmpBmpEx(aBitmap);
-    BitmapDuoToneFilter filter(static_cast<sal_uLong>(nColorOne), static_cast<sal_uLong>(nColorTwo));
-    BitmapFilter::Filter(aTmpBmpEx, filter);
+    BitmapFilter::Filter(aTmpBmpEx, BitmapDuoToneFilter(static_cast<sal_uLong>(nColorOne), static_cast<sal_uLong>(nColorTwo)));
     aBitmap = aTmpBmpEx.GetBitmap();
 
     aReturnGraphic = ::Graphic( BitmapEx( aBitmap, aMask ) );
diff --git a/vcl/source/image/Image.cxx b/vcl/source/image/Image.cxx
index 0cb69d6affb8..049e3bef5d0d 100644
--- a/vcl/source/image/Image.cxx
+++ b/vcl/source/image/Image.cxx
@@ -138,8 +138,7 @@ void Image::Draw(OutputDevice* pOutDev, const Point& rPos, DrawImageFlags nStyle
         if (mpImplData->maBitmapChecksum != aChecksum)
         {
             BitmapEx aDisabledBmpEx(mpImplData->maBitmapEx);
-            BitmapDisabledImageFilter filter;
-            BitmapFilter::Filter(aDisabledBmpEx, filter);
+            BitmapFilter::Filter(aDisabledBmpEx, BitmapDisabledImageFilter());
 
             mpImplData->maBitmapChecksum = aChecksum;
             mpImplData->maDisabledBitmapEx = aDisabledBmpEx;
@@ -162,8 +161,7 @@ void Image::Draw(OutputDevice* pOutDev, const Point& rPos, DrawImageFlags nStyle
                 else
                     aColor = rSettings.GetDeactiveColor();
 
-                BitmapColorizeFilter filter(aColor);
-                BitmapFilter::Filter(aTempBitmapEx, filter);
+                BitmapFilter::Filter(aTempBitmapEx, BitmapColorizeFilter(aColor));
             }
 
             if (nStyle & DrawImageFlags::SemiTransparent)
diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx
index 1ee8d7b513e2..fd1025dec240 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -163,10 +163,7 @@ void loadImageFromStream(std::shared_ptr<SvStream> const & xStream, OUString con
         vcl::bitmap::loadFromSvg(*xStream.get(), rPath, rParameters.mrBitmap, aScalePercentage / 100.0);
 
         if (bConvertToDarkTheme)
-        {
-            BitmapLightenFilter filter;
-            BitmapFilter::Filter(rParameters.mrBitmap, filter);
-        }
+            BitmapFilter::Filter(rParameters.mrBitmap, BitmapLightenFilter());
 
         return;
     }
@@ -178,8 +175,7 @@ void loadImageFromStream(std::shared_ptr<SvStream> const & xStream, OUString con
     if (bConvertToDarkTheme)
     {
         rParameters.mbWriteImageToCache = true; // Cache the dark variant
-        BitmapLightenFilter filter;
-        BitmapFilter::Filter(rParameters.mrBitmap, filter);
+        BitmapFilter::Filter(rParameters.mrBitmap, BitmapLightenFilter());
     }
 
     if (aScalePercentage > 100)
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 5b72fc700b99..ffc1299925d8 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -330,8 +330,7 @@ void OutputDevice::DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
                     // output, having alpha-induced grey levels is not
                     // acceptable.
                     BitmapEx aMaskEx(aBmpEx.GetAlpha().GetBitmap());
-                    BitmapMonochromeFilter filter(129);
-                    BitmapFilter::Filter(aMaskEx, filter);
+                    BitmapFilter::Filter(aMaskEx, BitmapMonochromeFilter(129));
                     aBmpEx = BitmapEx(aColorBmp, aMaskEx.GetBitmap());
                 }
                 else
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 2f4478892a82..9904ecf304d4 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -1413,7 +1413,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplGlyphFallbackLayout( std::unique_pt
         pSalLayout = std::move(pMultiSalLayout);
 
     // restore orig font settings
-    pSalLayout->InitFont(); // NOLINT{bugprone-use-after-move} false+
+    pSalLayout->InitFont();
     rLayoutArgs.maRuns = aLayoutRuns;
 
     return pSalLayout;
diff --git a/vcl/unx/generic/dtrans/bmp.cxx b/vcl/unx/generic/dtrans/bmp.cxx
index 27dbfe579ef2..8b7f342bfbb6 100644
--- a/vcl/unx/generic/dtrans/bmp.cxx
+++ b/vcl/unx/generic/dtrans/bmp.cxx
@@ -758,8 +758,7 @@ css::uno::Sequence<sal_Int8> x11::convertBitmapDepth(
         case 4:
         {
             BitmapEx aBmpEx(bm);
-            BitmapSimpleColorQuantizationFilter filter(1<<4);
-            BitmapFilter::Filter(aBmpEx, filter);
+            BitmapFilter::Filter(aBmpEx, BitmapSimpleColorQuantizationFilter(1<<4));
             bm = aBmpEx.GetBitmap();
         }
         break;
@@ -767,8 +766,7 @@ css::uno::Sequence<sal_Int8> x11::convertBitmapDepth(
         case 8:
         {
             BitmapEx aBmpEx(bm);
-            BitmapSimpleColorQuantizationFilter filter(1<<8);
-            BitmapFilter::Filter(aBmpEx, filter);
+            BitmapFilter::Filter(aBmpEx, BitmapSimpleColorQuantizationFilter(1<<8));
             bm = aBmpEx.GetBitmap();
         }
         break;
diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx
index af8e813178e6..317762eaa861 100644
--- a/vcl/workben/outdevgrind.cxx
+++ b/vcl/workben/outdevgrind.cxx
@@ -131,8 +131,7 @@ void setupMethodStubs( functor_vector_type& res )
     Bitmap            aBitmapBW( aBitmap );
 
     BitmapEx aTmpBmpEx(aBitmapBW);
-    BitmapEmbossGreyFilter filter(0, 0);
-    BitmapFilter::Filter(aTmpBmpEx, filter);
+    BitmapFilter::Filter(aTmpBmpEx, BitmapEmbossGreyFilter(0, 0));
     aBitmapBW = aTmpBmpEx.GetBitmap();
 
     Bitmap      aBitmapAlien( Size( 100, 100 ), 8 );
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index b540f188bf9c..4a812d370eea 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -148,8 +148,7 @@ public:
         maIntroBW = maIntro.GetBitmap();
 
         BitmapEx aTmpBmpEx(maIntroBW);
-        BitmapEmbossGreyFilter filter(0, 0);
-        BitmapFilter::Filter(aTmpBmpEx, filter);
+        BitmapFilter::Filter(aTmpBmpEx, BitmapEmbossGreyFilter(0, 0));
         maIntroBW = aTmpBmpEx.GetBitmap();
 
         InitRenderers();


More information about the Libreoffice-commits mailing list