[Libreoffice-commits] core.git: include/vcl svtools/source

Daniel Robertson danlrobertson89 at gmail.com
Wed Sep 16 04:02:58 PDT 2015


 include/vcl/checksum.hxx            |   19 +++++++++----------
 svtools/source/graphic/grfcache.cxx |    2 +-
 2 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 54045cc813c79e53abe608cc1a8d35ee7177465e
Author: Daniel Robertson <danlrobertson89 at gmail.com>
Date:   Tue Sep 15 14:51:26 2015 -0400

    tdf#94228 vcl: replace BOOST_PP with templates
    
    Replace BOOST_PP macros in Bitmap Checksum to Bitmap Checksum Octet
    Array with templates.
    
    Change-Id: Ia7cbc20c90b4d99d54760580e3db10afac9020f3
    Reviewed-on: https://gerrit.libreoffice.org/18597
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx
index 7e1076f..21674a8 100644
--- a/include/vcl/checksum.hxx
+++ b/include/vcl/checksum.hxx
@@ -26,23 +26,22 @@
 #include <tools/solar.h>
 #include <vcl/dllapi.h>
 
-#include <boost/preprocessor/arithmetic/inc.hpp>
-#include <boost/preprocessor/arithmetic/mul.hpp>
-#include <boost/preprocessor/repetition/repeat_from_to.hpp>
-
 #define BITMAP_CHECKSUM_SIZE 8
-#define BITMAP_CHECKSUM_BITS BOOST_PP_MUL(BITMAP_CHECKSUM_SIZE, 8)
 
 typedef sal_uInt64   BitmapChecksum;
 typedef sal_uInt8   BitmapChecksumOctetArray[BITMAP_CHECKSUM_SIZE];
 
-#define BITMAP_CHECKSUM_SET_OCTET(z, i, unused) \
-p[i] = (sal_uInt8)(n >> BOOST_PP_MUL(8, i));
-
+template< sal_uInt8 N = 0 >
+inline void BCToBCOA( BitmapChecksum n, BitmapChecksumOctetArray p )
+{
+  p[N] = (sal_uInt8)(n >> ( 8 * N ));
+  return BCToBCOA< N + 1 >( n, p );
+}
 
-inline void BCToBCOA( BitmapChecksum n , BitmapChecksumOctetArray p )
+template<>
+inline void BCToBCOA< BITMAP_CHECKSUM_SIZE >( BitmapChecksum, BitmapChecksumOctetArray )
 {
-    BOOST_PP_REPEAT(BITMAP_CHECKSUM_SIZE , BITMAP_CHECKSUM_SET_OCTET, unused)
+    return;
 }
 
 #ifdef __cplusplus
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index ccc2440..2e29e31 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -134,7 +134,7 @@ OString GraphicID::GetIDString() const
     for( nShift = 28; nShift >= 0; nShift -= 4 )
         aHexStr[nIndex++] = aHexData[ ( mnID3 >> (sal_uInt32) nShift ) & 0xf ];
 
-    for( nShift = BITMAP_CHECKSUM_BITS - 4; nShift >= 0; nShift -= 4 )
+    for( nShift = ( 8 * BITMAP_CHECKSUM_SIZE ) - 4; nShift >= 0; nShift -= 4 )
         aHexStr[nIndex++] = aHexData[ ( mnID4 >> (sal_uInt32) nShift ) & 0xf ];
 
     return aHexStr.makeStringAndClear();


More information about the Libreoffice-commits mailing list