diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-06-26 13:54:21 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-06-26 13:55:35 +0200 |
commit | 523ce254a816be02acb7b5fe7ed99f60fef2e7c2 (patch) | |
tree | 92f54346262ebd5251402aa1b00ef80b71d3859c /sw | |
parent | 255c96178890f3dabb2b644a044b3f60e173cb09 (diff) |
loplugin:stringconstant: handle OUString+=OUString(literal)
Change-Id: Idb9f1439a786d90679ed6eb95153844332e44b02
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/core/uwriter.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/fields/cellfml.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/fields/macrofld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoidx.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/dbui/dbmgr.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/envelp/envimg.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/utlui/gloslst.cxx | 8 |
12 files changed, 22 insertions, 25 deletions
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index 849ce1b666b8..e312d5c4efe8 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -1018,7 +1018,7 @@ getRandString() int j = getRand(aText.getLength() - s); OUString aRet(aText.copy(s, j)); if (!getRand(5)) - aRet += OUString('\n'); + aRet += "\n"; // fprintf (stderr, "rand string '%s'\n", OUStringToOString(aRet, RTL_TEXTENCODING_UTF8).getStr()); return aRet; } diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 7c118ca5e09f..c9d7b30644c6 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -749,16 +749,16 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTextNode& rNd, sal_Int32& rPos, { ++nDigitLvl; if( pPostfix ) - *pPostfix += OUString((sal_Unicode)1); + *pPostfix += "\x01"; } if( pNumTypes ) - *pNumTypes += OUString((sal_Unicode)('0' + SVX_NUM_ARABIC)); + *pNumTypes += OUStringLiteral1<'0' + SVX_NUM_ARABIC>(); eScan = eScan | CHG; } else if( pNumTypes && !(eScan & DIGIT) ) - *pNumTypes += OUString((sal_Unicode)('0' + SVX_NUM_ARABIC)); + *pNumTypes += OUStringLiteral1<'0' + SVX_NUM_ARABIC>(); eScan &= ~DELIM; // remvoe Delim if( 0 != (eScan & ~CHG) && DIGIT != (eScan & ~CHG)) @@ -825,7 +825,7 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTextNode& rNd, sal_Int32& rPos, { ++nDigitLvl; if( pPostfix ) - *pPostfix += OUString((sal_Unicode)1); + *pPostfix += "\x01"; } if( pNumTypes ) diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index a44b3db93441..9ea3c4570c48 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -226,7 +226,7 @@ double SwTableBox::GetValue( SwTableCalcPara& rCalcPara ) const sal_uInt32 nTmpFormat = 0; if( pNumFormatr->IsNumberFormat( sText, nTmpFormat, aNum ) && css::util::NumberFormat::NUMBER == pNumFormatr->GetType( nTmpFormat )) - sText += OUString('%'); + sText += "%"; } if( pNumFormatr->IsNumberFormat( sText, nFormatIndex, aNum )) @@ -352,7 +352,7 @@ void SwTableFormula::_MakeFormula( const SwTable& rTable, OUString& rNewStr, if ( pTableBox->getRowSpan() >= 1 ) { if( bDelim ) - rNewStr += OUString(cListDelim); + rNewStr += OUStringLiteral1<cListDelim>(); bDelim = true; rNewStr += pCalcPara->rCalc.GetStrResult( pTableBox->GetValue( *pCalcPara ), false ); diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx index 371ca8c5c30a..3d1ec7051f9d 100644 --- a/sw/source/core/fields/macrofld.cxx +++ b/sw/source/core/fields/macrofld.cxx @@ -202,7 +202,7 @@ void SwMacroField::CreateMacroString( // concatenate library and name; use dot only if both strings have content rMacro = rLibraryName; if ( !rLibraryName.isEmpty() && !rMacroName.isEmpty() ) - rMacro += OUString('.'); + rMacro += "."; rMacro += rMacroName; } diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 25230777c170..2c96470f1389 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -2690,7 +2690,7 @@ throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, { if(i) { - sSetStyles += OUString(TOX_STYLE_DELIMITER); + sSetStyles += OUStringLiteral1<TOX_STYLE_DELIMITER>(); } SwStyleNameMapper::FillUIName(pStyles[i], aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 03e5181a9364..33b39e757a6d 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2768,7 +2768,7 @@ static void lcl_toxMatchTSwitch(SwWW8ImplReader& rReader, SwTOXBase& rBase, OUString sStyles( rBase.GetStyleNames( nLevel ) ); if( !sStyles.isEmpty() ) - sStyles += OUString(TOX_STYLE_DELIMITER); + sStyles += OUStringLiteral1<TOX_STYLE_DELIMITER>(); sStyles += sTemplate; rBase.SetStyleNames( sStyles, nLevel ); } diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index d20dffb87154..4faab6be474c 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -743,7 +743,7 @@ IMPL_LINK_NOARG(SwAddStylesDlg_Impl, OkHdl) if(nLevel != USHRT_MAX) { if(!pStyleArr[nLevel].isEmpty()) - pStyleArr[nLevel] += OUString(TOX_STYLE_DELIMITER); + pStyleArr[nLevel] += OUStringLiteral1<TOX_STYLE_DELIMITER>(); pStyleArr[nLevel] += SvTabListBox::GetEntryText(pEntry, 0); } pEntry = m_pHeaderTree->Next(pEntry); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index bc86274004c7..f31aaae4d19d 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -630,9 +630,9 @@ void SwDBManager::ImportDBEntry(SwWrtShell* pSh) SwDBFormatData aDBFormat; OUString sInsert = GetDBField( xColumnProp, aDBFormat); if( DB_SEP_SPACE == nSeparator ) - sInsert += OUString(cSpace); + sInsert += OUStringLiteral1<cSpace>(); else if( DB_SEP_TAB == nSeparator) - sInsert += OUString(cTab); + sInsert += OUStringLiteral1<cTab>(); pSh->Insert(sInsert); if( DB_SEP_RETURN == nSeparator) pSh->SplitNode(); diff --git a/sw/source/uibase/envelp/envimg.cxx b/sw/source/uibase/envelp/envimg.cxx index f7dfd094de0e..135db95e6e0f 100644 --- a/sw/source/uibase/envelp/envimg.cxx +++ b/sw/source/uibase/envelp/envimg.cxx @@ -66,7 +66,7 @@ OUString MakeSender() else if (sToken == "CR") { if(bLastLength) - sRet += OUString(NEXTLINE); + sRet += OUStringLiteral1<NEXTLINE>(); bLastLength = true; } else if (sToken == "FIRSTNAME") diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index d2f69e10ed57..9bab3ad99e38 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -435,9 +435,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) if (!GetShell().IsTableComplexForChart()) { SwFrameFormat* pTableFormat = GetShell().GetTableFormat(); - aRangeString = pTableFormat->GetName(); - aRangeString += OUString( '.' ); - aRangeString += GetShell().GetBoxNms(); + aRangeString = pTableFormat->GetName() + "." + + GetShell().GetBoxNms(); // get table data provider xDataProvider.set( GetView().GetDocShell()->getIDocumentChartDataProviderAccess()->GetChartDataProvider() ); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index ad307b876557..b81bc63c777f 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1857,12 +1857,10 @@ bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, } const OUString& rToken = pCnt->GetParent()->GetTypeToken(); - sUrl += "#"; - sUrl += sEntry; + sUrl += "#" + sEntry; if(!rToken.isEmpty()) { - sUrl += OUString(cMarkSeparator); - sUrl += rToken; + sUrl += OUStringLiteral1<cMarkSeparator>() + rToken; } } else diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx index 4d3f12cf7598..f7183654a4e5 100644 --- a/sw/source/uibase/utlui/gloslst.cxx +++ b/sw/source/uibase/utlui/gloslst.cxx @@ -382,10 +382,10 @@ void SwGlossaryList::FillGroup(AutoTextGroup* pGroup, SwGlossaries* pGlossaries) for(sal_uInt16 j = 0; j < pGroup->nCount; j++) { - pGroup->sLongNames += pBlock->GetLongName(j); - pGroup->sLongNames += OUString(STRING_DELIM); - pGroup->sShortNames += pBlock->GetShortName(j); - pGroup->sShortNames += OUString(STRING_DELIM); + pGroup->sLongNames += pBlock->GetLongName(j) + + OUStringLiteral1<STRING_DELIM>(); + pGroup->sShortNames += pBlock->GetShortName(j) + + OUStringLiteral1<STRING_DELIM>(); } delete pBlock; } |