summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-08-30 15:29:41 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-08-30 15:29:41 +0200
commit32f9120fa076ef9dcee1d29e0a596a36aade353c (patch)
tree8f5ca4bc9f37598ee2e04726a124ed767a826edd /sw/source/core
parent185c3c8207de78ebb4f4dc053b5fe16f810929cc (diff)
loplugin:stringconstant: adapt to improved OUStringLiteral1 (sw)
Change-Id: Ifa1a6bafd3628b48ebceb09f8cd864361848e81c
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/access/accportions.cxx2
-rw-r--r--sw/source/core/edit/autofmt.cxx10
-rw-r--r--sw/source/core/edit/editsh.cxx2
-rw-r--r--sw/source/core/fields/authfld.cxx2
-rw-r--r--sw/source/core/fields/cellfml.cxx24
-rw-r--r--sw/source/core/table/swtable.cxx4
-rw-r--r--sw/source/core/text/porfld.cxx2
-rw-r--r--sw/source/core/tox/ToxTextGenerator.cxx6
-rw-r--r--sw/source/core/tox/tox.cxx2
-rw-r--r--sw/source/core/undo/unins.cxx2
-rw-r--r--sw/source/core/undo/unovwr.cxx8
11 files changed, 32 insertions, 32 deletions
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index ec6eb87ae886..315b83ffc165 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -184,7 +184,7 @@ void SwAccessiblePortionData::Special(
// #i111768# - apply patch from kstribley:
// Include the control characters.
case POR_CONTROLCHAR:
- sDisplay = rText + OUString( pTextNode->GetText()[nModelPosition] );
+ sDisplay = rText + OUStringLiteral1( pTextNode->GetText()[nModelPosition] );
break;
default:
sDisplay = rText;
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 61a87aa71012..22ba7c6e595c 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -858,11 +858,11 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTextNode& rNd, sal_Int32& rPos,
}
if( pNumTypes )
- *pNumTypes += OUString(cNumTyp);
+ *pNumTypes += OUStringLiteral1(cNumTyp);
eScan = eScan | CHG;
}
else if( pNumTypes && !(eScan & eTmpScan) )
- *pNumTypes += OUString(cNumTyp);
+ *pNumTypes += OUStringLiteral1(cNumTyp);
eScan &= ~DELIM; // remove Delim
@@ -956,9 +956,9 @@ CHECK_ROMAN_5:
nClosingParentheses++;
// only if no numbers were read until here
if( pPrefix && !( eScan & ( NO_DELIM | CHG )) )
- *pPrefix += OUString(rText[nPos]);
+ *pPrefix += OUStringLiteral1(rText[nPos]);
else if( pPostfix )
- *pPostfix += OUString(rText[nPos]);
+ *pPostfix += OUStringLiteral1(rText[nPos]);
if( NO_DELIM & eScan )
{
@@ -1631,7 +1631,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
{
OUString sChgStr('\t');
if( bChgBullet )
- sChgStr = OUString( m_aFlags.cBullet ) + sChgStr;
+ sChgStr = OUStringLiteral1( m_aFlags.cBullet ) + sChgStr;
m_pDoc->getIDocumentContentOperations().InsertString( m_aDelPam, sChgStr );
SfxItemSet aSet( m_pDoc->GetAttrPool(), aTextNodeSetRange );
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 7fa98e0be980..20b576547a53 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -553,7 +553,7 @@ OUString SwEditShell::Calculate()
aFormel += sVar;
}
else
- aFormel += OUString(ch);
+ aFormel += OUStringLiteral1(ch);
}
}
}
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index ed0b65d9acfc..76004ccc0b7a 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -542,7 +542,7 @@ OUString SwAuthorityField::ConditionalExpandAuthIdentifier() const
sRet += pEntry->GetAuthorField(AUTH_FIELD_IDENTIFIER);
}
if(pAuthType->GetSuffix())
- sRet += OUString(pAuthType->GetSuffix());
+ sRet += OUStringLiteral1(pAuthType->GetSuffix());
return sRet;
}
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index 959b87109e04..cb8da529f2dd 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -386,7 +386,7 @@ void SwTableFormula::RelNmsToBoxNms( const SwTable& rTable, OUString& rNewStr,
const SwTableBox *pBox = rTable.GetTableBox(
pNd->FindTableBoxStartNode()->GetIndex() );
- rNewStr += OUString(rFirstBox[0]); // get label for the box
+ rNewStr += OUStringLiteral1(rFirstBox[0]); // get label for the box
rFirstBox = rFirstBox.copy(1);
if( pLastBox )
{
@@ -407,7 +407,7 @@ void SwTableFormula::RelNmsToBoxNms( const SwTable& rTable, OUString& rNewStr,
rNewStr += "A1";
// get label for the box
- rNewStr += OUString(rFirstBox[ rFirstBox.getLength()-1 ]);
+ rNewStr += OUStringLiteral1(rFirstBox[ rFirstBox.getLength()-1 ]);
}
void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTable, OUString& rNewStr,
@@ -419,7 +419,7 @@ void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTable, OUString& rNewStr,
const SwTableBox *pBox = rTable.GetTableBox(
pNd->FindTableBoxStartNode()->GetIndex() );
- rNewStr += OUString(rFirstBox[0]); // get label for the box
+ rNewStr += OUStringLiteral1(rFirstBox[0]); // get label for the box
rFirstBox = rFirstBox.copy(1);
if( pLastBox )
{
@@ -439,7 +439,7 @@ void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTable, OUString& rNewStr,
rNewStr += "0";
// get label for the box
- rNewStr += OUString(rFirstBox[ rFirstBox.getLength()-1 ]);
+ rNewStr += OUStringLiteral1(rFirstBox[ rFirstBox.getLength()-1 ]);
}
void SwTableFormula::BoxNmsToRelNm( const SwTable& rTable, OUString& rNewStr,
@@ -459,7 +459,7 @@ void SwTableFormula::BoxNmsToRelNm( const SwTable& rTable, OUString& rNewStr,
sRefBoxNm = pBox->GetName();
}
- rNewStr += OUString(rFirstBox[0]); // get label for the box
+ rNewStr += OUStringLiteral1(rFirstBox[0]); // get label for the box
rFirstBox = rFirstBox.copy(1);
if( pLastBox )
{
@@ -473,7 +473,7 @@ void SwTableFormula::BoxNmsToRelNm( const SwTable& rTable, OUString& rNewStr,
m_eNmType == EXTRNL_NAME );
// get label for the box
- rNewStr += OUString(rFirstBox[ rFirstBox.getLength()-1 ]);
+ rNewStr += OUStringLiteral1(rFirstBox[ rFirstBox.getLength()-1 ]);
}
void SwTableFormula::PtrToBoxNms( const SwTable& rTable, OUString& rNewStr,
@@ -482,7 +482,7 @@ void SwTableFormula::PtrToBoxNms( const SwTable& rTable, OUString& rNewStr,
// area in these parentheses?
SwTableBox* pBox;
- rNewStr += OUString(rFirstBox[0]); // get label for the box
+ rNewStr += OUStringLiteral1(rFirstBox[0]); // get label for the box
rFirstBox = rFirstBox.copy(1);
if( pLastBox )
{
@@ -505,7 +505,7 @@ void SwTableFormula::PtrToBoxNms( const SwTable& rTable, OUString& rNewStr,
rNewStr += "?";
// get label for the box
- rNewStr += OUString(rFirstBox[ rFirstBox.getLength()-1 ]);
+ rNewStr += OUStringLiteral1(rFirstBox[ rFirstBox.getLength()-1 ]);
}
void SwTableFormula::BoxNmsToPtr( const SwTable& rTable, OUString& rNewStr,
@@ -514,7 +514,7 @@ void SwTableFormula::BoxNmsToPtr( const SwTable& rTable, OUString& rNewStr,
// area in these parentheses?
const SwTableBox* pBox;
- rNewStr += OUString(rFirstBox[0]); // get label for the box
+ rNewStr += OUStringLiteral1(rFirstBox[0]); // get label for the box
rFirstBox = rFirstBox.copy(1);
if( pLastBox )
{
@@ -526,7 +526,7 @@ void SwTableFormula::BoxNmsToPtr( const SwTable& rTable, OUString& rNewStr,
pBox = rTable.GetTableBox( rFirstBox );
rNewStr += OUString::number(reinterpret_cast<sal_PtrDiff>(pBox))
- + OUString(rFirstBox[ rFirstBox.getLength()-1 ]); // get label for the box
+ + OUStringLiteral1(rFirstBox[ rFirstBox.getLength()-1 ]); // get label for the box
}
/// create external formula (for UI)
@@ -1048,7 +1048,7 @@ void SwTableFormula::SplitMergeBoxNm_( const SwTable& rTable, OUString& rNewStr,
{
SwTableFormulaUpdate& rTableUpd = *static_cast<SwTableFormulaUpdate*>(pPara);
- rNewStr += OUString(rFirstBox[0]); // get label for the box
+ rNewStr += OUStringLiteral1(rFirstBox[0]); // get label for the box
rFirstBox = rFirstBox.copy(1);
OUString sTableNm;
@@ -1185,7 +1185,7 @@ void SwTableFormula::SplitMergeBoxNm_( const SwTable& rTable, OUString& rNewStr,
rNewStr += OUString::number(reinterpret_cast<sal_PtrDiff>(pEndBox)) + ":";
rNewStr += OUString::number(reinterpret_cast<sal_PtrDiff>(pSttBox))
- + OUString(rFirstBox[ rFirstBox.getLength()-1] );
+ + OUStringLiteral1(rFirstBox[ rFirstBox.getLength()-1] );
}
/// Create external formula but remember that the formula is placed in a split/merged table
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 617bf177c4d8..4ae7636876bb 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1795,9 +1795,9 @@ void sw_GetTableBoxColStr( sal_uInt16 nCol, OUString& rNm )
do {
const sal_uInt16 nCalc = nCol % coDiff;
if( nCalc >= 26 )
- rNm = OUString( sal_Unicode('a' - 26 + nCalc ) ) + rNm;
+ rNm = OUStringLiteral1( 'a' - 26 + nCalc ) + rNm;
else
- rNm = OUString( sal_Unicode('A' + nCalc ) ) + rNm;
+ rNm = OUStringLiteral1( 'A' + nCalc ) + rNm;
if( 0 == (nCol = nCol - nCalc) )
break;
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 8c489de68590..b06affbf068e 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -744,7 +744,7 @@ SwBulletPortion::SwBulletPortion( const sal_Unicode cBullet,
const bool bCntr,
const sal_uInt16 nMinDst,
const bool bLabelAlignmentPosAndSpaceModeActive )
- : SwNumberPortion( OUString(cBullet) + rBulletFollowedBy,
+ : SwNumberPortion( OUStringLiteral1(cBullet) + rBulletFollowedBy,
pFont, bLft, bCntr, nMinDst,
bLabelAlignmentPosAndSpaceModeActive )
{
diff --git a/sw/source/core/tox/ToxTextGenerator.cxx b/sw/source/core/tox/ToxTextGenerator.cxx
index dade91ce2065..5c868d3a3321 100644
--- a/sw/source/core/tox/ToxTextGenerator.cxx
+++ b/sw/source/core/tox/ToxTextGenerator.cxx
@@ -343,12 +343,12 @@ ToxTextGenerator::ConstructPageNumberPlaceholder(size_t numberOfToxSources)
return retval;
}
// Place holder for the PageNumber; we only respect the first one
- retval += OUString(C_NUM_REPL);
+ retval += OUStringLiteral1(C_NUM_REPL);
for (size_t i = 1; i < numberOfToxSources; ++i) {
retval += S_PAGE_DELI;
- retval += OUString(C_NUM_REPL);
+ retval += OUStringLiteral1(C_NUM_REPL);
}
- retval += OUString(C_END_PAGE_NUM);
+ retval += OUStringLiteral1(C_END_PAGE_NUM);
return retval;
}
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 83d42b8074da..f05f5d22cea3 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -610,7 +610,7 @@ OUString SwFormToken::GetString() const
case TOKEN_TAB_STOP:
sData += OUString::number( nTabStopPosition ) + ","
+ OUString::number( static_cast< sal_Int32 >(eTabAlign) ) + ","
- + OUString(cTabFillChar) + ","
+ + OUStringLiteral1(cTabFillChar) + ","
+ OUString::number( bWithTab ? 1 : 0 );
break;
case TOKEN_CHAPTER_INFO:
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 02bb04dbb1b6..ef84ed184b47 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -142,7 +142,7 @@ bool SwUndoInsert::CanGrouping( sal_Unicode cIns )
nContent++;
if (pUndoText)
- (*pUndoText) += OUString(cIns);
+ (*pUndoText) += OUStringLiteral1(cIns);
return true;
}
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index a64586a0031d..0f537eaeaa3d 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -67,7 +67,7 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
sal_Int32 nTextNdLen = pTextNd->GetText().getLength();
if( nSttContent < nTextNdLen ) // no pure insert?
{
- aDelStr += OUString( pTextNd->GetText()[nSttContent] );
+ aDelStr += OUStringLiteral1( pTextNd->GetText()[nSttContent] );
if( !pHistory )
pHistory = new SwHistory;
SwRegHistory aRHst( *pTextNd, pHistory );
@@ -82,7 +82,7 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
pTextNd->InsertText( OUString(cIns), rPos.nContent,
SwInsertFlags::EMPTYEXPAND );
- aInsStr += OUString( cIns );
+ aInsStr += OUStringLiteral1( cIns );
if( !bInsChar )
{
@@ -147,7 +147,7 @@ bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
{
if (rPos.nContent.GetIndex() < pDelTextNd->GetText().getLength())
{
- aDelStr += OUString( pDelTextNd->GetText()[rPos.nContent.GetIndex()] );
+ aDelStr += OUStringLiteral1( pDelTextNd->GetText()[rPos.nContent.GetIndex()] );
++rPos.nContent;
}
else
@@ -161,7 +161,7 @@ bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
SwInsertFlags::EMPTYEXPAND) );
assert(ins.getLength() == 1); // check in SwDoc::Overwrite => cannot fail
(void) ins;
- aInsStr += OUString( cIns );
+ aInsStr += OUStringLiteral1( cIns );
if( !bInsChar )
{