filter/source/graphicfilter/icgm/bitmap.cxx | 7 +++++++ filter/source/graphicfilter/icgm/main.hxx | 2 -- include/vcl/salbtype.hxx | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-)
New commits: commit e58503b743d6dd5e100bfc1abb6a96f28d17d318 Author: Stephan Bergmann <[email protected]> Date: Thu Jan 11 10:30:16 2018 +0100 Replace macro with function ...and move it into the only .cxx that uses it; making just enough of BitmapColor constexpr as is useful here Change-Id: I8a035f67f4b218dcef2f100814c62b25fb32d5be Reviewed-on: https://gerrit.libreoffice.org/47750 Tested-by: Jenkins <[email protected]> Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx b/filter/source/graphicfilter/icgm/bitmap.cxx index 3dc9d98dc668..4a99c2de3706 100644 --- a/filter/source/graphicfilter/icgm/bitmap.cxx +++ b/filter/source/graphicfilter/icgm/bitmap.cxx @@ -20,6 +20,13 @@ #include "main.hxx" +namespace { + +constexpr BitmapColor BMCOL(sal_uInt32 _col) { + return BitmapColor( (sal_Int8)(_col >> 16 ), (sal_Int8)( _col >> 8 ), (sal_Int8)_col ); +} + +} CGMBitmap::CGMBitmap( CGM& rCGM ) : mpCGM ( &rCGM ), diff --git a/filter/source/graphicfilter/icgm/main.hxx b/filter/source/graphicfilter/icgm/main.hxx index d213b002a191..508c8f3ebf6b 100644 --- a/filter/source/graphicfilter/icgm/main.hxx +++ b/filter/source/graphicfilter/icgm/main.hxx @@ -22,8 +22,6 @@ #include "cgm.hxx" -#define BMCOL( _col ) BitmapColor( (sal_Int8)(_col >> 16 ), (sal_Int8)( _col >> 8 ), (sal_Int8)_col ) - #include <vcl/salbtype.hxx> #include <tools/stream.hxx> #include "bundles.hxx" diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx index e9a3bdf599b7..0f4e45733d0f 100644 --- a/include/vcl/salbtype.hxx +++ b/include/vcl/salbtype.hxx @@ -98,7 +98,7 @@ private: public: inline BitmapColor(); - inline BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue ); + constexpr BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue ); inline BitmapColor( const Color& rColor ); explicit inline BitmapColor( sal_uInt8 cIndex ); @@ -356,7 +356,7 @@ inline BitmapColor::BitmapColor() : { } -inline BitmapColor::BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue ) : +constexpr BitmapColor::BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBlue ) : mcBlueOrIndex ( cBlue ), mcGreen ( cGreen ), mcRed ( cRed ), _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
