From c80e341726c5acc0b7c23842c6b5e97d32a7d4f4 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 15 Jan 2018 09:01:51 +0100 Subject: More loplugin:cstylecast: unotools Change-Id: I04af756527ff42ad83a1b68730230864233c4fac --- unotools/source/config/extendedsecurityoptions.cxx | 2 +- unotools/source/config/fontcfg.cxx | 4 ++-- unotools/source/config/securityoptions.cxx | 2 +- unotools/source/i18n/charclass.cxx | 4 ++-- unotools/source/i18n/transliterationwrapper.cxx | 2 +- unotools/source/ucbhelper/ucbhelper.cxx | 2 +- unotools/source/ucbhelper/ucblockbytes.cxx | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/unotools/source/config/extendedsecurityoptions.cxx b/unotools/source/config/extendedsecurityoptions.cxx index cb0cfab699e4..2a9f138ca491 100644 --- a/unotools/source/config/extendedsecurityoptions.cxx +++ b/unotools/source/config/extendedsecurityoptions.cxx @@ -131,7 +131,7 @@ SvtExtendedSecurityOptions_Impl::SvtExtendedSecurityOptions_Impl() sal_Int32 nMode = SvtExtendedSecurityOptions::OPEN_WITHSECURITYCHECK; if ( seqValues[nProperty] >>= nMode ) - m_eOpenHyperlinkMode = (SvtExtendedSecurityOptions::OpenHyperlinkMode)nMode; + m_eOpenHyperlinkMode = static_cast(nMode); else { OSL_FAIL("Wrong type for Open mode!"); } diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index 502f80b16730..0ffc882342e7 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -930,7 +930,7 @@ FontWeight FontSubstConfiguration::getSubstWeight( const css::uno::Reference< XN catch (const WrappedTargetException&) { } - return (FontWeight)( weight >= 0 ? pWeightNames[weight].nEnum : WEIGHT_DONTKNOW ); + return static_cast( weight >= 0 ? pWeightNames[weight].nEnum : WEIGHT_DONTKNOW ); } FontWidth FontSubstConfiguration::getSubstWidth( const css::uno::Reference< XNameAccess >& rFont, @@ -957,7 +957,7 @@ FontWidth FontSubstConfiguration::getSubstWidth( const css::uno::Reference< XNam catch (const WrappedTargetException&) { } - return (FontWidth)( width >= 0 ? pWidthNames[width].nEnum : WIDTH_DONTKNOW ); + return static_cast( width >= 0 ? pWidthNames[width].nEnum : WIDTH_DONTKNOW ); } ImplFontAttrs FontSubstConfiguration::getSubstType( const css::uno::Reference< XNameAccess >& rFont, diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index 0b20cfa014fe..1194c7a24e75 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -377,7 +377,7 @@ void SvtSecurityOptions_Impl::SetProperty( sal_Int32 nProperty, const Any& rValu { sal_Int32 nMode = 0; rValue >>= nMode; - m_eBasicMode = (EBasicSecurityMode)nMode; + m_eBasicMode = static_cast(nMode); m_bROBasicMode = bRO; } break; diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx index 46926118a53b..9e3d184b1490 100644 --- a/unotools/source/i18n/charclass.cxx +++ b/unotools/source/i18n/charclass.cxx @@ -302,7 +302,7 @@ css::i18n::DirectionProperty CharClass::getCharacterDirection( const OUString& r try { if ( xCC.is() ) - return (css::i18n::DirectionProperty)xCC->getCharacterDirection( rStr, nPos ); + return static_cast(xCC->getCharacterDirection( rStr, nPos )); } catch ( const Exception& ) { @@ -316,7 +316,7 @@ css::i18n::UnicodeScript CharClass::getScript( const OUString& rStr, sal_Int32 n try { if ( xCC.is() ) - return (css::i18n::UnicodeScript) xCC->getScript( rStr, nPos ); + return static_cast(xCC->getScript( rStr, nPos )); } catch ( const Exception& ) { diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx index 4a65f801cfba..aa5bb14310d0 100644 --- a/unotools/source/i18n/transliterationwrapper.cxx +++ b/unotools/source/i18n/transliterationwrapper.cxx @@ -144,7 +144,7 @@ void TransliterationWrapper::loadModuleImpl() const try { if ( xTrans.is() ) - xTrans->loadModule( (TransliterationModules)nType, aLanguageTag.getLocale() ); + xTrans->loadModule( static_cast(nType), aLanguageTag.getLocale() ); } catch ( const Exception& e ) { diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 0cded08d91b9..ea4caeab8c46 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -277,7 +277,7 @@ bool utl::UCBContentHelper::MakeFolder( "unotools.ucbhelper", "UCBContentHelper::MakeFolder(" << title << ") InteractiveIOException \"" << e - << "\", code " << + (sal_Int32)e.Code); + << "\", code " << + static_cast(e.Code)); } } catch (css::ucb::NameClashException const &) { exists = true; diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index 4e85da23c8bf..3f7731d99602 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -1226,7 +1226,7 @@ ErrCode UcbLockBytes::Flush() const ErrCode UcbLockBytes::SetSize (sal_uInt64 const nNewSize) { SvLockBytesStat aStat; - Stat( &aStat, (SvLockBytesStatFlag) 0 ); + Stat( &aStat, SvLockBytesStatFlag(0) ); std::size_t nSize = aStat.nSize; if ( nSize > nNewSize ) -- cgit