summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-17 15:15:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-17 21:25:38 +0200
commit661f8785e6727dca1ef23c51ae9ecf4d3da299d3 (patch)
treeb8d0bd87bc1892ab479dfcf762ea4a19b2a10c09 /svl
parentb4edda1842c301a06c5528860542153590027b42 (diff)
no need to allocate CharClass separately in SvNumberFormatter
Change-Id: I79b815567c59702c2d3fe7944bb2f16bacf0e472 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122252 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforlist.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 077d04867e0f..9c35f99547fc 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -303,7 +303,7 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang )
nDefaultSystemCurrencyFormat = NUMBERFORMAT_ENTRY_NOT_FOUND;
maLanguageTag.reset( eLang );
- pCharClass.reset( new CharClass( m_xContext, maLanguageTag ) );
+ oCharClass.emplace( m_xContext, maLanguageTag );
xLocaleData.init( m_xContext, maLanguageTag );
xCalendar.init( m_xContext, maLanguageTag.getLocale() );
xTransliteration.init( m_xContext, eLang );
@@ -338,7 +338,7 @@ void SvNumberFormatter::ChangeIntl(LanguageType eLnge)
ActLnge = eLnge;
maLanguageTag.reset( eLnge );
- pCharClass.reset( new CharClass( m_xContext, maLanguageTag ) );
+ oCharClass.emplace( m_xContext, maLanguageTag );
xLocaleData.changeLocale( maLanguageTag );
xCalendar.changeLocale( maLanguageTag.getLocale() );
xTransliteration.changeLocale( eLnge );
@@ -532,7 +532,7 @@ const ::utl::TransliterationWrapper* SvNumberFormatter::GetTransliteration() con
return xTransliteration.get();
}
-const CharClass* SvNumberFormatter::GetCharClass() const { return pCharClass.get(); }
+const CharClass* SvNumberFormatter::GetCharClass() const { return oCharClass ? &*oCharClass : nullptr; }
const LocaleDataWrapper* SvNumberFormatter::GetLocaleData() const { return xLocaleData.get(); }
@@ -1846,7 +1846,7 @@ bool SvNumberFormatter::GetPreviewStringGuess( const OUString& sFormatString,
eLnge = ActLnge;
bool bEnglish = (eLnge == LANGUAGE_ENGLISH_US);
- OUString aFormatStringUpper( pCharClass->uppercase( sFormatString ) );
+ OUString aFormatStringUpper( oCharClass->uppercase( sFormatString ) );
sal_uInt32 nCLOffset = ImpGenerateCL( eLnge );
sal_uInt32 nKey = ImpIsEntry( aFormatStringUpper, nCLOffset, eLnge );
if ( nKey != NUMBERFORMAT_ENTRY_NOT_FOUND )