summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/dputil.hxx2
-rw-r--r--sc/source/core/data/dpcache.cxx6
-rw-r--r--sc/source/core/data/dputil.cxx16
-rw-r--r--sc/source/core/data/funcdesc.cxx10
-rw-r--r--sc/source/core/tool/chartarr.cxx9
-rw-r--r--sc/source/filter/xml/XMLExportDatabaseRanges.cxx6
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx16
-rw-r--r--sc/source/ui/app/inputhdl.cxx12
-rw-r--r--sc/source/ui/formdlg/dwfunctr.cxx12
-rw-r--r--sc/source/ui/view/gridwin.cxx34
10 files changed, 49 insertions, 74 deletions
diff --git a/sc/inc/dputil.hxx b/sc/inc/dputil.hxx
index 74576c820b01..70fa54e1aa3c 100644
--- a/sc/inc/dputil.hxx
+++ b/sc/inc/dputil.hxx
@@ -46,7 +46,7 @@ public:
double fValue, const ScDPNumGroupInfo* pInfo, sal_Int32 nDatePart,
const SvNumberFormatter* pFormatter);
- SC_DLLPUBLIC static OUString getDisplayedMeasureName(std::u16string_view rName, ScSubTotalFunc eFunc);
+ SC_DLLPUBLIC static OUString getDisplayedMeasureName(const OUString& rName, ScSubTotalFunc eFunc);
SC_DLLPUBLIC static ScSubTotalFunc toSubTotalFunc(ScGeneralFunction eGenFunc);
};
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index a9fe44f3f4e7..f1c32e376091 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -132,13 +132,9 @@ OUString createLabelString( const ScDocument& rDoc, SCCOL nCol, const ScRefCellV
if (aDocStr.isEmpty())
{
// Replace an empty label string with column name.
- OUStringBuffer aBuf;
- aBuf.append(ScResId(STR_COLUMN));
- aBuf.append(' ');
ScAddress aColAddr(nCol, 0, 0);
- aBuf.append(aColAddr.Format(ScRefFlags::COL_VALID));
- aDocStr = aBuf.makeStringAndClear();
+ aDocStr = ScResId(STR_COLUMN) + " " + aColAddr.Format(ScRefFlags::COL_VALID);
}
return aDocStr;
}
diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx
index a561b870e2cd..6fabf2e286dd 100644
--- a/sc/source/core/data/dputil.cxx
+++ b/sc/source/core/data/dputil.cxx
@@ -387,19 +387,15 @@ const char* aFuncStrIds[] = {
}
-OUString ScDPUtil::getDisplayedMeasureName(std::u16string_view rName, ScSubTotalFunc eFunc)
+OUString ScDPUtil::getDisplayedMeasureName(const OUString& rName, ScSubTotalFunc eFunc)
{
- OUStringBuffer aRet;
assert(unsigned(eFunc) < SAL_N_ELEMENTS(aFuncStrIds));
const char* pId = aFuncStrIds[eFunc];
- if (pId)
- {
- aRet.append(ScResId(pId)); // function name
- aRet.append(" - ");
- }
- aRet.append(rName); // field name
-
- return aRet.makeStringAndClear();
+ if (!pId)
+ return rName;
+ return ScResId(pId) + // function name
+ " - " +
+ rName; // field name
}
ScSubTotalFunc ScDPUtil::toSubTotalFunc(ScGeneralFunction eGenFunc)
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 9efd334a4401..c7ea3cc5f927 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -874,14 +874,8 @@ ScFunctionList::ScFunctionList()
pDesc->nFIndex = nNextId++; // ??? OpCode vergeben
pDesc->nCategory = ID_FUNCTION_GRP_ADDINS;
pDesc->mxFuncName = pLegacyFuncData->GetInternalName().toAsciiUpperCase();
-
- OUStringBuffer aBuf(aArgDesc);
- aBuf.append('\n');
- aBuf.append("( AddIn: ");
- aBuf.append(pLegacyFuncData->GetModuleName());
- aBuf.append(" )");
- pDesc->mxFuncDesc = aBuf.makeStringAndClear();
-
+ pDesc->mxFuncDesc = aArgDesc + "\n"
+ "( AddIn: " + pLegacyFuncData->GetModuleName() + " )";
pDesc->nArgCount = nArgs;
if (nArgs)
{
diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx
index 21be72e4d37c..242b4b539bc4 100644
--- a/sc/source/core/tool/chartarr.cxx
+++ b/sc/source/core/tool/chartarr.cxx
@@ -235,14 +235,9 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartSingle()
aString = rDocument.GetString(aCols[nCol], nStrRow, nTab1);
if (aString.isEmpty())
{
- OUStringBuffer aBuf;
- aBuf.append(ScResId(STR_COLUMN));
- aBuf.append(' ');
-
ScAddress aPos( aCols[ nCol ], 0, 0 );
- aBuf.append(aPos.Format(ScRefFlags::COL_VALID));
-
- aString = aBuf.makeStringAndClear();
+ aString = ScResId(STR_COLUMN) + " " +
+ aPos.Format(ScRefFlags::COL_VALID);
}
pMemChart->SetColText( nCol, aString);
}
diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
index 73362197a771..bbcba23903e9 100644
--- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
+++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
@@ -208,11 +208,9 @@ public:
if (meRangeType == ScDBCollection::GlobalAnonymous)
{
// name
- OUStringBuffer aBuf;
- aBuf.append(STR_DB_GLOBAL_NONAME);
- aBuf.append(++mnCounter); // 1-based, for entirely arbitrary reasons. The numbers are ignored on import.
+ OUString aBuf = STR_DB_GLOBAL_NONAME + OUString::number(++mnCounter); // 1-based, for entirely arbitrary reasons. The numbers are ignored on import.
- write(aBuf.makeStringAndClear(), rData);
+ write(aBuf, rData);
}
else if (meRangeType == ScDBCollection::GlobalNamed)
write(rData.GetName(), rData);
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 2a01ad60ce6f..9df7d551e88b 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -827,15 +827,13 @@ sal_Int32 ScXMLImport::SetCurrencySymbol(const sal_Int32 nKey, std::u16string_vi
{
ScXMLImport::MutexGuard aGuard(*this);
LocaleDataWrapper aLocaleData( comphelper::getProcessComponentContext(), LanguageTag( aLocale) );
- OUStringBuffer aBuffer(15);
- aBuffer.append("#");
- aBuffer.append( aLocaleData.getNumThousandSep() );
- aBuffer.append("##0");
- aBuffer.append( aLocaleData.getNumDecimalSep() );
- aBuffer.append("00 [$");
- aBuffer.append(rCurrency);
- aBuffer.append("]");
- sFormatString = aBuffer.makeStringAndClear();
+ sFormatString = "#" +
+ aLocaleData.getNumThousandSep() +
+ "##0" +
+ aLocaleData.getNumDecimalSep() +
+ "00 [$" +
+ rCurrency +
+ "]";
}
sal_Int32 nNewKey = xLocalNumberFormats->queryKey(sFormatString, aLocale, true);
if (nNewKey == -1)
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index bca87cd88aaa..69b6142d702f 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1162,10 +1162,6 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText )
if (nStartPosition > 0)
{
- OUStringBuffer aBuf;
- aBuf.append(aNew.subView(0, nStartPosition));
- aBuf.append(u'\x25BA');
- aBuf.append(aNew.subView(nStartPosition));
nArgs = ppFDesc->getParameterCount();
sal_Int16 nVarArgsSet = 0;
if ( nArgs >= PAIRED_VAR_ARGS )
@@ -1180,9 +1176,11 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText )
}
if ( nVarArgsSet > 0 && nActive > nArgs )
nActive = nArgs - (nActive - nArgs) % nVarArgsSet;
- aBuf.append( " : " );
- aBuf.append( ppFDesc->getParameterDescription(nActive-1) );
- aNew = aBuf.makeStringAndClear();
+ aNew = OUString::Concat(aNew.subView(0, nStartPosition)) +
+ u"\x25BA" +
+ aNew.subView(nStartPosition) +
+ " : " +
+ ppFDesc->getParameterDescription(nActive-1);
if (eMode != SC_INPUT_TOP)
{
ShowTipBelow( aNew );
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index 68aacb9275ba..687578c251e5 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -169,13 +169,13 @@ void ScFunctionWin::SetDescription()
{
pDesc->initArgumentInfo(); // full argument info is needed
- OUStringBuffer aBuf(xFuncList->get_selected_text());
- aBuf.append(":\n\n");
- aBuf.append(pDesc->GetParamList());
- aBuf.append("\n\n");
- aBuf.append(*pDesc->mxFuncDesc);
+ OUString aBuf = xFuncList->get_selected_text() +
+ ":\n\n" +
+ pDesc->GetParamList() +
+ "\n\n" +
+ *pDesc->mxFuncDesc;
- xFiFuncDesc->set_label(aBuf.makeStringAndClear());
+ xFiFuncDesc->set_label(aBuf);
}
}
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index f6edfe5909de..59c0868e7c31 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4286,29 +4286,29 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
// TODO: we could define ocQuote for "
const OUString aQuote('"');
const OUString& sSep = ScCompiler::GetNativeSymbol( ocSep);
- OUStringBuffer aFormula;
- aFormula.append('=');
- aFormula.append(ScCompiler::GetNativeSymbol(ocDde));
- aFormula.append(ScCompiler::GetNativeSymbol(ocOpen));
- aFormula.append(aQuote);
- aFormula.append(aApp);
- aFormula.append(aQuote);
- aFormula.append(sSep);
- aFormula.append(aQuote);
- aFormula.append(aTopic);
- aFormula.append(aQuote);
- aFormula.append(sSep);
- aFormula.append(aQuote);
- aFormula.append(aItem);
- aFormula.append(aQuote);
- aFormula.append(ScCompiler::GetNativeSymbol(ocClose));
+ OUString aFormula =
+ "=" +
+ ScCompiler::GetNativeSymbol(ocDde) +
+ ScCompiler::GetNativeSymbol(ocOpen) +
+ aQuote +
+ aApp +
+ aQuote +
+ sSep +
+ aQuote +
+ aTopic +
+ aQuote +
+ sSep +
+ aQuote +
+ aItem +
+ aQuote +
+ ScCompiler::GetNativeSymbol(ocClose);
pView->DoneBlockMode();
pView->InitBlockMode( nDestPosX, nDestPosY, nThisTab );
pView->MarkCursor( nDestPosX + nSizeX - 1,
nDestPosY + nSizeY - 1, nThisTab );
- pView->EnterMatrix( aFormula.makeStringAndClear(), ::formula::FormulaGrammar::GRAM_NATIVE );
+ pView->EnterMatrix( aFormula, ::formula::FormulaGrammar::GRAM_NATIVE );
pView->MarkRange( aDest, false );
pView->SetCursor( aDest.aStart.Col(), aDest.aStart.Row() );