diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-15 09:02:51 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-15 09:02:51 +0100 |
commit | 6a6cf93acee4f8f4e5766e5090071e9a818b6f81 (patch) | |
tree | 81af350a5166763eef97676ba22a7865c179ae33 /svl | |
parent | 6feb524aaf58009a55ea4d4e660c09b67adf26fa (diff) |
More loplugin:cstylecast: svl
Change-Id: Ida9c41fab0b8b3e91d710434028dd648e6d4b135
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/config/asiancfg.cxx | 7 | ||||
-rw-r--r-- | svl/source/config/ctloptions.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/macitem.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/srchitem.cxx | 16 | ||||
-rw-r--r-- | svl/source/numbers/numfmuno.cxx | 4 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 2 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 4 |
7 files changed, 20 insertions, 21 deletions
diff --git a/svl/source/config/asiancfg.cxx b/svl/source/config/asiancfg.cxx index 6da7901f5e96..27b5b5defc92 100644 --- a/svl/source/config/asiancfg.cxx +++ b/svl/source/config/asiancfg.cxx @@ -88,14 +88,13 @@ void SvxAsianConfig::SetKerningWesternTextOnly(bool value) { } CharCompressType SvxAsianConfig::GetCharDistanceCompression() const { - return (CharCompressType) - officecfg::Office::Common::AsianLayout::CompressCharacterDistance::get( - impl_->context); + return static_cast<CharCompressType>(officecfg::Office::Common::AsianLayout::CompressCharacterDistance::get( + impl_->context)); } void SvxAsianConfig::SetCharDistanceCompression(CharCompressType value) { officecfg::Office::Common::AsianLayout::CompressCharacterDistance::set( - (sal_uInt16)value, impl_->batch); + static_cast<sal_uInt16>(value), impl_->batch); } css::uno::Sequence< css::lang::Locale > SvxAsianConfig::GetStartEndCharLocales() diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx index 63ecb6d656db..801901d33b04 100644 --- a/svl/source/config/ctloptions.cxx +++ b/svl/source/config/ctloptions.cxx @@ -271,8 +271,8 @@ void SvtCTLOptions_Impl::Load() { switch ( nProp ) { - case 2: { m_eCTLCursorMovement = (SvtCTLOptions::CursorMovement)nValue; m_bROCTLCursorMovement = pROStates[nProp]; } break; - case 3: { m_eCTLTextNumerals = (SvtCTLOptions::TextNumerals)nValue; m_bROCTLTextNumerals = pROStates[nProp]; } break; + case 2: { m_eCTLCursorMovement = static_cast<SvtCTLOptions::CursorMovement>(nValue); m_bROCTLCursorMovement = pROStates[nProp]; } break; + case 3: { m_eCTLTextNumerals = static_cast<SvtCTLOptions::TextNumerals>(nValue); m_bROCTLTextNumerals = pROStates[nProp]; } break; } } } diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx index fc065ed64156..b8e56d9f0ed4 100644 --- a/svl/source/items/macitem.cxx +++ b/svl/source/items/macitem.cxx @@ -132,7 +132,7 @@ void SvxMacroTableDtor::Read( SvStream& rStrm ) if( SVX_MACROTBL_VERSION40 <= nVersion ) rStrm.ReadUInt16( eType ); - aSvxMacroTable.emplace( SvMacroItemId(nCurKey), SvxMacro( aMacName, aLibName, (ScriptType)eType ) ); + aSvxMacroTable.emplace( SvMacroItemId(nCurKey), SvxMacro( aMacName, aLibName, static_cast<ScriptType>(eType) ) ); } } @@ -152,7 +152,7 @@ SvStream& SvxMacroTableDtor::Write( SvStream& rStream ) const while( it != aSvxMacroTable.end() && rStream.GetError() == ERRCODE_NONE ) { const SvxMacro& rMac = it->second; - rStream.WriteUInt16( (sal_uInt16)it->first ); + rStream.WriteUInt16( static_cast<sal_uInt16>(it->first) ); writeByteString(rStream, rMac.GetLibName()); writeByteString(rStream, rMac.GetMacName()); diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index 2c7798e4807b..86e93f1c8bbe 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.cxx @@ -440,11 +440,11 @@ bool SvxSearchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const } break; case MID_SEARCH_COMMAND: - rVal <<= (sal_Int16) m_nCommand; break; + rVal <<= static_cast<sal_Int16>(m_nCommand); break; case MID_SEARCH_STYLEFAMILY: - rVal <<= (sal_Int16) m_eFamily; break; + rVal <<= static_cast<sal_Int16>(m_eFamily); break; case MID_SEARCH_CELLTYPE: - rVal <<= (sal_Int32) m_nCellType; break; + rVal <<= static_cast<sal_Int32>(m_nCellType); break; case MID_SEARCH_ROWDIRECTION: rVal <<= m_bRowDirection; break; case MID_SEARCH_ALLTABLES: @@ -462,7 +462,7 @@ bool SvxSearchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const case MID_SEARCH_ASIANOPTIONS: rVal <<= m_bAsianOptions; break; case MID_SEARCH_ALGORITHMTYPE: - rVal <<= (sal_Int16) m_aSearchOpt.algorithmType; break; + rVal <<= static_cast<sal_Int16>(m_aSearchOpt.algorithmType); break; case MID_SEARCH_ALGORITHMTYPE2: rVal <<= m_aSearchOpt.AlgorithmType2; break; case MID_SEARCH_FLAGS: @@ -478,7 +478,7 @@ bool SvxSearchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const case MID_SEARCH_INSERTEDCHARS: rVal <<= m_aSearchOpt.insertedChars; break; case MID_SEARCH_TRANSLITERATEFLAGS: - rVal <<= (sal_Int32)m_aSearchOpt.transliterateFlags; break; + rVal <<= static_cast<sal_Int32>(m_aSearchOpt.transliterateFlags); break; case MID_SEARCH_LOCALE: { LanguageType nLocale; @@ -608,7 +608,7 @@ bool SvxSearchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) case MID_SEARCH_COMMAND: bRet = (rVal >>= nInt); m_nCommand = static_cast<SvxSearchCmd>(nInt); break; case MID_SEARCH_STYLEFAMILY: - bRet = (rVal >>= nInt); m_eFamily = (SfxStyleFamily) static_cast<sal_Int16>(nInt); break; + bRet = (rVal >>= nInt); m_eFamily = static_cast<SfxStyleFamily>(static_cast<sal_Int16>(nInt)); break; case MID_SEARCH_CELLTYPE: bRet = (rVal >>= nInt); m_nCellType = static_cast<SvxSearchCellType>(nInt); break; case MID_SEARCH_ROWDIRECTION: @@ -628,7 +628,7 @@ bool SvxSearchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) case MID_SEARCH_ASIANOPTIONS: bRet = (rVal >>= m_bAsianOptions); break; case MID_SEARCH_ALGORITHMTYPE: - bRet = (rVal >>= nInt); m_aSearchOpt.algorithmType = (SearchAlgorithms)static_cast<sal_Int16>(nInt); break; + bRet = (rVal >>= nInt); m_aSearchOpt.algorithmType = static_cast<SearchAlgorithms>(static_cast<sal_Int16>(nInt)); break; case MID_SEARCH_ALGORITHMTYPE2: bRet = (rVal >>= nInt); m_aSearchOpt.AlgorithmType2 = static_cast<sal_Int16>(nInt); break; case MID_SEARCH_FLAGS: @@ -647,7 +647,7 @@ bool SvxSearchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) { bRet = (rVal >>= nInt); if (bRet) - m_aSearchOpt.transliterateFlags = (TransliterationFlags)nInt; + m_aSearchOpt.transliterateFlags = static_cast<TransliterationFlags>(nInt); break; } case MID_SEARCH_LOCALE: diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index acca48bbf6d4..88302f86d026 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -540,7 +540,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::getFormatIndex( sal_Int16 nIndex, const l throw uno::RuntimeException(); LanguageType eLang = lcl_GetLanguage( nLocale ); - sal_Int32 nRet = pFormatter->GetFormatIndex( (NfIndexTableOffset)nIndex, eLang ); + sal_Int32 nRet = pFormatter->GetFormatIndex( static_cast<NfIndexTableOffset>(nIndex), eLang ); return nRet; } @@ -632,7 +632,7 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const OUString& aProperty } else if (aPropertyName == PROPERTYNAME_TYPE) { - aRet <<= (sal_Int16)( pFormat->GetType() ); + aRet <<= static_cast<sal_Int16>( pFormat->GetType() ); } else if (aPropertyName == PROPERTYNAME_COMMENT) { diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 64bd9ad7e742..c9ae9e373b94 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -3253,7 +3253,7 @@ NfIndexTableOffset SvNumberFormatter::GetIndexTableOffset( sal_uInt32 nFormat ) for ( sal_uInt16 j = 0; j < NF_INDEX_TABLE_ENTRIES; j++ ) { if (indexTable[j] == nOffset) - return (NfIndexTableOffset) j; + return static_cast<NfIndexTableOffset>(j); } return NF_INDEX_TABLE_ENTRIES; // bad luck } diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 753ee5bd8472..20aa5eb1d3b3 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -823,11 +823,11 @@ SvNumberformat::SvNumberformat(OUString& rString, if ( nIndex == 0 && !bCondition ) { bCondition = true; - eOp1 = (SvNumberformatLimitOps) eSymbolType; + eOp1 = static_cast<SvNumberformatLimitOps>(eSymbolType); } else if ( nIndex == 1 && bCondition ) { - eOp2 = (SvNumberformatLimitOps) eSymbolType; + eOp2 = static_cast<SvNumberformatLimitOps>(eSymbolType); } else // error { |