diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-24 13:02:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-25 08:32:27 +0200 |
commit | 57c5f980835f834f6ea96c6f5ca841b5372aa61d (patch) | |
tree | 7851f29791296a006e936f1f323489b79c11e9b2 /i18nlangtag | |
parent | 80a30219c4c553ff22979b73dd97a8869d87e488 (diff) |
loplugin:constmethod in comphelper,ucbhelper
Change-Id: I27a860fbbedd2174c60c199af18cae76e02abc25
Reviewed-on: https://gerrit.libreoffice.org/43759
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18nlangtag')
-rw-r--r-- | i18nlangtag/source/languagetag/languagetag.cxx | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx index 057718620374..1e65fe593f6d 100644 --- a/i18nlangtag/source/languagetag/languagetag.cxx +++ b/i18nlangtag/source/languagetag/languagetag.cxx @@ -1010,16 +1010,25 @@ LanguageTag::ImplPtr LanguageTag::registerImpl() const } -LanguageTag::ImplPtr const & LanguageTag::getImpl() const +LanguageTagImpl const * LanguageTag::getImpl() const { if (!mpImpl) { mpImpl = registerImpl(); syncVarsFromRawImpl(); } - return mpImpl; + return mpImpl.get(); } +LanguageTagImpl * LanguageTag::getImpl() +{ + if (!mpImpl) + { + mpImpl = registerImpl(); + syncVarsFromRawImpl(); + } + return mpImpl.get(); +} void LanguageTag::resetVars() { @@ -1277,8 +1286,7 @@ bool LanguageTagImpl::synCanonicalize() void LanguageTag::syncFromImpl() { - ImplPtr xImpl = getImpl(); - LanguageTagImpl* pImpl = xImpl.get(); + LanguageTagImpl* pImpl = getImpl(); bool bRegister = ((mbInitializedBcp47 && maBcp47 != pImpl->maBcp47) || (mbInitializedLangID && mnLangID != pImpl->mnLangID)); SAL_INFO_IF( bRegister, "i18nlangtag", @@ -1829,7 +1837,7 @@ OUString const & LanguageTagImpl::getLanguage() const OUString LanguageTag::getLanguage() const { - ImplPtr pImpl = getImpl(); + LanguageTagImpl const* pImpl = getImpl(); if (pImpl->mbCachedLanguage) return pImpl->maCachedLanguage; OUString aRet( pImpl->getLanguage()); @@ -1851,7 +1859,7 @@ OUString const & LanguageTagImpl::getScript() const OUString LanguageTag::getScript() const { - ImplPtr pImpl = getImpl(); + LanguageTagImpl const* pImpl = getImpl(); if (pImpl->mbCachedScript) return pImpl->maCachedScript; OUString aRet( pImpl->getScript()); @@ -1887,7 +1895,7 @@ OUString const & LanguageTagImpl::getCountry() const OUString LanguageTag::getCountry() const { - ImplPtr pImpl = getImpl(); + LanguageTagImpl const* pImpl = getImpl(); if (pImpl->mbCachedCountry) return pImpl->maCachedCountry; OUString aRet( pImpl->getCountry()); @@ -1915,7 +1923,7 @@ OUString const & LanguageTagImpl::getVariants() const OUString LanguageTag::getVariants() const { - ImplPtr pImpl = getImpl(); + LanguageTagImpl const * pImpl = getImpl(); if (pImpl->mbCachedVariants) return pImpl->maCachedVariants; OUString aRet( pImpl->getVariants()); |