diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-09-10 12:37:56 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-09-10 16:23:59 +0200 |
commit | 40110d917b26f0d0e84938df2792abfedb461c45 (patch) | |
tree | 824313be0bc660c290b610921932b4c33f2e3321 /cui | |
parent | 8d831cc01daaed6937fc126dc5671ae58e8c027e (diff) |
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@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/cuigrfflt.cxx | 44 |
1 files changed, 14 insertions, 30 deletions
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; } |