loplugin:reftotemp in helpcompiler..i18npool
Change-Id: I6f7794e6988d1e91c848a093ed85ddb0c6d1c67a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176373 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
parent
ce8816ff95
commit
2f94498419
8 changed files with 20 additions and 20 deletions
|
@ -87,7 +87,7 @@ void HelpCompiler::saveXhpForJar( xmlDocPtr doc, const fs::path &filePath )
|
||||||
#else
|
#else
|
||||||
std::string pathSep = "/";
|
std::string pathSep = "/";
|
||||||
#endif
|
#endif
|
||||||
const std::string& sourceXhpPath = filePath.native_file_string();
|
const std::string sourceXhpPath = filePath.native_file_string();
|
||||||
std::string zipdirPath = zipdir.native_file_string();
|
std::string zipdirPath = zipdir.native_file_string();
|
||||||
const std::string srcdirPath( src.native_file_string() );
|
const std::string srcdirPath( src.native_file_string() );
|
||||||
// srcdirPath contains trailing /, but we want the file path with / at the beginning
|
// srcdirPath contains trailing /, but we want the file path with / at the beginning
|
||||||
|
|
|
@ -68,7 +68,7 @@ CollatorImpl::compareString( const OUString& in_str1, const OUString& in_str2)
|
||||||
sal_Int32 SAL_CALL
|
sal_Int32 SAL_CALL
|
||||||
CollatorImpl::loadDefaultCollator(const lang::Locale& rLocale, sal_Int32 collatorOptions)
|
CollatorImpl::loadDefaultCollator(const lang::Locale& rLocale, sal_Int32 collatorOptions)
|
||||||
{
|
{
|
||||||
const Sequence< Implementation > &imp = mxLocaleData->getCollatorImplementations(rLocale);
|
const Sequence< Implementation > imp = mxLocaleData->getCollatorImplementations(rLocale);
|
||||||
auto pImpl = std::find_if(imp.begin(), imp.end(),
|
auto pImpl = std::find_if(imp.begin(), imp.end(),
|
||||||
[](const Implementation& rImp) { return rImp.isDefault; });
|
[](const Implementation& rImp) { return rImp.isDefault; });
|
||||||
if (pImpl != imp.end())
|
if (pImpl != imp.end())
|
||||||
|
@ -105,7 +105,7 @@ Sequence< OUString > SAL_CALL
|
||||||
CollatorImpl::listCollatorAlgorithms( const lang::Locale& rLocale )
|
CollatorImpl::listCollatorAlgorithms( const lang::Locale& rLocale )
|
||||||
{
|
{
|
||||||
nLocale = rLocale;
|
nLocale = rLocale;
|
||||||
const Sequence< Implementation > &imp = mxLocaleData->getCollatorImplementations(rLocale);
|
const Sequence< Implementation > imp = mxLocaleData->getCollatorImplementations(rLocale);
|
||||||
Sequence< OUString > list(imp.getLength());
|
Sequence< OUString > list(imp.getLength());
|
||||||
auto pBegin = list.getArray();
|
auto pBegin = list.getArray();
|
||||||
auto pId = pBegin;
|
auto pId = pBegin;
|
||||||
|
|
|
@ -747,7 +747,7 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal
|
||||||
break;
|
break;
|
||||||
case TRANSLITERATION:
|
case TRANSLITERATION:
|
||||||
try {
|
try {
|
||||||
const OUString &tmp = OUString::number( number );
|
const OUString tmp = OUString::number( number );
|
||||||
OUString transliteration;
|
OUString transliteration;
|
||||||
getPropertyByName(aProperties, "Transliteration") >>= transliteration;
|
getPropertyByName(aProperties, "Transliteration") >>= transliteration;
|
||||||
if ( !translit )
|
if ( !translit )
|
||||||
|
|
|
@ -600,7 +600,7 @@ OUString getNumberText(const Locale& rLocale, const OUString& rNumberString,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle also month and day names for NatNum12 date formatting
|
// Handle also month and day names for NatNum12 date formatting
|
||||||
const OUString& rNumberStr = (count == 0) ? rNumberString : sBuf.makeStringAndClear();
|
const OUString aNumberStr = (count == 0) ? rNumberString : sBuf.makeStringAndClear();
|
||||||
|
|
||||||
static auto xNumberText
|
static auto xNumberText
|
||||||
= css::linguistic2::NumberText::create(comphelper::getProcessComponentContext());
|
= css::linguistic2::NumberText::create(comphelper::getProcessComponentContext());
|
||||||
|
@ -616,14 +616,14 @@ OUString getNumberText(const Locale& rLocale, const OUString& rNumberString,
|
||||||
// of the continuous update of the multiple number names during typing.
|
// of the continuous update of the multiple number names during typing.
|
||||||
// We fix this by buffering the result of the conversion.
|
// We fix this by buffering the result of the conversion.
|
||||||
static std::unordered_map<OUString, std::map<OUString, OUString>> aBuff;
|
static std::unordered_map<OUString, std::map<OUString, OUString>> aBuff;
|
||||||
auto& rItems = aBuff[rNumberStr];
|
auto& rItems = aBuff[aNumberStr];
|
||||||
auto& rItem = rItems[numbertext_prefix + aLoc];
|
auto& rItem = rItems[numbertext_prefix + aLoc];
|
||||||
if (rItem.isEmpty())
|
if (rItem.isEmpty())
|
||||||
{
|
{
|
||||||
rItem = xNumberText->getNumberText(numbertext_prefix + rNumberStr, rLocale);
|
rItem = xNumberText->getNumberText(numbertext_prefix + aNumberStr, rLocale);
|
||||||
// use number at missing number to text conversion
|
// use number at missing number to text conversion
|
||||||
if (rItem.isEmpty())
|
if (rItem.isEmpty())
|
||||||
rItem = rNumberStr;
|
rItem = aNumberStr;
|
||||||
}
|
}
|
||||||
OUString sResult = rItem;
|
OUString sResult = rItem;
|
||||||
if (i != 0 && i < len)
|
if (i != 0 && i < len)
|
||||||
|
|
|
@ -46,7 +46,7 @@ OUString
|
||||||
fullwidthToHalfwidth::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset )
|
fullwidthToHalfwidth::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset )
|
||||||
{
|
{
|
||||||
// Decomposition: GA --> KA + voice-mark
|
// Decomposition: GA --> KA + voice-mark
|
||||||
const OUString& newStr = i18nutil::widthfolding::decompose_ja_voiced_sound_marks (inStr, startPos, nCount, pOffset);
|
const OUString newStr = i18nutil::widthfolding::decompose_ja_voiced_sound_marks (inStr, startPos, nCount, pOffset);
|
||||||
|
|
||||||
// One to One mapping
|
// One to One mapping
|
||||||
return transliteration_OneToOne::transliterateImpl( newStr, 0, newStr.getLength(), nullptr);
|
return transliteration_OneToOne::transliterateImpl( newStr, 0, newStr.getLength(), nullptr);
|
||||||
|
@ -76,7 +76,7 @@ OUString
|
||||||
FULLWIDTHKATAKANA_HALFWIDTHKATAKANA::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset )
|
FULLWIDTHKATAKANA_HALFWIDTHKATAKANA::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset )
|
||||||
{
|
{
|
||||||
// Decomposition: GA --> KA + voice-mark
|
// Decomposition: GA --> KA + voice-mark
|
||||||
const OUString& newStr = i18nutil::widthfolding::decompose_ja_voiced_sound_marks (inStr, startPos, nCount, pOffset);
|
const OUString newStr = i18nutil::widthfolding::decompose_ja_voiced_sound_marks (inStr, startPos, nCount, pOffset);
|
||||||
|
|
||||||
// One to One mapping
|
// One to One mapping
|
||||||
return transliteration_OneToOne::transliterateImpl( newStr, 0, newStr.getLength(), nullptr);
|
return transliteration_OneToOne::transliterateImpl( newStr, 0, newStr.getLength(), nullptr);
|
||||||
|
@ -106,7 +106,7 @@ OUString
|
||||||
FULLWIDTH_HALFWIDTH_LIKE_ASC::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset )
|
FULLWIDTH_HALFWIDTH_LIKE_ASC::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset )
|
||||||
{
|
{
|
||||||
// Decomposition: GA --> KA + voice-mark
|
// Decomposition: GA --> KA + voice-mark
|
||||||
const OUString& newStr = i18nutil::widthfolding::decompose_ja_voiced_sound_marks (inStr, startPos, nCount, pOffset);
|
const OUString newStr = i18nutil::widthfolding::decompose_ja_voiced_sound_marks (inStr, startPos, nCount, pOffset);
|
||||||
|
|
||||||
// One to One mapping
|
// One to One mapping
|
||||||
return transliteration_OneToOne::transliterateImpl( newStr, 0, newStr.getLength(), nullptr);
|
return transliteration_OneToOne::transliterateImpl( newStr, 0, newStr.getLength(), nullptr);
|
||||||
|
|
|
@ -38,7 +38,7 @@ OUString
|
||||||
halfwidthToFullwidth::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset )
|
halfwidthToFullwidth::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset )
|
||||||
{
|
{
|
||||||
// One to One mapping
|
// One to One mapping
|
||||||
const OUString& newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, nullptr);
|
const OUString newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, nullptr);
|
||||||
|
|
||||||
// Composition: KA + voice-mark --> GA
|
// Composition: KA + voice-mark --> GA
|
||||||
return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), pOffset );
|
return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), pOffset );
|
||||||
|
@ -56,7 +56,7 @@ OUString
|
||||||
HALFWIDTHKATAKANA_FULLWIDTHKATAKANA::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset )
|
HALFWIDTHKATAKANA_FULLWIDTHKATAKANA::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset )
|
||||||
{
|
{
|
||||||
// One to One mapping
|
// One to One mapping
|
||||||
const OUString& newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, nullptr);
|
const OUString newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, nullptr);
|
||||||
|
|
||||||
// Composition: KA + voice-mark --> GA
|
// Composition: KA + voice-mark --> GA
|
||||||
return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), pOffset );
|
return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), pOffset );
|
||||||
|
@ -74,7 +74,7 @@ OUString
|
||||||
HALFWIDTH_FULLWIDTH_LIKE_JIS::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset )
|
HALFWIDTH_FULLWIDTH_LIKE_JIS::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset )
|
||||||
{
|
{
|
||||||
// One to One mapping
|
// One to One mapping
|
||||||
const OUString& newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, nullptr);
|
const OUString newStr = transliteration_OneToOne::transliterateImpl( inStr, startPos, nCount, nullptr);
|
||||||
|
|
||||||
// Composition: KA + voice-mark --> GA
|
// Composition: KA + voice-mark --> GA
|
||||||
return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), pOffset, WIDTHFOLDING_DONT_USE_COMBINED_VU );
|
return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), pOffset, WIDTHFOLDING_DONT_USE_COMBINED_VU );
|
||||||
|
|
|
@ -296,7 +296,7 @@ TransliterationImpl::loadModulesByImplNames(const Sequence< OUString >& implName
|
||||||
Sequence<OUString> SAL_CALL
|
Sequence<OUString> SAL_CALL
|
||||||
TransliterationImpl::getAvailableModules( const Locale& rLocale, sal_Int16 sType )
|
TransliterationImpl::getAvailableModules( const Locale& rLocale, sal_Int16 sType )
|
||||||
{
|
{
|
||||||
const Sequence<OUString> &translist = mxLocaledata->getTransliterations(rLocale);
|
const Sequence<OUString> translist = mxLocaledata->getTransliterations(rLocale);
|
||||||
std::vector<OUString> r;
|
std::vector<OUString> r;
|
||||||
r.reserve(translist.getLength());
|
r.reserve(translist.getLength());
|
||||||
Reference<XExtendedTransliteration> body;
|
Reference<XExtendedTransliteration> body;
|
||||||
|
@ -525,7 +525,7 @@ TransliterationImpl::getRange(const Sequence< OUString > &inStrs,
|
||||||
std::vector<OUString> ostr;
|
std::vector<OUString> ostr;
|
||||||
ostr.reserve(nMaxOutputLength);
|
ostr.reserve(nMaxOutputLength);
|
||||||
for (sal_Int32 j = 0; j < length; j+=2) {
|
for (sal_Int32 j = 0; j < length; j+=2) {
|
||||||
const Sequence< OUString >& temp = bodyCascade[_numCascade]->transliterateRange(inStrs[j], inStrs[j+1]);
|
const Sequence< OUString > temp = bodyCascade[_numCascade]->transliterateRange(inStrs[j], inStrs[j+1]);
|
||||||
|
|
||||||
for (const auto& rStr : temp) {
|
for (const auto& rStr : temp) {
|
||||||
if ( j_tmp++ >= nMaxOutputLength ) throw RuntimeException();
|
if ( j_tmp++ >= nMaxOutputLength ) throw RuntimeException();
|
||||||
|
|
|
@ -138,7 +138,7 @@ Transliteration_body::transliterateImpl(
|
||||||
// take care of TOGGLE_CASE transliteration:
|
// take care of TOGGLE_CASE transliteration:
|
||||||
MappingType nTmpMappingType = lcl_getMappingTypeForToggleCase( nMappingType, in[i] );
|
MappingType nTmpMappingType = lcl_getMappingTypeForToggleCase( nMappingType, in[i] );
|
||||||
|
|
||||||
const i18nutil::Mapping &map = i18nutil::casefolding::getValue( in, i, nCount, aLocale, nTmpMappingType );
|
const i18nutil::Mapping map = i18nutil::casefolding::getValue( in, i, nCount, aLocale, nTmpMappingType );
|
||||||
std::fill_n(offsetDataEnd, map.nmap, i + startPos);
|
std::fill_n(offsetDataEnd, map.nmap, i + startPos);
|
||||||
offsetDataEnd += map.nmap;
|
offsetDataEnd += map.nmap;
|
||||||
std::copy_n(map.map, map.nmap, out + j);
|
std::copy_n(map.map, map.nmap, out + j);
|
||||||
|
@ -154,7 +154,7 @@ Transliteration_body::transliterateImpl(
|
||||||
// take care of TOGGLE_CASE transliteration:
|
// take care of TOGGLE_CASE transliteration:
|
||||||
MappingType nTmpMappingType = lcl_getMappingTypeForToggleCase( nMappingType, in[i] );
|
MappingType nTmpMappingType = lcl_getMappingTypeForToggleCase( nMappingType, in[i] );
|
||||||
|
|
||||||
const i18nutil::Mapping &map = i18nutil::casefolding::getValue( in, i, nCount, aLocale, nTmpMappingType );
|
const i18nutil::Mapping map = i18nutil::casefolding::getValue( in, i, nCount, aLocale, nTmpMappingType );
|
||||||
std::copy_n(map.map, map.nmap, out + j);
|
std::copy_n(map.map, map.nmap, out + j);
|
||||||
j += map.nmap;
|
j += map.nmap;
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ Transliteration_body::transliterateImpl(
|
||||||
OUString SAL_CALL
|
OUString SAL_CALL
|
||||||
Transliteration_body::transliterateChar2String( sal_Unicode inChar )
|
Transliteration_body::transliterateChar2String( sal_Unicode inChar )
|
||||||
{
|
{
|
||||||
const i18nutil::Mapping &map = i18nutil::casefolding::getValue(&inChar, 0, 1, aLocale, nMappingType);
|
const i18nutil::Mapping map = i18nutil::casefolding::getValue(&inChar, 0, 1, aLocale, nMappingType);
|
||||||
rtl_uString* pStr = rtl_uString_alloc(map.nmap);
|
rtl_uString* pStr = rtl_uString_alloc(map.nmap);
|
||||||
sal_Unicode* out = pStr->buffer;
|
sal_Unicode* out = pStr->buffer;
|
||||||
sal_Int32 i;
|
sal_Int32 i;
|
||||||
|
@ -181,7 +181,7 @@ Transliteration_body::transliterateChar2String( sal_Unicode inChar )
|
||||||
sal_Unicode SAL_CALL
|
sal_Unicode SAL_CALL
|
||||||
Transliteration_body::transliterateChar2Char( sal_Unicode inChar )
|
Transliteration_body::transliterateChar2Char( sal_Unicode inChar )
|
||||||
{
|
{
|
||||||
const i18nutil::Mapping &map = i18nutil::casefolding::getValue(&inChar, 0, 1, aLocale, nMappingType);
|
const i18nutil::Mapping map = i18nutil::casefolding::getValue(&inChar, 0, 1, aLocale, nMappingType);
|
||||||
if (map.nmap > 1)
|
if (map.nmap > 1)
|
||||||
throw MultipleCharsOutputException();
|
throw MultipleCharsOutputException();
|
||||||
return map.map[0];
|
return map.map[0];
|
||||||
|
|
Loading…
Reference in a new issue