Apache OpenOffice (AOO) Bugzilla – Issue 14861
return type mismatch - return by value assigned to reference
Last modified: 2013-08-07 15:02:39 UTC
gcc 3.3 now provides error messages when there are return type mismatches such as when a method returns an object by value that is assigned to a reference which is a bug since the reference points to a temporary variable created to hold the return by value. An occurrence of this type occurred here see ... (fixme?) Please evaluate that line and fix the code in question to prevent the bug if needed. Thanks, i18npool/source/collator/chaptercollator.cxx @@ -110,7 if( ans != 0 ) return ans; (fixme?)OUString &aAddAllowed = OUString::createFromAscii("?"); ParseResult res1, res2; // Bug #100323#, since parseAnyToken does not take length as parameter, we have to copy // it to a temp. string. i18npool/source/collator/collatorImpl.cxx @@ -118,7 sal_Int32 SAL_CALL CollatorImpl::loadDefaultCollator(const lang::Locale& rLocale, sal_Int32 collatorOptions) throw(RuntimeException) { (fixme?) Sequence< Implementation > &imp = localedata->getCollatorImplementations(rLocale); for (sal_Int16 i = 0; i < imp.getLength(); i++) if (imp[i].isDefault) return loadCollatorAlgorithm(imp[i].unoID, rLocale, collatorOptions); i18npool/source/collator/collatorImpl.cxx @@ -156,7 CollatorImpl::listCollatorAlgorithms( const lang::Locale& rLocale ) throw(RuntimeException) { nLocale = rLocale; (fixme?) Sequence< Implementation > &imp = localedata->getCollatorImplementations(rLocale); Sequence< OUString > list(imp.getLength()); for (sal_Int32 i = 0; i < imp.getLength(); i++) { i18npool/source/collator/collator_icu.cxx @@ -93,8 { if (collator) { if (tranModules & TransliterationModules_IGNORE_KANA) { (fixme?) OUString& s1 = ignore->transliterateString2String(str1, off1, len1); (fixme?) OUString& s2 = ignore->transliterateString2String(str2, off2, len2); return collator->compare(s1.getStr(), s1.getLength(), s2.getStr(), s2.getLength()); } else i18npool/source/localedata/localedata.cxx @@ -273,7 cals = getAllCalendars(loc); len = cals.getLength(); } (fixme?) OUString& id = name.getToken(0, under, index); for (index = 0; index < cals.getLength(); index++) { if (id.equals(cals[index].Name)) { ref_cal = cals[index]; i18npool/source/transliteration/fullwidthToHalfwidth.cxx @@ -90,11 throw(RuntimeException) { // Decomposition: GA --> KA + voice-mark (fixme?)OUString& newStr = widthfolding::decompose_ja_voiced_sound_marks (inStr, startPos, nCount, offset, useOffset); // One to One mapping useOffset = sal_False; (fixme?)OUString &tmp = transliteration_OneToOne::transliterate( newStr, 0, newStr.getLength(), offset); useOffset = sal_True; return tmp; } i18npool/source/transliteration/halfwidthToFullwidth.cxx @@ -87,7 sal_Bool _useOffset = useOffset; // One to One mapping useOffset = sal_False; (fixme?)OUString& newStr = transliteration_OneToOne::transliterate( inStr, startPos, nCount, offset); useOffset = _useOffset; // Composition: KA + voice-mark --> GA i18npool/source/transliteration/transliterationImpl.cxx @@ -303,7 Sequence<OUString> SAL_CALL TransliterationImpl::getAvailableModules( const Locale& rLocale, sal_Int16 sType ) throw(RuntimeException) { (fixme?)Sequence<OUString> &translist = localedata->getTransliterations(rLocale); Sequence<OUString> &r = *new Sequence< OUString > (translist.getLength()); Reference<XExtendedTransliteration> body; sal_Int32 n = 0; i18npool/source/transliteration/transliterationImpl.cxx @@ -532,7 sal_Int32 j_tmp = 0; Sequence< OUString > ostr(MaxOutput*length); for (sal_Int32 j = 0; j < length; j+=2) { (fixme?) Sequence< OUString >& temp = bodyCascade[_numCascade]->transliterateRange(inStrs[j], inStrs[j+1]); for ( sal_Int32 k = 0; k < temp.getLength(); k++) { if ( j_tmp >= MaxOutput*length ) throw ERROR; i18npool/source/transliteration/transliteration_commonclass.cxx @@ -162,7 { static Sequence < sal_Int32 > dummy_offset; useOffset = sal_False; (fixme?) OUString &tmpStr = transliterate(inStr, startPos, nCount, dummy_offset); useOffset = sal_True; return tmpStr; } i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -346,7 break; case TRANSLITERATION: try { (fixme?) OUString &tmp = OUString::valueOf( number ); OUString transliteration; getPropertyByName(aProperties, "Transliteration", sal_True) >>= transliteration; translit->loadModuleByImplName(transliteration, aLocale);
reassign and reset prio.
Most fixed by waratah (just changed two bits)
Kevin, please verify in cws_srx644_ooo11beta2 and close if present in SRX645_m5s1 or later.
I guess resolved fixed is the correct status for this one.
Hi, I will verify all of these as soon as I get access to a cws_srx645_ooo11rc which martin just announced will probably be open by Wednesday for volunteer developers. Thanks! Kevin
verfied in 1.1.0.
close issue
Created attachment 73000