summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-25 12:37:08 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-25 12:38:37 +0200
commitcb0a4a43a52b2f9230dc676e8ffc8700d006ec0c (patch)
tree8a9c36cf6e13c9b35f9b3881f4813a4235f50d83 /sc
parent327001c7575661a6dd2968a7375dc1eeed58ab2a (diff)
loplugin:stringconstant: Flag more inefficiencies
Change-Id: Icdd850336caf998e62cdb5a90fc3683eddd04a3e
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/compiler.cxx4
-rw-r--r--sc/source/ui/docshell/impex.cxx12
-rw-r--r--sc/source/ui/view/gridwin5.cxx4
-rw-r--r--sc/source/ui/view/tabvwshe.cxx2
4 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 764db1f61686..11aa239658de 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3547,13 +3547,13 @@ void ScCompiler::AutoCorrectParsedSymbol()
if ( comphelper::string::getTokenCount(aCorrectedSymbol, cx) > 1 )
{ // x => *
sal_Unicode c = mxSymbols->getSymbolChar(ocMul);
- aCorrectedSymbol = aCorrectedSymbol.replaceAll(OUString(cx), OUString(c));
+ aCorrectedSymbol = aCorrectedSymbol.replaceAll(OUStringLiteral1<cx>(), OUString(c));
bCorrected = true;
}
if ( comphelper::string::getTokenCount(aCorrectedSymbol, cX) > 1 )
{ // X => *
sal_Unicode c = mxSymbols->getSymbolChar(ocMul);
- aCorrectedSymbol = aCorrectedSymbol.replaceAll(OUString(cX), OUString(c));
+ aCorrectedSymbol = aCorrectedSymbol.replaceAll(OUStringLiteral1<cX>(), OUString(c));
bCorrected = true;
}
}
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index a213ddfff834..1b464287571f 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -695,11 +695,11 @@ static void lcl_UnescapeSylk( OUString & rString, SylkVersion eVersion )
// Older versions quoted the string and doubled embedded quotes, but not
// the semicolons, which was plain wrong.
if (eVersion >= SYLK_OOO32)
- rString = rString.replaceAll( OUString(DOUBLE_SEMICOLON), OUString(';') );
+ rString = rString.replaceAll(OUString(DOUBLE_SEMICOLON), ";");
else
- rString = rString.replaceAll( OUString(DOUBLE_DOUBLEQUOTE), OUString('"') );
+ rString = rString.replaceAll(OUString(DOUBLE_DOUBLEQUOTE), "\"");
- rString = rString.replaceAll( OUString(SYLK_LF), OUString('\n') );
+ rString = rString.replaceAll(OUString(SYLK_LF), "\n");
}
static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p,
@@ -1497,7 +1497,7 @@ void ScImportExport::EmbeddedNullTreatment( OUString & rStr )
sal_Unicode cNull = 0;
if (rStr.indexOf( cNull) >= 0)
{
- rStr = rStr.replaceAll( OUString( &cNull, 1), OUString());
+ rStr = rStr.replaceAll( OUString( &cNull, 1), "");
}
}
@@ -1909,7 +1909,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
// unescape doubled semicolons
aCode = aCode.replaceAll(";;", ";");
// get rid of Xcl escape characters
- aCode = aCode.replaceAll(OUString(static_cast<sal_Unicode>(0x1b)), OUString());
+ aCode = aCode.replaceAll("\x1b", "");
sal_Int32 nCheckPos;
short nType;
sal_uInt32 nKey;
@@ -2002,7 +2002,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
case CELLTYPE_EDIT:
hasstring:
aCellStr = pDoc->GetString(nCol, nRow, aRange.aStart.Tab());
- aCellStr = aCellStr.replaceAll( OUString('\n'), OUString(SYLK_LF) );
+ aCellStr = aCellStr.replaceAll("\n", OUString(SYLK_LF));
aBufStr = "C;X";
aBufStr += OUString::number( c );
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 2e209546c362..d5b55d6d7756 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -248,8 +248,8 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
vcl::KeyCode aCode( KEY_SPACE );
vcl::KeyCode aModifiedCode( KEY_SPACE, KEY_MOD1 );
OUString aModStr( aModifiedCode.GetName() );
- aModStr = aModStr.replaceFirst(aCode.GetName(), OUString());
- aModStr = aModStr.replaceAll("+", OUString());
+ aModStr = aModStr.replaceFirst(aCode.GetName(), "");
+ aModStr = aModStr.replaceAll("+", "");
OUString aCtrlClickHlinkStr = ScGlobal::GetRscString( STR_CTRLCLICKHYPERLINK );
aCtrlClickHlinkStr = aCtrlClickHlinkStr.replaceAll("%s", aModStr);
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index d2298c25cd93..d26475c63816 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -107,7 +107,7 @@ OUString ScTabViewShell::GetSelectionText( bool bWholeWord )
if ( bInFormatDialog || bWholeWord || aRange.aEnd.Row() == aRange.aStart.Row() )
{
- aStrSelection = aStrSelection.replaceAll(OUString(CHAR_CR), " ");
+ aStrSelection = aStrSelection.replaceAll(OUStringLiteral1<CHAR_CR>(), " ");
aStrSelection = aStrSelection.replaceAll("\t", " ");
aStrSelection = comphelper::string::stripEnd(aStrSelection, ' ');
}