diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-10 12:52:41 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-10 15:22:17 +0200 |
commit | 36057c3a11deb3a7c3748d7aafd5e6dd08b58984 (patch) | |
tree | 3a707c85eb28ae11e0d0b004928c491fe15d6074 /sw/source/core/bastyp | |
parent | 34966ecb6fb139d49e55796229aa98e27ef8e4b2 (diff) |
loplugin: cstylecast
Change-Id: If7ada4cba0b1098bba304f1ec9b860ec7df75e7a
Diffstat (limited to 'sw/source/core/bastyp')
-rw-r--r-- | sw/source/core/bastyp/calc.cxx | 32 | ||||
-rw-r--r-- | sw/source/core/bastyp/init.cxx | 8 |
2 files changed, 20 insertions, 20 deletions
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 65d8dafbdf54..290784e627a2 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -210,7 +210,7 @@ SwHash* Find( const OUString& rStr, SwHash** ppTable, inline LanguageType GetDocAppScriptLang( SwDoc& rDoc ) { - return ((SvxLanguageItem&)rDoc.GetDefault( + return static_cast<const SvxLanguageItem&>(rDoc.GetDefault( GetWhichOfScript( RES_CHRATR_LANGUAGE, GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() )) )).GetLanguage(); @@ -336,24 +336,24 @@ SwCalc::SwCalc( SwDoc& rD ) VarTable[ aHashValue[ n ] ] = new SwCalcExp( sTmpStr, nVal, 0 ); } - ((SwCalcExp*)VarTable[ aHashValue[ 0 ] ])->nValue.PutBool( false ); - ((SwCalcExp*)VarTable[ aHashValue[ 1 ] ])->nValue.PutBool( true ); - ((SwCalcExp*)VarTable[ aHashValue[ 2 ] ])->nValue.PutDouble( F_PI ); - ((SwCalcExp*)VarTable[ aHashValue[ 3 ] ])->nValue.PutDouble( 2.7182818284590452354 ); + static_cast<SwCalcExp*>(VarTable[ aHashValue[ 0 ] ])->nValue.PutBool( false ); + static_cast<SwCalcExp*>(VarTable[ aHashValue[ 1 ] ])->nValue.PutBool( true ); + static_cast<SwCalcExp*>(VarTable[ aHashValue[ 2 ] ])->nValue.PutDouble( F_PI ); + static_cast<SwCalcExp*>(VarTable[ aHashValue[ 3 ] ])->nValue.PutDouble( 2.7182818284590452354 ); for( n = 0; n < 3; ++n ) - ((SwCalcExp*)VarTable[ aHashValue[ n + 4 ] ])->nValue.PutLong( rDocStat.*aDocStat1[ n ] ); + static_cast<SwCalcExp*>(VarTable[ aHashValue[ n + 4 ] ])->nValue.PutLong( rDocStat.*aDocStat1[ n ] ); for( n = 0; n < 4; ++n ) - ((SwCalcExp*)VarTable[ aHashValue[ n + 7 ] ])->nValue.PutLong( rDocStat.*aDocStat2[ n ] ); + static_cast<SwCalcExp*>(VarTable[ aHashValue[ n + 7 ] ])->nValue.PutLong( rDocStat.*aDocStat2[ n ] ); SvtUserOptions& rUserOptions = SW_MOD()->GetUserOptions(); - ((SwCalcExp*)VarTable[ aHashValue[ 11 ] ])->nValue.PutString( rUserOptions.GetFirstName() ); - ((SwCalcExp*)VarTable[ aHashValue[ 12 ] ])->nValue.PutString( rUserOptions.GetLastName() ); - ((SwCalcExp*)VarTable[ aHashValue[ 13 ] ])->nValue.PutString( rUserOptions.GetID() ); + static_cast<SwCalcExp*>(VarTable[ aHashValue[ 11 ] ])->nValue.PutString( rUserOptions.GetFirstName() ); + static_cast<SwCalcExp*>(VarTable[ aHashValue[ 12 ] ])->nValue.PutString( rUserOptions.GetLastName() ); + static_cast<SwCalcExp*>(VarTable[ aHashValue[ 13 ] ])->nValue.PutString( rUserOptions.GetID() ); for( n = 0; n < 11; ++n ) - ((SwCalcExp*)VarTable[ aHashValue[ n + 14 ] ])->nValue.PutString( + static_cast<SwCalcExp*>(VarTable[ aHashValue[ n + 14 ] ])->nValue.PutString( rUserOptions.GetToken( aAdrToken[ n ] )); nVal.PutString( rUserOptions.GetToken( aAdrToken[ 11 ] )); @@ -465,7 +465,7 @@ SwCalcExp* SwCalc::VarLook( const OUString& rStr, sal_uInt16 ins ) { // then insert here pFnd = new SwCalcExp( aStr, SwSbxValue(), - ((SwCalcFldType*)pEntry)->pFldType ); + static_cast<SwCalcFldType*>(pEntry)->pFldType ); pFnd->pNext = *(VarTable+ii); *(VarTable+ii) = pFnd; break; @@ -475,11 +475,11 @@ SwCalcExp* SwCalc::VarLook( const OUString& rStr, sal_uInt16 ins ) if( pFnd ) { - SwCalcExp* pFndExp = (SwCalcExp*)pFnd; + SwCalcExp* pFndExp = static_cast<SwCalcExp*>(pFnd); if( pFndExp->pFldType && pFndExp->pFldType->Which() == RES_USERFLD ) { - SwUserFieldType* pUFld = (SwUserFieldType*)pFndExp->pFldType; + SwUserFieldType* pUFld = const_cast<SwUserFieldType*>(static_cast<const SwUserFieldType*>(pFndExp->pFldType)); if( nsSwGetSetExpType::GSE_STRING & pUFld->GetType() ) { pFndExp->nValue.PutString( pUFld->GetContent() ); @@ -545,7 +545,7 @@ SwCalcExp* SwCalc::VarLook( const OUString& rStr, sal_uInt16 ins ) sal_uLong nTmpRec = 0; if( 0 != ( pFnd = Find( sDBNum, VarTable, TBLSZ ) ) ) - nTmpRec = ((SwCalcExp*)pFnd)->nValue.GetULong(); + nTmpRec = static_cast<SwCalcExp*>(pFnd)->nValue.GetULong(); OUString sResult; double nNumber = DBL_MAX; @@ -613,7 +613,7 @@ void SwCalc::VarChange( const OUString& rStr, const SwSbxValue& rValue ) OUString aStr = pCharClass->lowercase( rStr ); sal_uInt16 nPos = 0; - SwCalcExp* pFnd = (SwCalcExp*)Find( aStr, VarTable, TBLSZ, &nPos ); + SwCalcExp* pFnd = static_cast<SwCalcExp*>(Find( aStr, VarTable, TBLSZ, &nPos )); if( !pFnd ) { diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 8e716bfa5e2a..e9d88ebc5993 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -546,7 +546,7 @@ void _InitCore() aAttrTab[ RES_PARATR_TABSTOP- POOLATTR_BEGIN ] = new SvxTabStopItem( 1, SVX_TAB_DEFDIST, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); pItem = new SvxHyphenZoneItem( false, RES_PARATR_HYPHENZONE ); - ((SvxHyphenZoneItem*)pItem)->GetMaxHyphens() = 0; // Default: 0 + static_cast<SvxHyphenZoneItem*>(pItem)->GetMaxHyphens() = 0; // Default: 0 aAttrTab[ RES_PARATR_HYPHENZONE- POOLATTR_BEGIN ] = pItem; aAttrTab[ RES_PARATR_DROP- POOLATTR_BEGIN ] = new SwFmtDrop; @@ -649,9 +649,9 @@ void _InitCore() new SvXMLAttrContainerItem( RES_UNKNOWNATR_CONTAINER ); // get the correct fonts: - ::GetDefaultFonts( *(SvxFontItem*)aAttrTab[ RES_CHRATR_FONT- POOLATTR_BEGIN ], - *(SvxFontItem*)aAttrTab[ RES_CHRATR_CJK_FONT - POOLATTR_BEGIN ], - *(SvxFontItem*)aAttrTab[ RES_CHRATR_CTL_FONT - POOLATTR_BEGIN ] ); + ::GetDefaultFonts( *static_cast<SvxFontItem*>(aAttrTab[ RES_CHRATR_FONT- POOLATTR_BEGIN ]), + *static_cast<SvxFontItem*>(aAttrTab[ RES_CHRATR_CJK_FONT - POOLATTR_BEGIN ]), + *static_cast<SvxFontItem*>(aAttrTab[ RES_CHRATR_CTL_FONT - POOLATTR_BEGIN ]) ); // 1. version - new attributes: // - RES_CHRATR_BLINK |