diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-26 15:32:16 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-26 15:33:40 +0100 |
commit | 720f0e55a081acd3d4460c423bf186e0f27a79e5 (patch) | |
tree | f0d2c9e5aca93208c15110ff0ae5952bee3fe7de /unotools | |
parent | 0c141f2ed5219e7329fd94681d68e2205e2ed285 (diff) |
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I72a618a0deca795b87ec009105252f4594ecba90
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/i18n/intlwrapper.cxx | 6 | ||||
-rw-r--r-- | unotools/source/i18n/localedatawrapper.cxx | 22 | ||||
-rw-r--r-- | unotools/source/i18n/transliterationwrapper.cxx | 2 |
3 files changed, 15 insertions, 15 deletions
diff --git a/unotools/source/i18n/intlwrapper.cxx b/unotools/source/i18n/intlwrapper.cxx index 2e6b0611214e..887b5dc40204 100644 --- a/unotools/source/i18n/intlwrapper.cxx +++ b/unotools/source/i18n/intlwrapper.cxx @@ -54,7 +54,7 @@ IntlWrapper::~IntlWrapper() void IntlWrapper::ImplNewLocaleData() const { - ((IntlWrapper*)this)->pLocaleData = new LocaleDataWrapper( m_xContext, maLanguageTag ); + const_cast<IntlWrapper*>(this)->pLocaleData = new LocaleDataWrapper( m_xContext, maLanguageTag ); } void IntlWrapper::ImplNewCollator( bool bCaseSensitive ) const @@ -63,13 +63,13 @@ void IntlWrapper::ImplNewCollator( bool bCaseSensitive ) const if ( bCaseSensitive ) { p->loadDefaultCollator( maLanguageTag.getLocale(), 0 ); - ((IntlWrapper*)this)->pCaseCollator = p; + const_cast<IntlWrapper*>(this)->pCaseCollator = p; } else { p->loadDefaultCollator( maLanguageTag.getLocale(), ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE ); - ((IntlWrapper*)this)->pCollator = p; + const_cast<IntlWrapper*>(this)->pCollator = p; } } diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index e1239e837d01..1e77321c47b2 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -338,7 +338,7 @@ const OUString& LocaleDataWrapper::getOneLocaleItem( sal_Int16 nItem ) const if (aLocaleItem[nItem].isEmpty()) { // no cached content aGuard.changeReadToWrite(); - ((LocaleDataWrapper*)this)->getOneLocaleItemImpl( nItem ); + const_cast<LocaleDataWrapper*>(this)->getOneLocaleItemImpl( nItem ); } return aLocaleItem[nItem]; } @@ -431,7 +431,7 @@ const OUString& LocaleDataWrapper::getOneReservedWord( sal_Int16 nWord ) const if (aReservedWord[nWord].isEmpty()) { // no cached content aGuard.changeReadToWrite(); - ((LocaleDataWrapper*)this)->getOneReservedWordImpl( nWord ); + const_cast<LocaleDataWrapper*>(this)->getOneReservedWordImpl( nWord ); } return aReservedWord[nWord]; } @@ -474,7 +474,7 @@ const std::shared_ptr< ::com::sun::star::i18n::Calendar2 > LocaleDataWrapper::ge if (!xDefaultCalendar) { // no cached content aGuard.changeReadToWrite(); - ((LocaleDataWrapper*)this)->getDefaultCalendarImpl(); + const_cast<LocaleDataWrapper*>(this)->getDefaultCalendarImpl(); } return xDefaultCalendar; } @@ -497,7 +497,7 @@ const OUString& LocaleDataWrapper::getCurrSymbol() const if (aCurrSymbol.isEmpty()) { aGuard.changeReadToWrite(); - ((LocaleDataWrapper*)this)->getCurrSymbolsImpl(); + const_cast<LocaleDataWrapper*>(this)->getCurrSymbolsImpl(); } return aCurrSymbol; } @@ -508,7 +508,7 @@ const OUString& LocaleDataWrapper::getCurrBankSymbol() const if (aCurrBankSymbol.isEmpty()) { aGuard.changeReadToWrite(); - ((LocaleDataWrapper*)this)->getCurrSymbolsImpl(); + const_cast<LocaleDataWrapper*>(this)->getCurrSymbolsImpl(); } return aCurrBankSymbol; } @@ -519,7 +519,7 @@ sal_uInt16 LocaleDataWrapper::getCurrPositiveFormat() const if ( nCurrPositiveFormat == nCurrFormatInvalid ) { aGuard.changeReadToWrite(); - ((LocaleDataWrapper*)this)->getCurrFormatsImpl(); + const_cast<LocaleDataWrapper*>(this)->getCurrFormatsImpl(); } return nCurrPositiveFormat; } @@ -530,7 +530,7 @@ sal_uInt16 LocaleDataWrapper::getCurrNegativeFormat() const if ( nCurrNegativeFormat == nCurrFormatInvalid ) { aGuard.changeReadToWrite(); - ((LocaleDataWrapper*)this)->getCurrFormatsImpl(); + const_cast<LocaleDataWrapper*>(this)->getCurrFormatsImpl(); } return nCurrNegativeFormat; } @@ -541,7 +541,7 @@ sal_uInt16 LocaleDataWrapper::getCurrDigits() const if ( nCurrDigits == nCurrFormatInvalid ) { aGuard.changeReadToWrite(); - ((LocaleDataWrapper*)this)->getCurrSymbolsImpl(); + const_cast<LocaleDataWrapper*>(this)->getCurrSymbolsImpl(); } return nCurrDigits; } @@ -810,7 +810,7 @@ DateFormat LocaleDataWrapper::getDateFormat() const if ( nDateFormat == nDateFormatInvalid ) { aGuard.changeReadToWrite(); - ((LocaleDataWrapper*)this)->getDateFormatsImpl(); + const_cast<LocaleDataWrapper*>(this)->getDateFormatsImpl(); } return (DateFormat) nDateFormat; } @@ -821,7 +821,7 @@ DateFormat LocaleDataWrapper::getLongDateFormat() const if ( nLongDateFormat == nDateFormatInvalid ) { aGuard.changeReadToWrite(); - ((LocaleDataWrapper*)this)->getDateFormatsImpl(); + const_cast<LocaleDataWrapper*>(this)->getDateFormatsImpl(); } return (DateFormat) nLongDateFormat; } @@ -1035,7 +1035,7 @@ const ::com::sun::star::uno::Sequence< sal_Int32 > LocaleDataWrapper::getDigitGr if (!aGrouping.getLength() || aGrouping[0] == 0) { // no cached content aGuard.changeReadToWrite(); - ((LocaleDataWrapper*)this)->getDigitGroupingImpl(); + const_cast<LocaleDataWrapper*>(this)->getDigitGroupingImpl(); } return aGrouping; } diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx index cdaaad3c5fec..a8b92a4d20f6 100644 --- a/unotools/source/i18n/transliterationwrapper.cxx +++ b/unotools/source/i18n/transliterationwrapper.cxx @@ -139,7 +139,7 @@ void TransliterationWrapper::loadModuleIfNeeded( sal_uInt16 nLang ) void TransliterationWrapper::loadModuleImpl() const { if ( bFirstCall ) - ((TransliterationWrapper*)this)->setLanguageLocaleImpl( LANGUAGE_SYSTEM ); + const_cast<TransliterationWrapper*>(this)->setLanguageLocaleImpl( LANGUAGE_SYSTEM ); try { |