diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx index 57f3f5bca179..1431395a8b3d 100644 --- a/helpcompiler/source/HelpCompiler.cxx +++ b/helpcompiler/source/HelpCompiler.cxx @@ -87,7 +87,7 @@ void HelpCompiler::saveXhpForJar( xmlDocPtr doc, const fs::path &filePath ) #else std::string pathSep = "/"; #endif - const std::string& sourceXhpPath = filePath.native_file_string(); + const std::string sourceXhpPath = filePath.native_file_string(); std::string zipdirPath = zipdir.native_file_string(); const std::string srcdirPath( src.native_file_string() ); // srcdirPath contains trailing /, but we want the file path with / at the beginning diff --git a/i18npool/source/collator/collatorImpl.cxx b/i18npool/source/collator/collatorImpl.cxx index a17d400ac6c1..015d2c34825e 100644 --- a/i18npool/source/collator/collatorImpl.cxx +++ b/i18npool/source/collator/collatorImpl.cxx @@ -68,7 +68,7 @@ CollatorImpl::compareString( const OUString& in_str1, const OUString& in_str2) sal_Int32 SAL_CALL 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(), [](const Implementation& rImp) { return rImp.isDefault; }); if (pImpl != imp.end()) @@ -105,7 +105,7 @@ Sequence< OUString > SAL_CALL CollatorImpl::listCollatorAlgorithms( const lang::Locale& rLocale ) { nLocale = rLocale; - const Sequence< Implementation > &imp = mxLocaleData->getCollatorImplementations(rLocale); + const Sequence< Implementation > imp = mxLocaleData->getCollatorImplementations(rLocale); Sequence< OUString > list(imp.getLength()); auto pBegin = list.getArray(); auto pId = pBegin; diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index 980356b0c4f5..228543d5214b 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -747,7 +747,7 @@ DefaultNumberingProvider::makeNumberingString( const Sequence>= transliteration; if ( !translit ) diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx index 57e2355e15c0..91e663c1f470 100644 --- a/i18npool/source/nativenumber/nativenumbersupplier.cxx +++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx @@ -600,7 +600,7 @@ OUString getNumberText(const Locale& rLocale, const OUString& rNumberString, } // 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 = 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. // We fix this by buffering the result of the conversion. static std::unordered_map> aBuff; - auto& rItems = aBuff[rNumberStr]; + auto& rItems = aBuff[aNumberStr]; auto& rItem = rItems[numbertext_prefix + aLoc]; 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 if (rItem.isEmpty()) - rItem = rNumberStr; + rItem = aNumberStr; } OUString sResult = rItem; if (i != 0 && i < len) diff --git a/i18npool/source/transliteration/fullwidthToHalfwidth.cxx b/i18npool/source/transliteration/fullwidthToHalfwidth.cxx index 558177128618..bdab67d3314f 100644 --- a/i18npool/source/transliteration/fullwidthToHalfwidth.cxx +++ b/i18npool/source/transliteration/fullwidthToHalfwidth.cxx @@ -46,7 +46,7 @@ OUString fullwidthToHalfwidth::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset ) { // 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 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 ) { // 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 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 ) { // 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 return transliteration_OneToOne::transliterateImpl( newStr, 0, newStr.getLength(), nullptr); diff --git a/i18npool/source/transliteration/halfwidthToFullwidth.cxx b/i18npool/source/transliteration/halfwidthToFullwidth.cxx index 528aa0d87523..ff55701da5c2 100644 --- a/i18npool/source/transliteration/halfwidthToFullwidth.cxx +++ b/i18npool/source/transliteration/halfwidthToFullwidth.cxx @@ -38,7 +38,7 @@ OUString halfwidthToFullwidth::transliterateImpl( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >* pOffset ) { // 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 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 ) { // 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 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 ) { // 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 return i18nutil::widthfolding::compose_ja_voiced_sound_marks ( newStr, 0, newStr.getLength(), pOffset, WIDTHFOLDING_DONT_USE_COMBINED_VU ); diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx index 7caa334eeaa2..0b2f40683a76 100644 --- a/i18npool/source/transliteration/transliterationImpl.cxx +++ b/i18npool/source/transliteration/transliterationImpl.cxx @@ -296,7 +296,7 @@ TransliterationImpl::loadModulesByImplNames(const Sequence< OUString >& implName Sequence SAL_CALL TransliterationImpl::getAvailableModules( const Locale& rLocale, sal_Int16 sType ) { - const Sequence &translist = mxLocaledata->getTransliterations(rLocale); + const Sequence translist = mxLocaledata->getTransliterations(rLocale); std::vector r; r.reserve(translist.getLength()); Reference body; @@ -525,7 +525,7 @@ TransliterationImpl::getRange(const Sequence< OUString > &inStrs, std::vector ostr; ostr.reserve(nMaxOutputLength); 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) { if ( j_tmp++ >= nMaxOutputLength ) throw RuntimeException(); diff --git a/i18npool/source/transliteration/transliteration_body.cxx b/i18npool/source/transliteration/transliteration_body.cxx index 6cca7b51320a..f4679571d510 100644 --- a/i18npool/source/transliteration/transliteration_body.cxx +++ b/i18npool/source/transliteration/transliteration_body.cxx @@ -138,7 +138,7 @@ Transliteration_body::transliterateImpl( // take care of TOGGLE_CASE transliteration: 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); offsetDataEnd += map.nmap; std::copy_n(map.map, map.nmap, out + j); @@ -154,7 +154,7 @@ Transliteration_body::transliterateImpl( // take care of TOGGLE_CASE transliteration: 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); j += map.nmap; } @@ -166,7 +166,7 @@ Transliteration_body::transliterateImpl( OUString SAL_CALL 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); sal_Unicode* out = pStr->buffer; sal_Int32 i; @@ -181,7 +181,7 @@ Transliteration_body::transliterateChar2String( sal_Unicode inChar ) sal_Unicode SAL_CALL 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) throw MultipleCharsOutputException(); return map.map[0];