Kaydet (Commit) 720f0e55 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

const_cast: convert some C-style casts and remove some redundant ones

Change-Id: I72a618a0deca795b87ec009105252f4594ecba90
üst 0c141f2e
...@@ -54,7 +54,7 @@ IntlWrapper::~IntlWrapper() ...@@ -54,7 +54,7 @@ IntlWrapper::~IntlWrapper()
void IntlWrapper::ImplNewLocaleData() const 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 void IntlWrapper::ImplNewCollator( bool bCaseSensitive ) const
...@@ -63,13 +63,13 @@ void IntlWrapper::ImplNewCollator( bool bCaseSensitive ) const ...@@ -63,13 +63,13 @@ void IntlWrapper::ImplNewCollator( bool bCaseSensitive ) const
if ( bCaseSensitive ) if ( bCaseSensitive )
{ {
p->loadDefaultCollator( maLanguageTag.getLocale(), 0 ); p->loadDefaultCollator( maLanguageTag.getLocale(), 0 );
((IntlWrapper*)this)->pCaseCollator = p; const_cast<IntlWrapper*>(this)->pCaseCollator = p;
} }
else else
{ {
p->loadDefaultCollator( maLanguageTag.getLocale(), p->loadDefaultCollator( maLanguageTag.getLocale(),
::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE ); ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE );
((IntlWrapper*)this)->pCollator = p; const_cast<IntlWrapper*>(this)->pCollator = p;
} }
} }
......
...@@ -338,7 +338,7 @@ const OUString& LocaleDataWrapper::getOneLocaleItem( sal_Int16 nItem ) const ...@@ -338,7 +338,7 @@ const OUString& LocaleDataWrapper::getOneLocaleItem( sal_Int16 nItem ) const
if (aLocaleItem[nItem].isEmpty()) if (aLocaleItem[nItem].isEmpty())
{ // no cached content { // no cached content
aGuard.changeReadToWrite(); aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getOneLocaleItemImpl( nItem ); const_cast<LocaleDataWrapper*>(this)->getOneLocaleItemImpl( nItem );
} }
return aLocaleItem[nItem]; return aLocaleItem[nItem];
} }
...@@ -431,7 +431,7 @@ const OUString& LocaleDataWrapper::getOneReservedWord( sal_Int16 nWord ) const ...@@ -431,7 +431,7 @@ const OUString& LocaleDataWrapper::getOneReservedWord( sal_Int16 nWord ) const
if (aReservedWord[nWord].isEmpty()) if (aReservedWord[nWord].isEmpty())
{ // no cached content { // no cached content
aGuard.changeReadToWrite(); aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getOneReservedWordImpl( nWord ); const_cast<LocaleDataWrapper*>(this)->getOneReservedWordImpl( nWord );
} }
return aReservedWord[nWord]; return aReservedWord[nWord];
} }
...@@ -474,7 +474,7 @@ const std::shared_ptr< ::com::sun::star::i18n::Calendar2 > LocaleDataWrapper::ge ...@@ -474,7 +474,7 @@ const std::shared_ptr< ::com::sun::star::i18n::Calendar2 > LocaleDataWrapper::ge
if (!xDefaultCalendar) if (!xDefaultCalendar)
{ // no cached content { // no cached content
aGuard.changeReadToWrite(); aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getDefaultCalendarImpl(); const_cast<LocaleDataWrapper*>(this)->getDefaultCalendarImpl();
} }
return xDefaultCalendar; return xDefaultCalendar;
} }
...@@ -497,7 +497,7 @@ const OUString& LocaleDataWrapper::getCurrSymbol() const ...@@ -497,7 +497,7 @@ const OUString& LocaleDataWrapper::getCurrSymbol() const
if (aCurrSymbol.isEmpty()) if (aCurrSymbol.isEmpty())
{ {
aGuard.changeReadToWrite(); aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getCurrSymbolsImpl(); const_cast<LocaleDataWrapper*>(this)->getCurrSymbolsImpl();
} }
return aCurrSymbol; return aCurrSymbol;
} }
...@@ -508,7 +508,7 @@ const OUString& LocaleDataWrapper::getCurrBankSymbol() const ...@@ -508,7 +508,7 @@ const OUString& LocaleDataWrapper::getCurrBankSymbol() const
if (aCurrBankSymbol.isEmpty()) if (aCurrBankSymbol.isEmpty())
{ {
aGuard.changeReadToWrite(); aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getCurrSymbolsImpl(); const_cast<LocaleDataWrapper*>(this)->getCurrSymbolsImpl();
} }
return aCurrBankSymbol; return aCurrBankSymbol;
} }
...@@ -519,7 +519,7 @@ sal_uInt16 LocaleDataWrapper::getCurrPositiveFormat() const ...@@ -519,7 +519,7 @@ sal_uInt16 LocaleDataWrapper::getCurrPositiveFormat() const
if ( nCurrPositiveFormat == nCurrFormatInvalid ) if ( nCurrPositiveFormat == nCurrFormatInvalid )
{ {
aGuard.changeReadToWrite(); aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getCurrFormatsImpl(); const_cast<LocaleDataWrapper*>(this)->getCurrFormatsImpl();
} }
return nCurrPositiveFormat; return nCurrPositiveFormat;
} }
...@@ -530,7 +530,7 @@ sal_uInt16 LocaleDataWrapper::getCurrNegativeFormat() const ...@@ -530,7 +530,7 @@ sal_uInt16 LocaleDataWrapper::getCurrNegativeFormat() const
if ( nCurrNegativeFormat == nCurrFormatInvalid ) if ( nCurrNegativeFormat == nCurrFormatInvalid )
{ {
aGuard.changeReadToWrite(); aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getCurrFormatsImpl(); const_cast<LocaleDataWrapper*>(this)->getCurrFormatsImpl();
} }
return nCurrNegativeFormat; return nCurrNegativeFormat;
} }
...@@ -541,7 +541,7 @@ sal_uInt16 LocaleDataWrapper::getCurrDigits() const ...@@ -541,7 +541,7 @@ sal_uInt16 LocaleDataWrapper::getCurrDigits() const
if ( nCurrDigits == nCurrFormatInvalid ) if ( nCurrDigits == nCurrFormatInvalid )
{ {
aGuard.changeReadToWrite(); aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getCurrSymbolsImpl(); const_cast<LocaleDataWrapper*>(this)->getCurrSymbolsImpl();
} }
return nCurrDigits; return nCurrDigits;
} }
...@@ -810,7 +810,7 @@ DateFormat LocaleDataWrapper::getDateFormat() const ...@@ -810,7 +810,7 @@ DateFormat LocaleDataWrapper::getDateFormat() const
if ( nDateFormat == nDateFormatInvalid ) if ( nDateFormat == nDateFormatInvalid )
{ {
aGuard.changeReadToWrite(); aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getDateFormatsImpl(); const_cast<LocaleDataWrapper*>(this)->getDateFormatsImpl();
} }
return (DateFormat) nDateFormat; return (DateFormat) nDateFormat;
} }
...@@ -821,7 +821,7 @@ DateFormat LocaleDataWrapper::getLongDateFormat() const ...@@ -821,7 +821,7 @@ DateFormat LocaleDataWrapper::getLongDateFormat() const
if ( nLongDateFormat == nDateFormatInvalid ) if ( nLongDateFormat == nDateFormatInvalid )
{ {
aGuard.changeReadToWrite(); aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getDateFormatsImpl(); const_cast<LocaleDataWrapper*>(this)->getDateFormatsImpl();
} }
return (DateFormat) nLongDateFormat; return (DateFormat) nLongDateFormat;
} }
...@@ -1035,7 +1035,7 @@ const ::com::sun::star::uno::Sequence< sal_Int32 > LocaleDataWrapper::getDigitGr ...@@ -1035,7 +1035,7 @@ const ::com::sun::star::uno::Sequence< sal_Int32 > LocaleDataWrapper::getDigitGr
if (!aGrouping.getLength() || aGrouping[0] == 0) if (!aGrouping.getLength() || aGrouping[0] == 0)
{ // no cached content { // no cached content
aGuard.changeReadToWrite(); aGuard.changeReadToWrite();
((LocaleDataWrapper*)this)->getDigitGroupingImpl(); const_cast<LocaleDataWrapper*>(this)->getDigitGroupingImpl();
} }
return aGrouping; return aGrouping;
} }
......
...@@ -139,7 +139,7 @@ void TransliterationWrapper::loadModuleIfNeeded( sal_uInt16 nLang ) ...@@ -139,7 +139,7 @@ void TransliterationWrapper::loadModuleIfNeeded( sal_uInt16 nLang )
void TransliterationWrapper::loadModuleImpl() const void TransliterationWrapper::loadModuleImpl() const
{ {
if ( bFirstCall ) if ( bFirstCall )
((TransliterationWrapper*)this)->setLanguageLocaleImpl( LANGUAGE_SYSTEM ); const_cast<TransliterationWrapper*>(this)->setLanguageLocaleImpl( LANGUAGE_SYSTEM );
try try
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment