summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2022-09-19 20:57:19 +0200
committerJulien Nabet <serval2412@yahoo.fr>2022-09-20 08:18:21 +0200
commit5a6914af4678a24c794055ba23dd9cf0857f0254 (patch)
tree48d2a77f0968f2f282381c1b8f69954af9f86c92 /include
parent39addcb4de4c3033adfd4155de2a79c7633aaf9a (diff)
Simplify a bit by using sal_uInt16 in vcl/BitmapPopArtFilter
Since we're in the "if (bRet)" block, it means 22 bool bRet = isPalettePixelFormat(aBitmap.getPixelFormat()) 23 || aBitmap.Convert(BmpConversion::N8BitColors); is verified. isPalettePixelFormat implementation is: 29 constexpr bool isPalettePixelFormat(PixelFormat ePixelFormat) 30 { 31 assert(ePixelFormat != PixelFormat::INVALID); 32 return sal_uInt16(ePixelFormat) <= 8; 33 } So we know we're using 8 bits max and this line: pWriteAcc->GetBitCount() can't give more than 8 and we can safely declare nEntryCount as sal_uInt16 (idem for "n" just below) Since "nFirstEntry" and "nLastEntry" are related to "nEntryCount", idem for mnIndex they can also be sal_uInt16. Thanks to these, we can avoid all sal::static_int_cast<sal_uInt16> conversions. Change-Id: I8cac2d01f00be33c86058c7a6eb7b9e25fb2635e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140206 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/BitmapPopArtFilter.hxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/vcl/BitmapPopArtFilter.hxx b/include/vcl/BitmapPopArtFilter.hxx
index e5733f7338cc..c25804d359fb 100644
--- a/include/vcl/BitmapPopArtFilter.hxx
+++ b/include/vcl/BitmapPopArtFilter.hxx
@@ -23,7 +23,7 @@ public:
private:
struct PopArtEntry
{
- sal_uInt32 mnIndex;
+ sal_uInt16 mnIndex;
sal_uInt32 mnCount;
};
};