diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-09-25 21:07:29 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-09-25 21:07:29 +0100 |
commit | be214eb2e193707f6bd4d1a279a6cadd1b734948 (patch) | |
tree | 9770aec09e9a6acec53bcb0727bc025b76ad35ee | |
parent | c606f4bfa49b930ab50b98eacbfae9d6d73a180d (diff) |
avoid coverity#1371161 Missing move assignment operator
Change-Id: Ief3dd38ade3fca74ea35e2a1a71637cba3336b59
-rw-r--r-- | i18nutil/source/utility/unicode.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/fontmanager/fontconfig.cxx | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx index 9c489b1a6706..bb82bbff4a5b 100644 --- a/i18nutil/source/utility/unicode.cxx +++ b/i18nutil/source/utility/unicode.cxx @@ -976,7 +976,7 @@ OUString SAL_CALL unicode::formatPercent(double dNumber, // http://www.unicode.org/cldr/charts/24/by_type/numbers.number_formatting_patterns.html // so format using French which has the desired rules if (aLangTag.getLanguage() == "es" || aLangTag.getLanguage() == "sl") - aLangTag = LanguageTag("fr-FR"); + aLangTag.reset("fr-FR"); icu::Locale aLocale = LanguageTagIcu::getIcuLocale(aLangTag); diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 3f0571e474b7..b0b1b16d7c62 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -866,15 +866,14 @@ namespace return bIsImpossible; } - LanguageTag getExemplarLangTagForCodePoint(sal_uInt32 currentChar) + OUString getExemplarLangTagForCodePoint(sal_uInt32 currentChar) { int32_t script = u_getIntPropertyValue(currentChar, UCHAR_SCRIPT); UScriptCode eScript = static_cast<UScriptCode>(script); OStringBuffer aBuf(unicode::getExemplarLanguageForUScriptCode(eScript)); - const char* pScriptCode = uscript_getShortName(eScript); - if (pScriptCode) + if (const char* pScriptCode = uscript_getShortName(eScript)) aBuf.append('-').append(pScriptCode); - return LanguageTag(OStringToOUString(aBuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); + return OStringToOUString(aBuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8); } #if ENABLE_DBUS @@ -977,7 +976,7 @@ void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi //#i105784#/rhbz#527719 improve selection of fallback font if (aLangAttrib.isEmpty()) { - aLangTag = getExemplarLangTagForCodePoint(nCode); + aLangTag.reset(getExemplarLangTagForCodePoint(nCode)); aLangAttrib = mapToFontConfigLangTag(aLangTag); } } @@ -1109,7 +1108,7 @@ void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi //scripts to default to a given language. for (sal_Int32 i = 0; i < nRemainingLen; ++i) { - LanguageTag aOurTag = getExemplarLangTagForCodePoint(pRemainingCodes[i]); + LanguageTag aOurTag(getExemplarLangTagForCodePoint(pRemainingCodes[i])); OString sTag = OUStringToOString(aOurTag.getBcp47(), RTL_TEXTENCODING_UTF8); if (m_aPreviousLangSupportRequests.find(sTag) != m_aPreviousLangSupportRequests.end()) continue; |