[Libreoffice-commits] core.git: 2 commits - avmedia/source basebmp/source basic/source compilerplugins/clang connectivity/source cpputools/source extensions/source include/basebmp include/cppu include/dbaccess include/svx include/tools io/source mysqlc/source sc/inc sc/source toolkit/source xmloff/source

Stephan Bergmann sbergman at redhat.com
Sun Mar 29 06:14:16 PDT 2015


 avmedia/source/vlc/wrapper/SymbolLoader.hxx          |    4 ++--
 basebmp/source/bitmapdevice.cxx                      |    2 +-
 basic/source/comp/codegen.cxx                        |    8 ++++----
 compilerplugins/clang/cstylecast.cxx                 |    4 ----
 connectivity/source/drivers/evoab2/EApi.cxx          |    4 ++--
 connectivity/source/drivers/firebird/ResultSet.cxx   |    2 +-
 connectivity/source/drivers/kab/KDriver.cxx          |    2 +-
 cpputools/source/unoexe/unoexe.cxx                   |    2 +-
 extensions/source/propctrlr/stringrepresentation.cxx |    2 +-
 include/basebmp/accessorfunctors.hxx                 |    8 ++++----
 include/basebmp/rgbmaskpixelformats.hxx              |   18 +++++++++---------
 include/cppu/Map.hxx                                 |    4 ++--
 include/dbaccess/genericcontroller.hxx               |    2 +-
 include/svx/ofaitem.hxx                              |    2 +-
 include/tools/link.hxx                               |    2 +-
 io/source/acceptor/acc_socket.cxx                    |    2 +-
 io/source/connector/connector.hxx                    |    2 +-
 mysqlc/source/mysqlc_preparedstatement.cxx           |    2 +-
 sc/inc/stlalgorithm.hxx                              |    2 +-
 sc/source/core/data/compressedarray.cxx              |    8 ++++----
 sc/source/core/opencl/formulagroupcl.cxx             |   14 +++++++-------
 sc/source/ui/inc/ChildWindowWrapper.hxx              |    2 +-
 sc/source/ui/unoobj/cellsuno.cxx                     |    2 +-
 toolkit/source/awt/scrollabledialog.cxx              |    2 +-
 xmloff/source/text/XMLPropertyBackpatcher.cxx        |    4 ++--
 25 files changed, 51 insertions(+), 55 deletions(-)

New commits:
commit a52cf476e7cec9d0c70dd4ee93cbd328b66479ad
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sun Mar 29 15:13:23 2015 +0200

    Clean up template-parameter-dependent C-style casts
    
    Change-Id: Ia1ab134a0afbeeb3ae40264bd4233a47df26b734

diff --git a/avmedia/source/vlc/wrapper/SymbolLoader.hxx b/avmedia/source/vlc/wrapper/SymbolLoader.hxx
index 3f90895..dce28f6 100644
--- a/avmedia/source/vlc/wrapper/SymbolLoader.hxx
+++ b/avmedia/source/vlc/wrapper/SymbolLoader.hxx
@@ -73,8 +73,8 @@ namespace
     {
         for (size_t i = 0; i < N; ++i)
         {
-            SymbolFunc aMethod = ( SymbolFunc )osl_getFunctionSymbol
-                ( aModule, OUString::createFromAscii( pMap[ i ].symName ).pData );
+            SymbolFunc aMethod = reinterpret_cast<SymbolFunc>(osl_getFunctionSymbol
+                ( aModule, OUString::createFromAscii( pMap[ i ].symName ).pData ));
             if ( !aMethod )
             {
                 SAL_WARN("avmedia", "Cannot load method " << pMap[ i ].symName);
diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx
index 71a2e85..0e2e004 100644
--- a/basebmp/source/bitmapdevice.cxx
+++ b/basebmp/source/bitmapdevice.cxx
@@ -762,7 +762,7 @@ namespace
             sal_Int32 nDestX = rDstRect.getMinX();
             sal_Int32 nDestY = rDstRect.getMinY();
 
-            char* dstBuf =  (char*)getBuffer().get();
+            char* dstBuf =  reinterpret_cast<char*>(getBuffer().get());
             char* srcBuf =  reinterpret_cast<char*>(rSrcBitmap->getBuffer().get());
             sal_Int32 dstStride =  getScanlineStride();
             sal_Int32 srcStride =  rSrcBitmap->getScanlineStride();
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index 8d4abe7..8b199c4 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -520,7 +520,7 @@ public:
                 break;
 
         }
-        m_ConvertedBuf += (S)nOp1;
+        m_ConvertedBuf += static_cast<S>(nOp1);
     }
     virtual void processOpCode2( SbiOpcode eOp, T nOp1, T nOp2 )
     {
@@ -528,8 +528,8 @@ public:
         if ( eOp == _CASEIS )
                 if ( nOp1 )
                     nOp1 = static_cast<T>( convertBufferOffSet(m_pStart, nOp1) );
-        m_ConvertedBuf += (S)nOp1;
-        m_ConvertedBuf += (S)nOp2;
+        m_ConvertedBuf += static_cast<S>(nOp1);
+        m_ConvertedBuf += static_cast<S>(nOp2);
 
     }
     virtual bool processParams(){ return true; }
@@ -569,7 +569,7 @@ PCodeBuffConvertor<T,S>::convert()
     PCodeBufferWalker< T > aBuf( m_pStart, m_nSize );
     BufferTransformer< T, S > aTrnsfrmer;
     aBuf.visitBuffer( aTrnsfrmer );
-    m_pCnvtdBuf = (sal_uInt8*)aTrnsfrmer.buffer().GetBuffer();
+    m_pCnvtdBuf = reinterpret_cast<sal_uInt8*>(aTrnsfrmer.buffer().GetBuffer());
     m_nCnvtdSize = static_cast<S>( aTrnsfrmer.buffer().GetSize() );
 }
 
diff --git a/compilerplugins/clang/cstylecast.cxx b/compilerplugins/clang/cstylecast.cxx
index 47e8d17..d34e729 100644
--- a/compilerplugins/clang/cstylecast.cxx
+++ b/compilerplugins/clang/cstylecast.cxx
@@ -120,10 +120,6 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr * expr) {
             incompTo = "incomplete ";
         }
     }
-    // ignore stuff from inside templates for now
-    if( expr->getCastKind() == CK_Dependent ) {
-        return true;
-    }
     if (externCFunction || expr->getLocStart().isMacroID()) {
         SourceLocation spellingLocation = compiler.getSourceManager().getSpellingLoc(
             expr->getLocStart());
diff --git a/connectivity/source/drivers/evoab2/EApi.cxx b/connectivity/source/drivers/evoab2/EApi.cxx
index 1bc88ae..e3120d8 100644
--- a/connectivity/source/drivers/evoab2/EApi.cxx
+++ b/connectivity/source/drivers/evoab2/EApi.cxx
@@ -112,8 +112,8 @@ tryLink( oslModule &aModule, const char *pName, const ApiMap (&pMap)[N])
 {
     for (guint i = 0; i < N; ++i)
     {
-        SymbolFunc aMethod = (SymbolFunc)osl_getFunctionSymbol
-            (aModule, OUString::createFromAscii ( pMap[ i ].sym_name ).pData);
+        SymbolFunc aMethod = reinterpret_cast<SymbolFunc>(osl_getFunctionSymbol
+            (aModule, OUString::createFromAscii ( pMap[ i ].sym_name ).pData));
         if( !aMethod )
         {
             fprintf( stderr, "Warning: missing symbol '%s' in '%s'\n",
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index d3531d7..2dfe6be 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -381,7 +381,7 @@ T OResultSet::retrieveValue(const sal_Int32 nColumnIndex, const ISC_SHORT nType)
         return T();
 
     if ((m_pSqlda->sqlvar[nColumnIndex-1].sqltype & ~1) == nType)
-        return *((T*) m_pSqlda->sqlvar[nColumnIndex-1].sqldata);
+        return *reinterpret_cast<T*>(m_pSqlda->sqlvar[nColumnIndex-1].sqldata);
     else
         return retrieveValue< ORowSetValue >(nColumnIndex, 0);
 }
diff --git a/connectivity/source/drivers/kab/KDriver.cxx b/connectivity/source/drivers/kab/KDriver.cxx
index 3deb36b..21bf85d 100644
--- a/connectivity/source/drivers/kab/KDriver.cxx
+++ b/connectivity/source/drivers/kab/KDriver.cxx
@@ -107,7 +107,7 @@ namespace
         {
 
             const OUString sSymbolName = OUString::createFromAscii( _pAsciiSymbolName );
-            _rFunction = (FUNCTION)( osl_getSymbol( _rModule, sSymbolName.pData ) );
+            _rFunction = reinterpret_cast<FUNCTION>( osl_getSymbol( _rModule, sSymbolName.pData ) );
 
             if ( !_rFunction )
             {   // did not find the symbol
diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx
index 94c0e11..b292deb 100644
--- a/cpputools/source/unoexe/unoexe.cxx
+++ b/cpputools/source/unoexe/unoexe.cxx
@@ -174,7 +174,7 @@ void createInstance(
     rxOut = Reference< T >::query( x );
     if (! rxOut.is())
     {
-        const Type & rType = ::getCppuType( (const Reference< T > *)0 );
+        const Type & rType = cppu::UnoType<T>::get();
         throw RuntimeException(
             "service instance \"" + rServiceName +
             "\" does not support demanded interface \"" +
diff --git a/extensions/source/propctrlr/stringrepresentation.cxx b/extensions/source/propctrlr/stringrepresentation.cxx
index d0c253c..ba0cad9 100644
--- a/extensions/source/propctrlr/stringrepresentation.cxx
+++ b/extensions/source/propctrlr/stringrepresentation.cxx
@@ -359,7 +359,7 @@ namespace
         do
         {
             _out_SplitUp.realloc( _out_SplitUp.getLength() + 1 );
-            _out_SplitUp[ _out_SplitUp.getLength() - 1 ] = (ElementType)_rTransformer( _rComposed.getToken( 0, '\n', tokenPos ) );
+            _out_SplitUp[ _out_SplitUp.getLength() - 1 ] = static_cast<ElementType>(_rTransformer( _rComposed.getToken( 0, '\n', tokenPos ) ));
         }
         while ( tokenPos != -1 );
     }
diff --git a/include/basebmp/accessorfunctors.hxx b/include/basebmp/accessorfunctors.hxx
index 87edfed..02e3aba 100644
--- a/include/basebmp/accessorfunctors.hxx
+++ b/include/basebmp/accessorfunctors.hxx
@@ -82,7 +82,7 @@ template< typename T,
 
         // mask will be 0, iff m == 0, and 1 otherwise
         const T mask( unsigned_cast<T>(m | -m) >> (sizeof(unsigned_T)*8 - 1) );
-        return v1*(M)(1-mask) + v2*mask;
+        return v1*static_cast<M>(1-mask) + v2*mask;
     }
 };
 template< typename T,
@@ -98,7 +98,7 @@ template< typename T,
 
         // mask will be 0, iff m == 0, and 1 otherwise
         const T mask( unsigned_cast<T>(m | -m) >> (sizeof(unsigned_T)*8 - 1) );
-        return v1*mask + v2*(M)(1-mask);
+        return v1*mask + v2*static_cast<M>(1-mask);
     }
 };
 
@@ -114,7 +114,7 @@ template< typename T, typename M > struct FastIntegerOutputMaskFunctor<T,M,true>
     {
         OSL_ASSERT(m<=1);
 
-        return v1*(M)(1-m) + v2*m;
+        return v1*static_cast<M>(1-m) + v2*m;
     }
 };
 template< typename T, typename M > struct FastIntegerOutputMaskFunctor<T,M,false> :
@@ -125,7 +125,7 @@ template< typename T, typename M > struct FastIntegerOutputMaskFunctor<T,M,false
     {
         OSL_ASSERT(m<=1);
 
-        return v1*m + v2*(M)(1-m);
+        return v1*m + v2*static_cast<M>(1-m);
     }
 };
 
diff --git a/include/basebmp/rgbmaskpixelformats.hxx b/include/basebmp/rgbmaskpixelformats.hxx
index 060c0a9..262b17e 100644
--- a/include/basebmp/rgbmaskpixelformats.hxx
+++ b/include/basebmp/rgbmaskpixelformats.hxx
@@ -118,29 +118,29 @@ template< typename     PixelType,
         // spread the value into the component_type range
         ColorType res( (shiftRight(red,
                                    base_type::red_shift-8*
-                                   (signed)sizeof(typename base_type::component_type)+
+                                   static_cast<signed>(sizeof(typename base_type::component_type))+
                                    base_type::red_bits)) |
                        (shiftRight(red,
                                    base_type::red_shift-8*
-                                   (signed)sizeof(typename base_type::component_type)+
+                                   static_cast<signed>(sizeof(typename base_type::component_type))+
                                    2*base_type::red_bits)),
 
                        (shiftRight(green,
                                    base_type::green_shift-8*
-                                   (signed)sizeof(typename base_type::component_type)+
+                                   static_cast<signed>(sizeof(typename base_type::component_type))+
                                    base_type::green_bits)) |
                        (shiftRight(green,
                                    base_type::green_shift-8*
-                                   (signed)sizeof(typename base_type::component_type)+
+                                   static_cast<signed>(sizeof(typename base_type::component_type))+
                                    2*base_type::green_bits)),
 
                        (shiftRight(blue,
                                    base_type::blue_shift-8*
-                                   (signed)sizeof(typename base_type::component_type)+
+                                   static_cast<signed>(sizeof(typename base_type::component_type))+
                                    base_type::blue_bits)) |
                        (shiftRight(blue,
                                    base_type::blue_shift-8*
-                                   (signed)sizeof(typename base_type::component_type)+
+                                   static_cast<signed>(sizeof(typename base_type::component_type))+
                                    2*base_type::blue_bits)) );
         return res;
     }
@@ -178,15 +178,15 @@ template< typename     PixelType,
             BaseValue |
             (shiftLeft(red,
                        base_type::red_shift-8*
-                       (signed)sizeof(typename base_type::component_type)+
+                       static_cast<signed>(sizeof(typename base_type::component_type))+
                        base_type::red_bits) & RedMask) |
             (shiftLeft(green,
                        base_type::green_shift-8*
-                       (signed)sizeof(typename base_type::component_type)+
+                       static_cast<signed>(sizeof(typename base_type::component_type))+
                        base_type::green_bits) & GreenMask) |
             (shiftLeft(blue,
                        base_type::blue_shift-8*
-                       (signed)sizeof(typename base_type::component_type)+
+                       static_cast<signed>(sizeof(typename base_type::component_type))+
                        base_type::blue_bits) & BlueMask) );
 
         return SwapBytes ? byteSwap(res) : res;
diff --git a/include/cppu/Map.hxx b/include/cppu/Map.hxx
index 2b63979..20b5f26 100644
--- a/include/cppu/Map.hxx
+++ b/include/cppu/Map.hxx
@@ -40,7 +40,7 @@ namespace cppu
     {
         css::uno::Mapping curr2outer(css::uno::Environment::getCurrent(), outerEnv);
 
-        return reinterpret_cast<T *>(curr2outer.mapInterface(pT, getCppuType((css::uno::Reference<T> *)NULL)));
+        return reinterpret_cast<T *>(curr2outer.mapInterface(pT, cppu::UnoType<T>::get()));
     }
 
 
@@ -55,7 +55,7 @@ namespace cppu
     {
         css::uno::Mapping outer2curr(outerEnv, css::uno::Environment::getCurrent());
 
-        return reinterpret_cast<T *>(outer2curr.mapInterface(pT, getCppuType((css::uno::Reference<T> *)NULL)));
+        return reinterpret_cast<T *>(outer2curr.mapInterface(pT, cppu::UnoType<T>::get()));
     }
 
 
diff --git a/include/dbaccess/genericcontroller.hxx b/include/dbaccess/genericcontroller.hxx
index 5c6a659..acd0e06 100644
--- a/include/dbaccess/genericcontroller.hxx
+++ b/include/dbaccess/genericcontroller.hxx
@@ -83,7 +83,7 @@ namespace dbaui
     public:
                  optional ( ) : base_type( ) { }
         explicit optional ( T const& val ) : base_type( val ) { }
-                 optional ( optional const& rhs ) : base_type( (base_type const&)rhs ) { }
+                 optional ( optional const& rhs ) : base_type( static_cast<base_type const&>(rhs) ) { }
 
     public:
         optional& operator= ( T const& rhs )
diff --git a/include/svx/ofaitem.hxx b/include/svx/ofaitem.hxx
index cc648b9..482f9fe 100644
--- a/include/svx/ofaitem.hxx
+++ b/include/svx/ofaitem.hxx
@@ -57,7 +57,7 @@ public:
     {}
     virtual bool operator==( const SfxPoolItem& rItem ) const SAL_OVERRIDE
     {
-        return mxRef == ((OfaRefItem<reference_type> &)rItem).mxRef;
+        return mxRef == static_cast<OfaRefItem<reference_type> const &>(rItem).mxRef;
     }
     virtual SfxPoolItem*Clone( SfxItemPool* /*pPool = 0*/ ) const SAL_OVERRIDE
     {
diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx
index 89fb44d..bf65691 100644
--- a/io/source/acceptor/acc_socket.cxx
+++ b/io/source/acceptor/acc_socket.cxx
@@ -42,7 +42,7 @@ namespace io_acceptor {
     {
         size_t operator () (const ::com::sun::star::uno::Reference<T> & ref) const
         {
-            return (size_t)ref.get();
+            return reinterpret_cast<size_t>(ref.get());
         }
     };
 
diff --git a/io/source/connector/connector.hxx b/io/source/connector/connector.hxx
index 8c439ad..fe059bd 100644
--- a/io/source/connector/connector.hxx
+++ b/io/source/connector/connector.hxx
@@ -37,7 +37,7 @@ namespace stoc_connector
     {
         size_t operator () (const ::com::sun::star::uno::Reference<T> & ref) const
         {
-            return (size_t)ref.get();
+            return reinterpret_cast<size_t>(ref.get());
         }
     };
 
diff --git a/mysqlc/source/mysqlc_preparedstatement.cxx b/mysqlc/source/mysqlc_preparedstatement.cxx
index 99c1ab5..6b68f6e 100644
--- a/mysqlc/source/mysqlc_preparedstatement.cxx
+++ b/mysqlc/source/mysqlc_preparedstatement.cxx
@@ -536,7 +536,7 @@ namespace
         sal_Int32 nValue(0);
         if ( !( _value >>= nValue ) )
             mysqlc_sdbc_driver::throwInvalidArgumentException( "OPreparedStatement::setObjectWithInfo", _rxParam );
-        (_rxParam.get()->*_Setter)( _parameterIndex, (INTTYPE)nValue );
+        (_rxParam.get()->*_Setter)( _parameterIndex, static_cast<INTTYPE>(nValue) );
     }
 }
 
diff --git a/sc/inc/stlalgorithm.hxx b/sc/inc/stlalgorithm.hxx
index 3c70144..6446097 100644
--- a/sc/inc/stlalgorithm.hxx
+++ b/sc/inc/stlalgorithm.hxx
@@ -65,7 +65,7 @@ public:
 
     pointer allocate(size_type n)
     {
-        return (pointer)rtl_allocateAlignedMemory(_Alignment, n*sizeof(value_type));
+        return static_cast<pointer>(rtl_allocateAlignedMemory(_Alignment, n*sizeof(value_type)));
     }
 
     void deallocate(pointer p, size_type)
diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx
index ebe2822..36249d2 100644
--- a/sc/source/core/data/compressedarray.cxx
+++ b/sc/source/core/data/compressedarray.cxx
@@ -96,14 +96,14 @@ size_t ScCompressedArray<A,D>::Search( A nAccess ) const
     {
         i = (nLo + nHi) / 2;
         if (i > 0)
-            nStart = (long) pData[i - 1].nEnd;
+            nStart = static_cast<long>(pData[i - 1].nEnd);
         else
             nStart = -1;
-        nEnd = (long) pData[i].nEnd;
-        if (nEnd < (long) nAccess)
+        nEnd = static_cast<long>(pData[i].nEnd);
+        if (nEnd < static_cast<long>(nAccess))
             nLo = ++i;
         else
-            if (nStart >= (long) nAccess)
+            if (nStart >= static_cast<long>(nAccess))
                 nHi = --i;
             else
                 bFound = true;
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 085a582..3821480 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -1511,7 +1511,7 @@ public:
             throw OpenCLError("clSetKernelArg", err, __FILE__, __LINE__);
 
         SAL_INFO("sc.opencl", "Kernel " << redKernel << " arg " << 1 << ": cl_mem: " << mpClmem2);
-        err = clSetKernelArg(redKernel, 1, sizeof(cl_mem), (void*)&mpClmem2);
+        err = clSetKernelArg(redKernel, 1, sizeof(cl_mem), &mpClmem2);
         if (CL_SUCCESS != err)
             throw OpenCLError("clSetKernelArg", err, __FILE__, __LINE__);
 
@@ -1540,11 +1540,11 @@ public:
         {
             /*average need more reduction kernel for count computing*/
             boost::scoped_array<double> pAllBuffer(new double[2 * w]);
-            double* resbuf = (double*)clEnqueueMapBuffer(kEnv.mpkCmdQueue,
+            double* resbuf = static_cast<double*>(clEnqueueMapBuffer(kEnv.mpkCmdQueue,
                 mpClmem2,
                 CL_TRUE, CL_MAP_READ, 0,
                 sizeof(double) * w, 0, NULL, NULL,
-                &err);
+                &err));
             if (err != CL_SUCCESS)
                 throw OpenCLError("clEnqueueMapBuffer", err, __FILE__, __LINE__);
 
@@ -1569,7 +1569,7 @@ public:
                 throw OpenCLError("clSetKernelArg", err, __FILE__, __LINE__);
 
             SAL_INFO("sc.opencl", "Kernel " << redKernel << " arg " << 1 << ": cl_mem: " << mpClmem2);
-            err = clSetKernelArg(redKernel, 1, sizeof(cl_mem), (void*)&mpClmem2);
+            err = clSetKernelArg(redKernel, 1, sizeof(cl_mem), &mpClmem2);
             if (CL_SUCCESS != err)
                 throw OpenCLError("clSetKernelArg", err, __FILE__, __LINE__);
 
@@ -1594,11 +1594,11 @@ public:
             err = clFinish(kEnv.mpkCmdQueue);
             if (CL_SUCCESS != err)
                 throw OpenCLError("clFinish", err, __FILE__, __LINE__);
-            resbuf = (double*)clEnqueueMapBuffer(kEnv.mpkCmdQueue,
+            resbuf = static_cast<double*>(clEnqueueMapBuffer(kEnv.mpkCmdQueue,
                 mpClmem2,
                 CL_TRUE, CL_MAP_READ, 0,
                 sizeof(double) * w, 0, NULL, NULL,
-                &err);
+                &err));
             if (err != CL_SUCCESS)
                 throw OpenCLError("clEnqueueMapBuffer", err, __FILE__, __LINE__);
             for (int i = 0; i < w; i++)
@@ -1622,7 +1622,7 @@ public:
         }
         // set kernel arg
         SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": cl_mem: " << mpClmem2);
-        err = clSetKernelArg(k, argno, sizeof(cl_mem), (void*)&(mpClmem2));
+        err = clSetKernelArg(k, argno, sizeof(cl_mem), &(mpClmem2));
         if (CL_SUCCESS != err)
             throw OpenCLError("clSetKernelArg", err, __FILE__, __LINE__);
         return 1;
diff --git a/sc/source/ui/inc/ChildWindowWrapper.hxx b/sc/source/ui/inc/ChildWindowWrapper.hxx
index 3d52f96..48938e9 100644
--- a/sc/source/ui/inc/ChildWindowWrapper.hxx
+++ b/sc/source/ui/inc/ChildWindowWrapper.hxx
@@ -62,7 +62,7 @@ public:
     virtual SfxChildWinInfo GetInfo() const SAL_OVERRIDE
     {
         SfxChildWinInfo aInfo = SfxChildWindow::GetInfo();
-        ((SfxModelessDialog*)GetWindow())->FillInfo( aInfo );
+        static_cast<SfxModelessDialog*>(GetWindow())->FillInfo( aInfo );
         return aInfo;
     }
 
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 0ea5355..9b53074 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -959,7 +959,7 @@ template<typename TableBorderType>
 void lcl_fillBoxItems( SvxBoxItem& rOuter, SvxBoxInfoItem& rInner, const TableBorderType& rBorder )
 {
     ::editeng::SvxBorderLine aLine;
-    rOuter.SetDistance( (sal_uInt16)HMMToTwips( rBorder.Distance ) );
+    rOuter.SetDistance( static_cast<sal_uInt16>(HMMToTwips( rBorder.Distance )) );
     rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.TopLine ),         BOX_LINE_TOP );
     rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.BottomLine ),      BOX_LINE_BOTTOM );
     rOuter.SetLine( ScHelperFunctions::GetBorderLine( aLine, rBorder.LeftLine ),        BOX_LINE_LEFT );
diff --git a/toolkit/source/awt/scrollabledialog.cxx b/toolkit/source/awt/scrollabledialog.cxx
index 650cc12..823fba3 100644
--- a/toolkit/source/awt/scrollabledialog.cxx
+++ b/toolkit/source/awt/scrollabledialog.cxx
@@ -106,7 +106,7 @@ void ScrollableWrapper<T>::lcl_Scroll( long nX, long nY )
 template< class T>
 sal_IntPtr ScrollableWrapper<T>::LinkStubScrollBarHdl( void* pThis, void* pCaller)
 {
-    return ((ScrollableWrapper<T>*)pThis )->ScrollBarHdl( static_cast<ScrollBar*>(pCaller) );
+    return static_cast<ScrollableWrapper<T>*>(pThis)->ScrollBarHdl( static_cast<ScrollBar*>(pCaller) );
 }
 
 template< class T>
diff --git a/xmloff/source/text/XMLPropertyBackpatcher.cxx b/xmloff/source/text/XMLPropertyBackpatcher.cxx
index f244d0a..5844b09 100644
--- a/xmloff/source/text/XMLPropertyBackpatcher.cxx
+++ b/xmloff/source/text/XMLPropertyBackpatcher.cxx
@@ -62,7 +62,7 @@ void XMLPropertyBackpatcher<A>::ResolveId(
     {
         // aah, we have a backpatch list!
         BackpatchListType* pList =
-            (BackpatchListType*)aBackpatchListMap[sName];
+            static_cast<BackpatchListType*>(aBackpatchListMap[sName]);
 
         // a) remove list from list map
         aBackpatchListMap.erase(sName);
@@ -133,7 +133,7 @@ void XMLPropertyBackpatcher<A>::SetProperty(
         }
 
         // insert footnote
-        ((BackpatchListType*)aBackpatchListMap[sName])->push_back(xPropSet);
+        static_cast<BackpatchListType*>(aBackpatchListMap[sName])->push_back(xPropSet);
     }
 }
 
commit c266ba458f444e5f4a4bafbf4073710c31897536
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sun Mar 29 15:11:01 2015 +0200

    Remove redundant C-style cast
    
    Change-Id: I1785b47bf24f6be55f7ee346c9972ffa12cd138b

diff --git a/include/tools/link.hxx b/include/tools/link.hxx
index 566927c..b71b585 100644
--- a/include/tools/link.hxx
+++ b/include/tools/link.hxx
@@ -70,7 +70,7 @@ typedef sal_IntPtr (*PSTUB)( void*, void* );
     sal_IntPtr Class::Method( SAL_UNUSED_PARAMETER Class*, SAL_UNUSED_PARAMETER void* )
 
 #define LINK( Inst, Class, Member ) \
-    Link( static_cast<Class*>(Inst), (PSTUB)&Class::LinkStub##Member )
+    Link( static_cast<Class*>(Inst), &Class::LinkStub##Member )
 
 #define STATIC_LINK( Inst, Class, Member ) LINK(Inst, Class, Member)
 


More information about the Libreoffice-commits mailing list