summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-17 15:47:01 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-17 16:39:33 +0100
commit0f5e9170248df98ef7c7c6d475ff7d2bb9fa2214 (patch)
tree484d55e20e414c16202163b766fdd87777ebb46d /sc
parent0ba6360363fb73b5b200bbc486ed8eeac5f3d337 (diff)
Introduce rtl::OUStringLiteral1
...to use single ASCII character literals "more directly" in the OUString API (instead of having to go via an intermediary OUString ctor call). Especially useful for character literals that are defined as const variables or via macros ("direct" uses of character literals in the OUString API can often simply be replaced with single-character string literals, for improved readability). (The functions overloaded for OUStringLiteral1 are those that are actually used by the existing LO code; more could potentially be added. The asymmetry in the operator ==/!= parameter types is by design, though---writing code like 'x' == s is an abomination that shall not be abetted.) Change-Id: Ic5264714be7439eed56b5dfca6ccaee277306f1f
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/compiler.cxx2
-rw-r--r--sc/source/filter/excel/xechart.cxx2
-rw-r--r--sc/source/filter/excel/xelink.cxx2
-rw-r--r--sc/source/filter/excel/xiname.cxx2
-rw-r--r--sc/source/ui/vba/vbarange.cxx2
-rw-r--r--sc/source/ui/view/viewdata.cxx2
6 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 53d327fa2684..685dbefe77eb 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3261,7 +3261,7 @@ void ScCompiler::AutoCorrectParsedSymbol()
}
else if ( c1 != cQuote && c2 == cQuote )
{ // ..."
- aCorrectedSymbol = OUString(cQuote) + aCorrectedSymbol;
+ aCorrectedSymbol = OUStringLiteral1<cQuote>() + aCorrectedSymbol;
bCorrected = true;
}
else if ( nPos == 0 && (c1 == cx || c1 == cX) )
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 305067872e7a..55b06ab93518 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -1122,7 +1122,7 @@ void XclExpChFrLabelProps::Convert( const ScfPropertySet& rPropSet, bool bShowSe
// label value separator
maData.maSeparator = rPropSet.GetStringProperty( EXC_CHPROP_LABELSEPARATOR );
if( maData.maSeparator.isEmpty() )
- maData.maSeparator = OUString(' ');
+ maData.maSeparator = " ";
}
void XclExpChFrLabelProps::WriteBody( XclExpStream& rStrm )
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index bd34008f0967..a347dceb4caf 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -1441,7 +1441,7 @@ XclExpExternSheet::XclExpExternSheet( const XclExpRoot& rRoot, const OUString& r
XclExpExternSheetBase( rRoot, EXC_ID_EXTERNSHEET )
{
// reference to own sheet: \03<sheetname>
- Init(OUString(EXC_EXTSH_TABNAME) + rTabName);
+ Init(OUStringLiteral1<EXC_EXTSH_TABNAME>() + rTabName);
}
void XclExpExternSheet::Save( XclExpStream& rStrm )
diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx
index 4a1ef2096b94..4a96220bb198 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -99,7 +99,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) :
if( (GetBiff() == EXC_BIFF5) && (maXclName == XclTools::GetXclBuiltInDefName(EXC_BUILTIN_FILTERDATABASE)) )
{
bBuiltIn = true;
- maXclName = OUString(EXC_BUILTIN_FILTERDATABASE);
+ maXclName = OUStringLiteral1<EXC_BUILTIN_FILTERDATABASE>();
}
// convert Excel name to Calc name
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 3768613a3a08..642ddec429a6 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -2934,7 +2934,7 @@ ScVbaRange::AddComment( const uno::Any& Text ) throw (uno::RuntimeException, std
if( Text.hasValue() && !(Text >>= aNoteText) )
throw uno::RuntimeException();
if( aNoteText.isEmpty() )
- aNoteText = OUString( ' ' );
+ aNoteText = " ";
// try to create a new annotation
table::CellRangeAddress aRangePos = lclGetRangeAddress( mxRange );
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 7cc8f2ab0a92..7eb45c7056cf 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -2216,7 +2216,7 @@ void ScViewData::WriteUserData(OUString& rData)
( maTabData[i]->eVSplitMode == SC_SPLIT_FIX &&
maTabData[i]->nFixPosY > MAXROW_30 ) )
{
- cTabSep = OUString(SC_NEW_TABSEP); // in order to not kill a 3.1-version
+ cTabSep = OUStringLiteral1<SC_NEW_TABSEP>(); // in order to not kill a 3.1-version
}
rData += OUString::number( maTabData[i]->nCurX ) + cTabSep +