[Libreoffice-commits] core.git: sw/source

Stephan Bergmann sbergman at redhat.com
Thu Apr 17 07:36:04 PDT 2014


 sw/source/filter/ww8/ww8par2.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 6269c009ea0c4ef6037e435d8e759db954ed54fe
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 17 16:35:09 2014 +0200

    Fix pointer casting
    
    Change-Id: I813168cbaa99d421886fc27be34efdfd7d97e0d4

diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 5bcc3e0..6b3cd27 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -21,6 +21,7 @@
 
 #include <boost/noncopyable.hpp>
 #include <boost/scoped_ptr.hpp>
+#include <boost/static_assert.hpp>
 #include <comphelper/string.hxx>
 #include <tools/solar.h>
 #include <vcl/vclenum.hxx>
@@ -1243,8 +1244,9 @@ void WW8TabBandDesc::ProcessSprmTTableBorders(int nBrcVer, const sal_uInt8* pPar
     }
     else if ( nBrcVer == 8 )
     {
+        BOOST_STATIC_ASSERT(sizeof (WW8_BRC) == 4);
         for( int i = 0; i < 6; ++i )
-            aDefBrcs[i] = ((WW8_BRC*)&pParams)[i];
+            aDefBrcs[i] = reinterpret_cast<WW8_BRC const *>(pParams)[i];
     }
     else
         memcpy( aDefBrcs, pParams, sizeof( aDefBrcs ) );


More information about the Libreoffice-commits mailing list