diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-08-30 15:28:44 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-08-30 15:28:44 +0200 |
commit | d488a646b5a703aef34396041c997902dcbbf98d (patch) | |
tree | 236e8303ba140d869594b634ebe1159bf81b84e6 | |
parent | 79a410daa9fbdc22eef2a0a4e4da4597c2071c4b (diff) |
loplugin:stringconstant: adapt to improved OUStringLiteral1 (sc)
Change-Id: I41af3d6acdb5dfdaa27febf99cc3c5aa031ad779
-rw-r--r-- | sc/source/core/data/global.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 20 | ||||
-rw-r--r-- | sc/source/core/tool/editutil.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/interpr2.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/tool/rangelst.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/rangeutl.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xehelper.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xicontent.cxx | 7 | ||||
-rw-r--r-- | sc/source/filter/excel/xiescher.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xihelper.cxx | 10 | ||||
-rw-r--r-- | sc/source/filter/excel/xlformula.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/qpro/qpro.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/asciiopt.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpusrlst.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/areasdlg.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 2 |
19 files changed, 43 insertions, 45 deletions
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index f6a012cd3250..2605f9835788 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -767,9 +767,9 @@ void ScGlobal::AddQuotes( OUString& rString, sal_Unicode cQuote, bool bEscapeEmb pQ[0] = pQ[1] = cQuote; pQ[2] = 0; OUString aQuotes( pQ ); - rString = rString.replaceAll( OUString(cQuote), aQuotes); + rString = rString.replaceAll( OUStringLiteral1(cQuote), aQuotes); } - rString = OUString( cQuote ) + rString + OUString( cQuote ); + rString = OUStringLiteral1( cQuote ) + rString + OUStringLiteral1( cQuote ); } void ScGlobal::EraseQuotes( OUString& rString, sal_Unicode cQuote, bool bUnescapeEmbedded ) @@ -783,7 +783,7 @@ void ScGlobal::EraseQuotes( OUString& rString, sal_Unicode cQuote, bool bUnescap pQ[0] = pQ[1] = cQuote; pQ[2] = 0; OUString aQuotes( pQ ); - rString = rString.replaceAll( aQuotes, OUString(cQuote)); + rString = rString.replaceAll( aQuotes, OUStringLiteral1(cQuote)); } } } diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 09bd9fbdc953..921ee9793b8d 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -532,7 +532,7 @@ static bool lcl_parseExternalName( { // two consecutive quotes equal a single quote in // the file name. - aTmpFile += OUString(c); + aTmpFile += OUStringLiteral1(c); cPrev = 'a'; } else @@ -550,10 +550,10 @@ static bool lcl_parseExternalName( i = j; bInName = true; - aTmpName += OUString(c); // Keep the separator as part of the name. + aTmpName += OUStringLiteral1(c); // Keep the separator as part of the name. break; } - aTmpFile += OUString(c); + aTmpFile += OUStringLiteral1(c); cPrev = c; } @@ -580,14 +580,14 @@ static bool lcl_parseExternalName( // A second separator ? Not a valid external name. return false; } - aTmpName += OUString(c); + aTmpName += OUStringLiteral1(c); } else { if (c == cSep) { bInName = true; - aTmpName += OUString(c); // Keep the separator as part of the name. + aTmpName += OUStringLiteral1(c); // Keep the separator as part of the name. } else { @@ -617,7 +617,7 @@ static bool lcl_parseExternalName( return false; } while (false); - aTmpFile += OUString(c); + aTmpFile += OUStringLiteral1(c); } } } @@ -664,7 +664,7 @@ static OUString lcl_makeExternalNameStr(const OUString& rFile, const OUString& r OUStringBuffer aBuf(aFile.getLength() + aName.getLength() + 9); if (bODF) aBuf.append( '['); - aBuf.append( "'" + aFile + "'" + OUString(cSep)); + aBuf.append( "'" + aFile + "'" + OUStringLiteral1(cSep)); if (bODF) aBuf.append( "$$'" ); aBuf.append( aName); @@ -3865,13 +3865,13 @@ void ScCompiler::AutoCorrectParsedSymbol() if ( comphelper::string::getTokenCount(aCorrectedSymbol, cx) > 1 ) { // x => * sal_Unicode c = mxSymbols->getSymbolChar(ocMul); - aCorrectedSymbol = aCorrectedSymbol.replaceAll(OUStringLiteral1(cx), OUString(c)); + aCorrectedSymbol = aCorrectedSymbol.replaceAll(OUStringLiteral1(cx), OUStringLiteral1(c)); bCorrected = true; } if ( comphelper::string::getTokenCount(aCorrectedSymbol, cX) > 1 ) { // X => * sal_Unicode c = mxSymbols->getSymbolChar(ocMul); - aCorrectedSymbol = aCorrectedSymbol.replaceAll(OUStringLiteral1(cX), OUString(c)); + aCorrectedSymbol = aCorrectedSymbol.replaceAll(OUStringLiteral1(cX), OUStringLiteral1(c)); bCorrected = true; } } @@ -3978,7 +3978,7 @@ void ScCompiler::AutoCorrectParsedSymbol() OUString aStr2; const sal_Unicode* p = aRef[j].getStr(); while ( *p && CharClass::isAsciiNumeric( OUString(*p) ) ) - aStr2 += OUString(*p++); + aStr2 += OUStringLiteral1(*p++); aRef[j] = OUString( p ); aRef[j] += aStr2; if ( bColons || aRef[j] != aOld ) diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 9eae3d44271f..01c428067b12 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -735,7 +735,7 @@ static OUString lcl_GetCharStr( sal_Int32 nNo ) nCalc = nNo % coDiff; if( !nCalc ) nCalc = coDiff; - aStr = OUString( (sal_Unicode)('a' - 1 + nCalc ) ) + aStr; + aStr = OUStringLiteral1( 'a' - 1 + nCalc ) + aStr; nNo = sal::static_int_cast<sal_Int32>( nNo - nCalc ); if( nNo ) nNo /= coDiff; diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index b71d1babee59..e214d395dcf2 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -3032,8 +3032,8 @@ void ScInterpreter::ScRoman() else nSteps = nMode; } - aRoman += OUString( pChars[ nIndex ] ); - aRoman += OUString( pChars[ nIndex2 ] ); + aRoman += OUStringLiteral1( pChars[ nIndex ] ) + + OUStringLiteral1( pChars[ nIndex2 ] ); nVal = sal::static_int_cast<sal_uInt16>( nVal + pValues[ nIndex ] ); nVal = sal::static_int_cast<sal_uInt16>( nVal - pValues[ nIndex2 ] ); } @@ -3043,7 +3043,7 @@ void ScInterpreter::ScRoman() { // assert can't happen with nVal<4000 precondition assert( nIndex >= 1 ); - aRoman += OUString( pChars[ nIndex - 1 ] ); + aRoman += OUStringLiteral1( pChars[ nIndex - 1 ] ); } sal_Int32 nPad = nDigit % 5; if (nPad) diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index daa2ffec1070..b680eb40c88e 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -137,7 +137,7 @@ public: if (mbFirst) mbFirst = false; else - mrStr += OUString(mcDelim); + mrStr += OUStringLiteral1(mcDelim); mrStr += aStr; } private: diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index 22d803b92d48..2ea7a8642b9b 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -340,7 +340,7 @@ void ScRangeStringConverter::AssignString( if( !rNewStr.isEmpty() ) { if( !rString.isEmpty() ) - rString += OUString(cSeparator); + rString += OUStringLiteral1(cSeparator); rString += rNewStr; } } diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 1df1135f7303..3a3c11ca881d 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -867,7 +867,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico if( !aText.isEmpty() ) { - maHFString += "&" + OUString(cPortionCode) + aText; + maHFString += "&" + OUStringLiteral1(cPortionCode) + aText; mnTotalHeight = ::std::max( mnTotalHeight, nHeight ); } } diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index 84c43e01a1bc..bec74d6084d6 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -389,8 +389,7 @@ void XclImpHyperlink::ConvertToValidTabName(OUString& rUrl) // quite. When this occurs, the whole table name needs to be // quoted. bQuoteTabName = true; - aTabName += OUString(c); - aTabName += OUString(c); + aTabName += OUStringLiteral1(c) + OUStringLiteral1(c); ++i; continue; } @@ -406,9 +405,9 @@ void XclImpHyperlink::ConvertToValidTabName(OUString& rUrl) } } else if (bInQuote) - aTabName += OUString(c); + aTabName += OUStringLiteral1(c); else - aNewUrl += OUString(c); + aNewUrl += OUStringLiteral1(c); } if (bInQuote) diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 8328378c7e36..11a46f47565c 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -2862,7 +2862,7 @@ OUString XclImpPictureObj::GetOleStorageName() const aStrgName = mbEmbedded ? OUString(EXC_STORAGE_OLE_EMBEDDED) : OUString(EXC_STORAGE_OLE_LINKED); static const sal_Char spcHexChars[] = "0123456789ABCDEF"; for( sal_uInt8 nIndex = 32; nIndex > 0; nIndex -= 4 ) - aStrgName += OUString( sal_Unicode( spcHexChars[ ::extract_value< sal_uInt8 >( mnStorageId, nIndex - 4, 4 ) ] ) ); + aStrgName += OUStringLiteral1( spcHexChars[ ::extract_value< sal_uInt8 >( mnStorageId, nIndex - 4, 4 ) ] ); } return aStrgName; } diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index f2f850a8b64d..f562714ee4d1 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -321,7 +321,7 @@ void XclImpHFConverter::ParseString( const OUString& rHFString ) InsertLineBreak(); break; default: - maCurrText += OUString(*pChar); + maCurrText += OUStringLiteral1(*pChar); } } break; @@ -410,7 +410,7 @@ void XclImpHFConverter::ParseString( const OUString& rHFString ) eState = xlPSFontStyle; break; default: - aReadFont += OUString(*pChar); + aReadFont += OUStringLiteral1(*pChar); } } break; @@ -429,7 +429,7 @@ void XclImpHFConverter::ParseString( const OUString& rHFString ) eState = xlPSText; break; default: - aReadStyle += OUString(*pChar); + aReadStyle += OUStringLiteral1(*pChar); } } break; @@ -600,7 +600,7 @@ void lclAppendUrlChar( OUString& rUrl, sal_Unicode cChar ) { case '#': rUrl += "%23"; break; case '%': rUrl += "%25"; break; - default: rUrl += OUString( cChar ); + default: rUrl += OUStringLiteral1( cChar ); } } @@ -736,7 +736,7 @@ void XclImpUrlHelper::DecodeUrl( // --- sheet name --- case xlUrlSheetName: - rTabName += OUString( *pChar ); + rTabName += OUStringLiteral1( *pChar ); break; // --- raw read mode --- diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx index b7dd25fe90f8..f22a259693a9 100644 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -879,7 +879,7 @@ bool XclTokenArrayHelper::GetStringList( OUString& rStringList, const ScTokenArr break; case STATE_SEP: bRet = aIt->GetOpCode() == ocSep; - if( bRet ) rStringList += OUString(cSep); + if( bRet ) rStringList += OUStringLiteral1(cSep); eState = (bRet && (++aIt).Is()) ? STATE_STR : STATE_END; break; default:; diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx index 153c693be79d..77334a20abca 100644 --- a/sc/source/filter/qpro/qpro.cxx +++ b/sc/source/filter/qpro/qpro.cxx @@ -163,7 +163,7 @@ FltError ScQProReader::import( ScDocument *pDoc ) if( nTab < 26 ) { OUString aName; - aName += OUString( sal_Unicode( 'A' + nTab ) ); + aName += OUStringLiteral1( 'A' + nTab ); if (!nTab) pDoc->RenameTab( nTab, aName, false ); else diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 543bc7e95abc..0a4cfe19928e 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1140,7 +1140,7 @@ bool ScInputHandler::GetFuncName( OUString& aStart, OUString& aResult ) ::std::vector<sal_Unicode>::reverse_iterator rIt = aTemp.rbegin(); aResult = OUString( *rIt++ ); while ( rIt != aTemp.rend() ) - aResult += OUString( *rIt++ ); + aResult += OUStringLiteral1( *rIt++ ); return true; } diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index 3447b98e35c0..1d91334c877c 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -155,7 +155,7 @@ static OUString lcl_decodeSepString( const OUString & rSepNums, bool & o_bMergeF { sal_Int32 nVal = aCode.toInt32(); if ( nVal ) - aFieldSeps += OUString((sal_Unicode) nVal); + aFieldSeps += OUStringLiteral1(nVal); } } while ( nPos >= 0 ); diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index d264d6482d58..646656e56358 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -564,7 +564,7 @@ void lcl_GetColumnTypes( for ( const sal_Unicode* p = aFieldName.getStr(); ( c = *p ) != 0; p++ ) { if ( rtl::isAsciiAlpha(c) || rtl::isAsciiDigit(c) || c == '_' ) - aTmpStr += OUString(c); + aTmpStr += OUStringLiteral1(c); else aTmpStr += "_"; } diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 0b63cc1189b6..85efd9ab8219 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -845,7 +845,7 @@ static void lcl_WriteString( SvStream& rStrm, OUString& rString, sal_Unicode cQu if (cQuote) { - rString = OUString(cQuote) + rString + OUString(cQuote); + rString = OUStringLiteral1(cQuote) + rString + OUStringLiteral1(cQuote); } ScImportExport::WriteUnicodeOrByteString( rStrm, rString ); @@ -1664,7 +1664,7 @@ bool ScImportExport::Doc2Text( SvStream& rStrm ) } if( mExportTextOptions.mcSeparatorConvertTo && cSep ) - aCellStr = aCellStr.replaceAll( OUString(cSep), OUString(mExportTextOptions.mcSeparatorConvertTo) ); + aCellStr = aCellStr.replaceAll( OUStringLiteral1(cSep), OUStringLiteral1(mExportTextOptions.mcSeparatorConvertTo) ); if( mExportTextOptions.mbAddQuotes && ( aCellStr.indexOf( cSep ) != -1 ) ) lcl_WriteString( rStrm, aCellStr, cStr, cStr ); @@ -1697,7 +1697,7 @@ bool ScImportExport::Doc2Text( SvStream& rStrm ) } if( mExportTextOptions.mcSeparatorConvertTo && cSep ) - aCellStr = aCellStr.replaceAll( OUString(cSep), OUString(mExportTextOptions.mcSeparatorConvertTo) ); + aCellStr = aCellStr.replaceAll( OUStringLiteral1(cSep), OUStringLiteral1(mExportTextOptions.mcSeparatorConvertTo) ); if( mExportTextOptions.mbAddQuotes && hasLineBreaksOrSeps(aCellStr, cSep) ) lcl_WriteString( rStrm, aCellStr, cStr, cStr ); diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index 3ba056962988..a6b9edd1b996 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -317,12 +317,12 @@ void ScTpUserLists::MakeListStr( OUString& rListStr ) sal_Int32 c = 0; while ( c < nLen ) { - rListStr += OUString(aStr[c]); + rListStr += OUStringLiteral1(aStr[c]); ++c; if ((c < nLen) && (aStr[c] == cDelimiter)) { - rListStr += OUString(aStr[c]); + rListStr += OUStringLiteral1(aStr[c]); while ((c < nLen) && (aStr[c] == cDelimiter)) ++c; diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx index 07c4dcc572db..de2a9e28d5a1 100644 --- a/sc/source/ui/pagedlg/areasdlg.cxx +++ b/sc/source/ui/pagedlg/areasdlg.cxx @@ -216,8 +216,7 @@ void ScPrintAreasDlg::AddRefEntry() if ( pRefInputEdit == pEdPrintArea ) { const sal_Unicode sep = ScCompiler::GetNativeSymbolChar(ocSep); - OUString aVal = pEdPrintArea->GetText(); - aVal += OUString(sep); + OUString aVal = pEdPrintArea->GetText() + OUStringLiteral1(sep); pEdPrintArea->SetText(aVal); sal_Int32 nLen = aVal.getLength(); @@ -286,7 +285,7 @@ void ScPrintAreasDlg::Impl_Reset() if (pPrintRange) { if ( !aStrRange.isEmpty() ) - aStrRange += OUString(sep); + aStrRange += OUStringLiteral1(sep); aOne = pPrintRange->Format(ScRefFlags::RANGE_ABS, pDoc, eConv); aStrRange += aOne; } @@ -771,7 +770,7 @@ static bool lcl_CheckRepeatString( const OUString& rStr, ScDocument* pDoc, bool bEndPos = true; } else - aBuf += OUString(c); + aBuf += OUStringLiteral1(c); } if (!aBuf.isEmpty()) diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index d399687a0095..569b04f9f96a 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -1191,7 +1191,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) } else { - sTmpStr += OUString(cChar); + sTmpStr += OUStringLiteral1(cChar); } nCount++; |