vcl/source/bitmap/BitmapPopArtFilter.cxx | 17 +---------------- vcl/source/gdi/impvect.cxx | 15 +++------------ 2 files changed, 4 insertions(+), 28 deletions(-)
New commits: commit e347a6bbb58a20e29e691a194c1cd3193d2c5a23 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Oct 2 10:27:10 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Oct 2 11:11:41 2019 +0200 tdf#127913 crash applying popart filter to an image regression from commit 1cd32bcf1b92bd53320717626601135623dadd55 Date: Mon Dec 10 11:28:59 2018 +0200 loplugin:useuniqueptr in vcl where I failed to note that sort needs a different kind of comparator to qsort. Also fix another similar issue I introduced in that commit Change-Id: I5a93bd0567cd5dd4344b9cf2c362ebff60fa0027 Reviewed-on: https://gerrit.libreoffice.org/80007 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/vcl/source/bitmap/BitmapPopArtFilter.cxx b/vcl/source/bitmap/BitmapPopArtFilter.cxx index 621f95fe9c46..a335f04fb824 100644 --- a/vcl/source/bitmap/BitmapPopArtFilter.cxx +++ b/vcl/source/bitmap/BitmapPopArtFilter.cxx @@ -54,22 +54,7 @@ BitmapEx BitmapPopArtFilter::execute(BitmapEx const& rBitmapEx) const // sort table std::sort(aPopArtTable.begin(), aPopArtTable.end(), [](const PopArtEntry& lhs, const PopArtEntry& rhs) { - int nRet; - - if (lhs.mnCount < rhs.mnCount) - { - nRet = 1; - } - else if (lhs.mnCount == rhs.mnCount) - { - nRet = 0; - } - else - { - nRet = -1; - } - - return nRet; + return lhs.mnCount < rhs.mnCount; }); // get last used entry diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index 52174a012c19..5ecfb6aedbd1 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -109,24 +109,15 @@ struct ImplColorSet bool mbSet = false; }; -static int ImplColorSetCmpFnc( const ImplColorSet& lhs, const ImplColorSet& rhs) +static bool ImplColorSetCmpFnc( const ImplColorSet& lhs, const ImplColorSet& rhs) { - int nRet; - if( lhs.mbSet && rhs.mbSet ) { const sal_uInt8 cLum1 = lhs.maColor.GetLuminance(); const sal_uInt8 cLum2 = rhs.maColor.GetLuminance(); - nRet = ( cLum1 > cLum2 ) ? -1 : ( ( cLum1 == cLum2 ) ? 0 : 1 ); + return cLum1 < cLum2; } - else if( lhs.mbSet ) - nRet = -1; - else if( rhs.mbSet ) - nRet = 1; - else - nRet = 0; - - return nRet; + return lhs.mbSet < rhs.mbSet; } class ImplPointArray _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits