diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-18 21:28:44 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-20 09:06:51 +0100 |
commit | ebb137bd9405f7a147d2c80e2633a221813c72f3 (patch) | |
tree | 027663f67662bf06a54b539f5a22b6a5454db07c | |
parent | abf133355ffa6a3cda1e44969cd0716cab4f6e61 (diff) |
Some more loplugin:cstylecast: sc
Change-Id: I75adf1973083a6f4519133f9e97ad83fd7d8658a
-rw-r--r-- | sc/inc/chgtrack.hxx | 23 | ||||
-rw-r--r-- | sc/source/core/tool/callform.cxx | 46 | ||||
-rw-r--r-- | sc/source/core/tool/chgtrack.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 12 | ||||
-rw-r--r-- | sc/source/core/tool/interpr7.cxx | 10 | ||||
-rw-r--r-- | sc/source/core/tool/rangelst.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/tool/rangeseq.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/rechead.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xistream.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/inc/htmlimp.hxx | 5 | ||||
-rw-r--r-- | sc/source/filter/inc/lotattr.hxx | 8 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scabstdlg.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/tabpages.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/tpsubt.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/servobj.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/tpsubt.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/navipi/content.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 10 |
21 files changed, 85 insertions, 81 deletions
diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx index f21fa10916fa..d808dbf884c6 100644 --- a/sc/inc/chgtrack.hxx +++ b/sc/inc/chgtrack.hxx @@ -462,17 +462,10 @@ class ScChangeActionDelMoveEntry : public ScChangeActionLinkEntry short nCutOffFrom; short nCutOffTo; - ScChangeActionDelMoveEntry( + inline ScChangeActionDelMoveEntry( ScChangeActionDelMoveEntry** ppPrevP, ScChangeActionMove* pMove, - short nFrom, short nTo ) - : ScChangeActionLinkEntry( - (ScChangeActionLinkEntry**) - ppPrevP, - (ScChangeAction*) pMove ), - nCutOffFrom( nFrom ), - nCutOffTo( nTo ) - {} + short nFrom, short nTo ); ScChangeActionDelMoveEntry* GetNext() { @@ -638,6 +631,18 @@ public: OUString& rStr, ScDocument* pDoc, bool bFlag3D = false ) const SAL_OVERRIDE; }; +ScChangeActionDelMoveEntry::ScChangeActionDelMoveEntry( + ScChangeActionDelMoveEntry** ppPrevP, + ScChangeActionMove* pMove, + short nFrom, short nTo ) + : ScChangeActionLinkEntry( + reinterpret_cast<ScChangeActionLinkEntry**>( + ppPrevP), + (ScChangeAction*) pMove ), + nCutOffFrom( nFrom ), + nCutOffTo( nTo ) +{} + inline ScChangeActionMove* ScChangeActionDelMoveEntry::GetMove() { return static_cast<ScChangeActionMove*>( diff --git a/sc/source/core/tool/callform.cxx b/sc/source/core/tool/callform.cxx index 9ab34f659ca0..64cc52bb8b43 100644 --- a/sc/source/core/tool/callform.cxx +++ b/sc/source/core/tool/callform.cxx @@ -187,7 +187,7 @@ bool InitExternalFunc(const OUString& rModuleName) { LanguageType eLanguage = Application::GetSettings().GetUILanguageTag().getLanguageType(); sal_uInt16 nLanguage = (sal_uInt16) eLanguage; - (*((SetLanguagePtr)fpSetLanguage))( nLanguage ); + (*reinterpret_cast<SetLanguagePtr>(fpSetLanguage))( nLanguage ); } // Module in die Collection aufnehmen @@ -198,7 +198,7 @@ bool InitExternalFunc(const OUString& rModuleName) AdvData pfCallBack = &ScAddInAsyncCallBack; FuncCollection* pFuncCol = ScGlobal::GetFuncCollection(); sal_uInt16 nCount; - (*((GetFuncCountPtr)fpGetCount))(nCount); + (*reinterpret_cast<GetFuncCountPtr>(fpGetCount))(nCount); for (sal_uInt16 i=0; i < nCount; i++) { sal_Char cFuncName[256]; @@ -214,13 +214,13 @@ bool InitExternalFunc(const OUString& rModuleName) { eParamType[j] = ParamType::NONE; } - (*((GetFuncDataPtr)fpGetData))(i, cFuncName, nParamCount, + (*reinterpret_cast<GetFuncDataPtr>(fpGetData))(i, cFuncName, nParamCount, eParamType, cInternalName); if( fpIsAsync ) { - (*((IsAsync)fpIsAsync))(i, &eAsyncType); + (*reinterpret_cast<IsAsync>(fpIsAsync))(i, &eAsyncType); if ( fpAdvice && eAsyncType != ParamType::NONE ) - (*((Advice)fpAdvice))( i, pfCallBack ); + (*reinterpret_cast<Advice>(fpAdvice))( i, pfCallBack ); } OUString aInternalName( cInternalName, strlen(cInternalName), osl_getThreadTextEncoding() ); OUString aFuncName( cFuncName, strlen(cFuncName), osl_getThreadTextEncoding() ); @@ -263,79 +263,79 @@ bool FuncData::Call(void** ppParam) const switch (nParamCount) { case 1 : - (*((ExFuncPtr1)fProc))(ppParam[0]); + (*reinterpret_cast<ExFuncPtr1>(fProc))(ppParam[0]); bRet = true; break; case 2 : - (*((ExFuncPtr2)fProc))(ppParam[0], ppParam[1]); + (*reinterpret_cast<ExFuncPtr2>(fProc))(ppParam[0], ppParam[1]); bRet = true; break; case 3 : - (*((ExFuncPtr3)fProc))(ppParam[0], ppParam[1], ppParam[2]); + (*reinterpret_cast<ExFuncPtr3>(fProc))(ppParam[0], ppParam[1], ppParam[2]); bRet = true; break; case 4 : - (*((ExFuncPtr4)fProc))(ppParam[0], ppParam[1], ppParam[2], ppParam[3]); + (*reinterpret_cast<ExFuncPtr4>(fProc))(ppParam[0], ppParam[1], ppParam[2], ppParam[3]); bRet = true; break; case 5 : - (*((ExFuncPtr5)fProc))(ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4]); + (*reinterpret_cast<ExFuncPtr5>(fProc))(ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4]); bRet = true; break; case 6 : - (*((ExFuncPtr6)fProc))(ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5]); + (*reinterpret_cast<ExFuncPtr6>(fProc))(ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5]); bRet = true; break; case 7 : - (*((ExFuncPtr7)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], + (*reinterpret_cast<ExFuncPtr7>(fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6]); bRet = true; break; case 8 : - (*((ExFuncPtr8)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], + (*reinterpret_cast<ExFuncPtr8>(fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7]); bRet = true; break; case 9 : - (*((ExFuncPtr9)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], + (*reinterpret_cast<ExFuncPtr9>(fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8]); bRet = true; break; case 10 : - (*((ExFuncPtr10)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], + (*reinterpret_cast<ExFuncPtr10>(fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9]); bRet = true; break; case 11 : - (*((ExFuncPtr11)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], + (*reinterpret_cast<ExFuncPtr11>(fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9], ppParam[10]); bRet = true; break; case 12: - (*((ExFuncPtr12)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], + (*reinterpret_cast<ExFuncPtr12>(fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9], ppParam[10], ppParam[11]); bRet = true; break; case 13: - (*((ExFuncPtr13)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], + (*reinterpret_cast<ExFuncPtr13>(fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9], ppParam[10], ppParam[11], ppParam[12]); bRet = true; break; case 14 : - (*((ExFuncPtr14)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], + (*reinterpret_cast<ExFuncPtr14>(fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9], ppParam[10], ppParam[11], ppParam[12], ppParam[13]); bRet = true; break; case 15 : - (*((ExFuncPtr15)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], + (*reinterpret_cast<ExFuncPtr15>(fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9], ppParam[10], ppParam[11], ppParam[12], ppParam[13], ppParam[14]); bRet = true; break; case 16 : - (*((ExFuncPtr16)fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], + (*reinterpret_cast<ExFuncPtr16>(fProc))( ppParam[0], ppParam[1], ppParam[2], ppParam[3], ppParam[4], ppParam[5], ppParam[6], ppParam[7], ppParam[8], ppParam[9], ppParam[10], ppParam[11], ppParam[12], ppParam[13], ppParam[14], ppParam[15]); bRet = true; @@ -358,7 +358,7 @@ bool FuncData::Unadvice( double nHandle ) FARPROC fProc = (FARPROC)pLib->getFunctionSymbol(UNADVICE); if (fProc != NULL) { - ((::Unadvice)fProc)(nHandle); + reinterpret_cast< ::Unadvice>(fProc)(nHandle); bRet = true; } return bRet; @@ -389,7 +389,7 @@ bool FuncData::getParamDesc( OUString& aName, OUString& aDesc, sal_uInt16 nParam sal_Char pcDesc[256]; *pcName = *pcDesc = 0; sal_uInt16 nFuncNo = nNumber; // nicht per Reference versauen lassen.. - ((::GetParamDesc)fProc)( nFuncNo, nParam, pcName, pcDesc ); + reinterpret_cast< ::GetParamDesc>(fProc)( nFuncNo, nParam, pcName, pcDesc ); aName = OUString( pcName, 256, osl_getThreadTextEncoding() ); aDesc = OUString( pcDesc, 256, osl_getThreadTextEncoding() ); bRet = true; diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index e96498441e29..957196008b9c 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -3327,7 +3327,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction* pAct, bool bUndo ) // First the generated ones, as if they were tracked previously! if ( pFirstGeneratedDelContent ) - UpdateReference( (ScChangeAction**)&pFirstGeneratedDelContent, pAct, + UpdateReference( reinterpret_cast<ScChangeAction**>(&pFirstGeneratedDelContent), pAct, bUndo ); UpdateReference( &pFirst, pAct, bUndo ); @@ -3344,7 +3344,7 @@ void ScChangeTrack::UpdateReference( ScChangeAction** ppFirstAction, { ScChangeActionType eActType = pAct->GetType(); bool bGeneratedDelContents = - ( ppFirstAction == (ScChangeAction**)&pFirstGeneratedDelContent ); + ( ppFirstAction == reinterpret_cast<ScChangeAction**>(&pFirstGeneratedDelContent) ); const ScBigRange& rOrgRange = pAct->GetBigRange(); ScBigRange aRange( rOrgRange ); ScBigRange aDelRange( rOrgRange ); diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 08f4dd52ab1b..0f09edb1dcc8 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -585,7 +585,7 @@ bool ScInterpreter::CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, return false; sal_uInt16 nCount = 0; - sal_uInt16* p = (sal_uInt16*) pCellArr; + sal_uInt16* p = reinterpret_cast<sal_uInt16*>(pCellArr); *p++ = static_cast<sal_uInt16>(nCol1); *p++ = static_cast<sal_uInt16>(nRow1); *p++ = static_cast<sal_uInt16>(nTab1); @@ -644,7 +644,7 @@ bool ScInterpreter::CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, *p++ = nErr; memcpy( p, &nVal, sizeof(double)); nPos += 8 + sizeof(double); - p = (sal_uInt16*) ( pCellArr + nPos ); + p = reinterpret_cast<sal_uInt16*>( pCellArr + nPos ); nCount++; } } @@ -671,7 +671,7 @@ bool ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, return false; sal_uInt16 nCount = 0; - sal_uInt16* p = (sal_uInt16*) pCellArr; + sal_uInt16* p = reinterpret_cast<sal_uInt16*>(pCellArr); *p++ = static_cast<sal_uInt16>(nCol1); *p++ = static_cast<sal_uInt16>(nRow1); *p++ = static_cast<sal_uInt16>(nTab1); @@ -741,7 +741,7 @@ bool ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, sal_uInt8* q = ( pCellArr + nPos ); if( (nStrLen & 1) == 0 ) *q++ = 0, nPos++; - p = (sal_uInt16*) ( pCellArr + nPos ); + p = reinterpret_cast<sal_uInt16*>( pCellArr + nPos ); nCount++; } } @@ -768,7 +768,7 @@ bool ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, return false; sal_uInt16 nCount = 0; - sal_uInt16* p = (sal_uInt16*) pCellArr; + sal_uInt16* p = reinterpret_cast<sal_uInt16*>(pCellArr); *p++ = static_cast<sal_uInt16>(nCol1); *p++ = static_cast<sal_uInt16>(nRow1); *p++ = static_cast<sal_uInt16>(nTab1); @@ -860,7 +860,7 @@ bool ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, *q++ = 0, nPos++; } nCount++; - p = (sal_uInt16*) ( pCellArr + nPos ); + p = reinterpret_cast<sal_uInt16*>( pCellArr + nPos ); } } nCol++; diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx index 8131a5465d52..c5e9b7414a36 100644 --- a/sc/source/core/tool/interpr7.cxx +++ b/sc/source/core/tool/interpr7.cxx @@ -90,16 +90,16 @@ void ScInterpreter::ScFilterXML() { if(pNodeSet->nodeTab[0]->type == XML_NAMESPACE_DECL) { - xmlNsPtr ns = (xmlNsPtr)pNodeSet->nodeTab[0]; - xmlNodePtr cur = (xmlNodePtr)ns->next; + xmlNsPtr ns = reinterpret_cast<xmlNsPtr>(pNodeSet->nodeTab[0]); + xmlNodePtr cur = reinterpret_cast<xmlNodePtr>(ns->next); boost::shared_ptr<xmlChar> pChar2(xmlNodeGetContent(cur), xmlFree); - aResult = OStringToOUString(OString((char*)pChar2.get()), RTL_TEXTENCODING_UTF8); + aResult = OStringToOUString(OString(reinterpret_cast<char*>(pChar2.get())), RTL_TEXTENCODING_UTF8); } else { xmlNodePtr cur = pNodeSet->nodeTab[0]; boost::shared_ptr<xmlChar> pChar2(xmlNodeGetContent(cur), xmlFree); - aResult = OStringToOUString(OString((char*)pChar2.get()), RTL_TEXTENCODING_UTF8); + aResult = OStringToOUString(OString(reinterpret_cast<char*>(pChar2.get())), RTL_TEXTENCODING_UTF8); } } else @@ -123,7 +123,7 @@ void ScInterpreter::ScFilterXML() } break; case XPATH_STRING: - PushString(OUString::createFromAscii((char*)pXPathObj->stringval)); + PushString(OUString::createFromAscii(reinterpret_cast<char*>(pXPathObj->stringval))); break; case XPATH_POINT: PushNoValue(); diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index 788ef961ac0d..758434b31997 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -1589,8 +1589,8 @@ ScRangePair** ScRangePairList::CreateNameSortedArray( size_t& nListCount, nListCount = maPairs.size(); OSL_ENSURE( nListCount * sizeof(ScRangePairNameSort) <= (size_t)~0x1F, "ScRangePairList::CreateNameSortedArray nListCount * sizeof(ScRangePairNameSort) > (size_t)~0x1F" ); - ScRangePairNameSort* pSortArray = (ScRangePairNameSort*) - new sal_uInt8 [ nListCount * sizeof(ScRangePairNameSort) ]; + ScRangePairNameSort* pSortArray = reinterpret_cast<ScRangePairNameSort*>( + new sal_uInt8 [ nListCount * sizeof(ScRangePairNameSort) ]); sal_uLong j; for ( j=0; j < nListCount; j++ ) { @@ -1599,7 +1599,7 @@ ScRangePair** ScRangePairList::CreateNameSortedArray( size_t& nListCount, } qsort( (void*)pSortArray, nListCount, sizeof(ScRangePairNameSort), &ScRangePairList_QsortNameCompare ); // ScRangePair Pointer aufruecken - ScRangePair** ppSortArray = (ScRangePair**)pSortArray; + ScRangePair** ppSortArray = reinterpret_cast<ScRangePair**>(pSortArray); for ( j=0; j < nListCount; j++ ) { ppSortArray[j] = pSortArray[j].pPair; diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx index 46945de4d290..8875d346a74b 100644 --- a/sc/source/core/tool/rangeseq.cxx +++ b/sc/source/core/tool/rangeseq.cxx @@ -435,7 +435,7 @@ bool ScByteSequenceToString::GetString( OUString& rString, const uno::Any& rAny, uno::Sequence<sal_Int8> aSeq; if ( rAny >>= aSeq ) { - rString = OUString( (const sal_Char*)aSeq.getConstArray(), + rString = OUString( reinterpret_cast<const char*>(aSeq.getConstArray()), aSeq.getLength(), nEncoding ); rString = comphelper::string::stripEnd(rString, 0); return true; diff --git a/sc/source/core/tool/rechead.cxx b/sc/source/core/tool/rechead.cxx index f7566fe9cd97..86cbfe6288cf 100644 --- a/sc/source/core/tool/rechead.cxx +++ b/sc/source/core/tool/rechead.cxx @@ -52,7 +52,7 @@ ScMultipleReadHeader::ScMultipleReadHeader(SvStream& rNewStream) : rStream.ReadUInt32( nSizeTableLen ); pBuf = new sal_uInt8[nSizeTableLen]; rStream.Read( pBuf, nSizeTableLen ); - pMemStream = new SvMemoryStream( (char*)pBuf, nSizeTableLen, StreamMode::READ ); + pMemStream = new SvMemoryStream( pBuf, nSizeTableLen, StreamMode::READ ); } nEndPos = rStream.Tell(); diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index 8be07596abc0..911dac9cfe1d 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -135,7 +135,7 @@ uno::Sequence< beans::NamedValue > XclImpBiff5Decrypter::OnVerifyPassword( const if( (0 < nLen) && (nLen < 16) ) { // init codec - maCodec.InitKey( (sal_uInt8*)aBytePassword.getStr() ); + maCodec.InitKey( reinterpret_cast<sal_uInt8 const *>(aBytePassword.getStr()) ); if ( maCodec.VerifyKey( mnKey, mnHash ) ) { @@ -151,7 +151,7 @@ uno::Sequence< beans::NamedValue > XclImpBiff5Decrypter::OnVerifyPassword( const OSL_ENSURE( aDocId.getLength() == 16, "Unexpected length of the senquence!" ); ::msfilter::MSCodec_Std97 aCodec97; - aCodec97.InitKey( &aPassVect.front(), (sal_uInt8*)aDocId.getConstArray() ); + aCodec97.InitKey( &aPassVect.front(), reinterpret_cast<sal_uInt8 const *>(aDocId.getConstArray()) ); // merge the EncryptionData, there should be no conflicts ::comphelper::SequenceAsHashMap aEncryptionHash( maEncryptionData ); diff --git a/sc/source/filter/inc/htmlimp.hxx b/sc/source/filter/inc/htmlimp.hxx index 1e320c91a7f2..13c943362f2d 100644 --- a/sc/source/filter/inc/htmlimp.hxx +++ b/sc/source/filter/inc/htmlimp.hxx @@ -21,8 +21,7 @@ #define INCLUDED_SC_SOURCE_FILTER_INC_HTMLIMP_HXX #include "eeimport.hxx" - -class ScHTMLParser; +#include "htmlpars.hxx" class ScHTMLImport : public ScEEImport { @@ -32,7 +31,7 @@ private: public: ScHTMLImport( ScDocument* pDoc, const OUString& rBaseURL, const ScRange& rRange, bool bCalcWidthHeight ); virtual ~ScHTMLImport(); - const ScHTMLParser* GetParser() const { return (ScHTMLParser*)mpParser; } + const ScHTMLParser* GetParser() const { return static_cast<ScHTMLParser*>(mpParser); } virtual void WriteToDocument( bool bSizeColsRows = false, double nOutputFactor = 1.0, SvNumberFormatter* pFormatter = NULL, bool bConvertDate = true ) SAL_OVERRIDE; diff --git a/sc/source/filter/inc/lotattr.hxx b/sc/source/filter/inc/lotattr.hxx index fe5df58a6507..8069ce3f231b 100644 --- a/sc/source/filter/inc/lotattr.hxx +++ b/sc/source/filter/inc/lotattr.hxx @@ -83,10 +83,10 @@ private: inline static void MakeHash( const LotAttrWK3& rAttr, sal_uInt32& rOut ) { - ( ( sal_uInt8* ) &rOut )[ 0 ] = rAttr.nFont & 0x7F; - ( ( sal_uInt8* ) &rOut )[ 1 ] = rAttr.nLineStyle; - ( ( sal_uInt8* ) &rOut )[ 2 ] = rAttr.nFontCol; - ( ( sal_uInt8* ) &rOut )[ 3 ] = rAttr.nBack; + reinterpret_cast<sal_uInt8*>(&rOut)[ 0 ] = rAttr.nFont & 0x7F; + reinterpret_cast<sal_uInt8*>(&rOut)[ 1 ] = rAttr.nLineStyle; + reinterpret_cast<sal_uInt8*>(&rOut)[ 2 ] = rAttr.nFontCol; + reinterpret_cast<sal_uInt8*>(&rOut)[ 3 ] = rAttr.nBack; } static void LotusToScBorderLine( sal_uInt8 nLine, ::editeng::SvxBorderLine& ); diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 5f1f4d585a71..32955415d7f0 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1891,7 +1891,7 @@ void ScXMLExport::CopySourceStream( sal_Int32 nStartOffset, sal_Int32 nEndOffset if ( getExportFlags() & SvXMLExportFlags::PRETTY ) { const OString aOutStr("\n "); - uno::Sequence<sal_Int8> aOutSeq( (sal_Int8*)aOutStr.getStr(), aOutStr.getLength() ); + uno::Sequence<sal_Int8> aOutSeq( reinterpret_cast<sal_Int8 const *>(aOutStr.getStr()), aOutStr.getLength() ); xDestStream->writeBytes( aOutSeq ); } diff --git a/sc/source/ui/attrdlg/scabstdlg.cxx b/sc/source/ui/attrdlg/scabstdlg.cxx index 0717705b77fa..8d7fcef2791d 100644 --- a/sc/source/ui/attrdlg/scabstdlg.cxx +++ b/sc/source/ui/attrdlg/scabstdlg.cxx @@ -48,8 +48,8 @@ ScAbstractDialogFactory* ScAbstractDialogFactory::Create() if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, aStrBuf.makeStringAndClear(), SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) ) - fp = ( ScAbstractDialogFactory* (SAL_CALL*)() ) - aDialogLibrary.getFunctionSymbol( OUString("ScCreateDialogFactory") ); + fp = reinterpret_cast<ScAbstractDialogFactory* (SAL_CALL*)()>( + aDialogLibrary.getFunctionSymbol( OUString("ScCreateDialogFactory") )); #else fp = ScCreateDialogFactory(); #endif diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx index 5c4e6d1d5f5e..c6efd7884b66 100644 --- a/sc/source/ui/attrdlg/tabpages.cxx +++ b/sc/source/ui/attrdlg/tabpages.cxx @@ -76,7 +76,7 @@ void ScTabPageProtection::Reset( const SfxItemSet* rCoreAttrs ) sal_uInt16 nWhich = GetWhich( SID_SCATTR_PROTECTION ); const ScProtectionAttr* pProtAttr = NULL; SfxItemState eItemState = rCoreAttrs->GetItemState( nWhich, false, - (const SfxPoolItem**)&pProtAttr ); + reinterpret_cast<const SfxPoolItem**>(&pProtAttr) ); // Is this a Default-Item? if ( eItemState == SfxItemState::DEFAULT ) diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index 12aac8fa7713..ed84bc156f9e 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -333,7 +333,7 @@ sal_uInt16 ScTpSubTotalGroup::FuncToLbPos( ScSubTotalFunc eFunc ) // Handler: -IMPL_LINK( ScTpSubTotalGroup, SelectHdl, ListBox *, pLb ) +IMPL_LINK( ScTpSubTotalGroup, SelectHdl, void *, pLb ) { if ( (mpLbColumns->GetEntryCount() > 0) && (mpLbColumns->GetSelectionCount() > 0) ) @@ -346,7 +346,7 @@ IMPL_LINK( ScTpSubTotalGroup, SelectHdl, ListBox *, pLb ) if ( !pFunction ) return 0; - if ( ((SvxCheckListBox*)pLb) == mpLbColumns ) + if ( pLb == mpLbColumns ) { mpLbFunctions->SelectEntryPos( *pFunction ); } @@ -359,9 +359,9 @@ IMPL_LINK( ScTpSubTotalGroup, SelectHdl, ListBox *, pLb ) return 0; } -IMPL_LINK( ScTpSubTotalGroup, CheckHdl, ListBox *, pLb ) +IMPL_LINK( ScTpSubTotalGroup, CheckHdl, void *, pLb ) { - if ( ((SvxCheckListBox*)pLb) == mpLbColumns ) + if ( pLb == mpLbColumns ) { SvTreeListEntry* pEntry = mpLbColumns->GetHdlEntry(); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index d808c22d1ef0..08b4dedf1c37 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2062,7 +2062,7 @@ bool ScDocShell::DdeGetData( const OUString& rItem, OString aFmtByte(OUStringToOString(aDdeTextFmt, osl_getThreadTextEncoding())); rValue <<= ::com::sun::star::uno::Sequence< sal_Int8 >( - (const sal_Int8*)aFmtByte.getStr(), + reinterpret_cast<const sal_Int8*>(aFmtByte.getStr()), aFmtByte.getLength() + 1 ); return true; } @@ -2080,7 +2080,7 @@ bool ScDocShell::DdeGetData( const OUString& rItem, SOT_FORMATSTR_ID_SYLK ) ) { rValue <<= ::com::sun::star::uno::Sequence< sal_Int8 >( - (const sal_Int8*)aData.getStr(), + reinterpret_cast<const sal_Int8*>(aData.getStr()), aData.getLength() + 1 ); return true; } diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx index 6c2ca1000557..58f0cac8faf5 100644 --- a/sc/source/ui/docshell/servobj.cxx +++ b/sc/source/ui/docshell/servobj.cxx @@ -174,7 +174,7 @@ bool ScServerObject::GetData( if( aObj.ExportByteString( aByteData, osl_getThreadTextEncoding(), SOT_FORMATSTR_ID_SYLK ) ) { rData <<= ::com::sun::star::uno::Sequence< sal_Int8 >( - (const sal_Int8*)aByteData.getStr(), + reinterpret_cast<const sal_Int8*>(aByteData.getStr()), aByteData.getLength() + 1 ); return true; } diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx index 79e3727e751c..ffff1e061ba3 100644 --- a/sc/source/ui/inc/tpsubt.hxx +++ b/sc/source/ui/inc/tpsubt.hxx @@ -69,8 +69,8 @@ private: sal_uInt16 GetFieldSelPos ( SCCOL nField ); // Handler ------------------------ - DECL_LINK( SelectHdl, ListBox * ); - DECL_LINK( CheckHdl, ListBox * ); + DECL_LINK( SelectHdl, void * ); + DECL_LINK( CheckHdl, void * ); }; class ScTpSubTotalGroup1 : public ScTpSubTotalGroup diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 194e0922fb0c..ddbde5f5ab37 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -483,7 +483,7 @@ void ScContentTree::KeyInput( const KeyEvent& rKEvt ) case SC_CONTENT_GRAPHIC: case SC_CONTENT_DRAWING: { - vcl::Window* pWindow=(vcl::Window*)GetParent(pEntry); + vcl::Window* pWindow=reinterpret_cast<vcl::Window*>(GetParent(pEntry)); ScNavigatorDlg* pScNavigatorDlg = static_cast<ScNavigatorDlg*>(pWindow); ScTabViewShell* pScTabViewShell = NULL; ScDrawView* pScDrawView = NULL; @@ -970,7 +970,7 @@ void ScContentTree::GetDrawNames( sal_uInt16 nType ) ScDrawView* pScDrawView=NULL; ScNavigatorDlg* pScNavigatorDlg=NULL; if(pChild) - pWindow=(vcl::Window*)GetParent(pChild); + pWindow=reinterpret_cast<vcl::Window*>(GetParent(pChild)); if(pWindow) pScNavigatorDlg = static_cast<ScNavigatorDlg*>(pWindow); if (pScNavigatorDlg!=NULL) diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 82e6ca0bb4fc..b7fc0da086b4 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -2190,7 +2190,7 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet ) SfxBoolItem aBoolItem ( 0, true ); eState = rAttrSet.GetItemState( ATTR_HOR_JUSTIFY, true, - (const SfxPoolItem**)&pHorJustify ); + reinterpret_cast<const SfxPoolItem**>(&pHorJustify) ); switch ( eState ) { case SfxItemState::SET: @@ -2257,7 +2257,7 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet ) aBoolItem.SetValue( true ); eState = rAttrSet.GetItemState( ATTR_VER_JUSTIFY, true, - (const SfxPoolItem**)&pVerJustify ); + reinterpret_cast<const SfxPoolItem**>(&pVerJustify) ); switch ( eState ) { diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 3560e0bb7182..0a92dc3dcf4c 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -826,7 +826,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) const SvxSetItem* pHeaderSetItem; const SfxItemSet* pHeaderSet = NULL; if ( pParamSet->GetItemState( ATTR_PAGE_HEADERSET, false, - (const SfxPoolItem**)&pHeaderSetItem ) == SfxItemState::SET ) + reinterpret_cast<const SfxPoolItem**>(&pHeaderSetItem) ) == SfxItemState::SET ) { pHeaderSet = &pHeaderSetItem->GetItemSet(); // Headline has space below @@ -842,7 +842,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) const SvxSetItem* pFooterSetItem; const SfxItemSet* pFooterSet = NULL; if ( pParamSet->GetItemState( ATTR_PAGE_FOOTERSET, false, - (const SfxPoolItem**)&pFooterSetItem ) == SfxItemState::SET ) + reinterpret_cast<const SfxPoolItem**>(&pFooterSetItem) ) == SfxItemState::SET ) { pFooterSet = &pFooterSetItem->GetItemSet(); // Footline has space above @@ -860,19 +860,19 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) SfxItemState eState; eState = pParamSet->GetItemState( ATTR_PAGE_SCALE, false, - (const SfxPoolItem**)&pScaleItem ); + reinterpret_cast<const SfxPoolItem**>(&pScaleItem) ); if ( SfxItemState::DEFAULT == eState ) pScaleItem = static_cast<const SfxUInt16Item*>( &pParamSet->GetPool()->GetDefaultItem( ATTR_PAGE_SCALE )); eState = pParamSet->GetItemState( ATTR_PAGE_SCALETO, false, - (const SfxPoolItem**)&pScaleToItem ); + reinterpret_cast<const SfxPoolItem**>(&pScaleToItem) ); if ( SfxItemState::DEFAULT == eState ) pScaleToItem = static_cast<const ScPageScaleToItem*>( &pParamSet->GetPool()->GetDefaultItem( ATTR_PAGE_SCALETO )); eState = pParamSet->GetItemState( ATTR_PAGE_SCALETOPAGES, false, - (const SfxPoolItem**)&pScaleToPagesItem ); + reinterpret_cast<const SfxPoolItem**>(&pScaleToPagesItem) ); if ( SfxItemState::DEFAULT == eState ) pScaleToPagesItem = static_cast<const SfxUInt16Item*>( &pParamSet->GetPool()->GetDefaultItem( ATTR_PAGE_SCALETOPAGES )); |