summaryrefslogtreecommitdiff
path: root/sc/source/core/tool
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/tool')
-rw-r--r--sc/source/core/tool/chartarr.cxx5
-rw-r--r--sc/source/core/tool/chartlis.cxx4
-rw-r--r--sc/source/core/tool/chgtrack.cxx14
-rw-r--r--sc/source/core/tool/interpr1.cxx24
4 files changed, 14 insertions, 33 deletions
diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx
index bdd30ad3dfe2..5a3d21c69c33 100644
--- a/sc/source/core/tool/chartarr.cxx
+++ b/sc/source/core/tool/chartarr.cxx
@@ -374,14 +374,11 @@ std::unique_ptr<ScMemChart> ScChartArray::CreateMemChartMulti()
if (aString.isEmpty())
{
- OUStringBuffer aBuf(ScResId(STR_ROW));
- aBuf.append(' ');
if ( pPos )
nPosRow = pPos->Row() + 1;
else
nPosRow++;
- aBuf.append(static_cast<sal_Int32>(nPosRow));
- aString = aBuf.makeStringAndClear();
+ aString = ScResId(STR_ROW) + " " + OUString::number(static_cast<sal_Int32>(nPosRow));
}
pMemChart->SetRowText( nRow, aString);
}
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index 5717f297c38d..79f164f87a5e 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -420,9 +420,7 @@ OUString ScChartListenerCollection::getUniqueName(const OUString& rPrefix) const
{
for (sal_Int32 nNum = 1; nNum < 10000; ++nNum) // arbitrary limit to prevent infinite loop.
{
- OUStringBuffer aBuf(rPrefix);
- aBuf.append(nNum);
- OUString aTestName = aBuf.makeStringAndClear();
+ OUString aTestName = rPrefix + OUString::number(nNum);
if (m_Listeners.find(aTestName) == m_Listeners.end())
return aTestName;
}
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index d7f92341a634..991c25615def 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -1197,9 +1197,7 @@ void ScChangeActionMove::GetDescription(
aRsc = aRsc.replaceAt(nPos, 2, aTmpStr);
}
- OUStringBuffer aBuf(rStr); // append to the original string.
- aBuf.append(aRsc);
- rStr = aBuf.makeStringAndClear();
+ rStr += aRsc; // append to the original string.
}
void ScChangeActionMove::GetRefString(
@@ -1470,9 +1468,7 @@ void ScChangeActionContent::GetDescription(
aRsc = aRsc.replaceAt(nPos, 2, aTmpStr);
}
- OUStringBuffer aBuf(rStr); // append to the original string.
- aBuf.append(aRsc);
- rStr = aBuf.makeStringAndClear();
+ rStr += aRsc; // append to the original string.
}
void ScChangeActionContent::GetRefString(
@@ -1502,11 +1498,7 @@ void ScChangeActionContent::GetRefString(
if ( IsDeletedIn() )
{
// Insert the parentheses.
- OUStringBuffer aBuf;
- aBuf.append('(');
- aBuf.append(rStr);
- aBuf.append(')');
- rStr = aBuf.makeStringAndClear();
+ rStr = "(" + rStr + ")";
}
}
else
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 2f17b222aaa1..df8821b84531 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2323,16 +2323,14 @@ void ScInterpreter::ScCell()
else if( aInfoType == "COORD" )
{ // address, lotus 1-2-3 formatted: $TABLE:$COL$ROW
// Yes, passing tab as col is intentional!
- OUStringBuffer aFuncResult;
- OUString aCellStr =
- ScAddress( static_cast<SCCOL>(aCellPos.Tab()), 0, 0 ).Format(
- (ScRefFlags::COL_ABS|ScRefFlags::COL_VALID), nullptr, pDok->GetAddressConvention() );
- aFuncResult.append(aCellStr);
- aFuncResult.append(':');
- aCellStr = aCellPos.Format((ScRefFlags::COL_ABS|ScRefFlags::COL_VALID|ScRefFlags::ROW_ABS|ScRefFlags::ROW_VALID),
+ OUString aCellStr1 =
+ ScAddress( static_cast<SCCOL>(aCellPos.Tab()), 0, 0 ).Format(
+ (ScRefFlags::COL_ABS|ScRefFlags::COL_VALID), nullptr, pDok->GetAddressConvention() );
+ OUString aCellStr2 =
+ aCellPos.Format((ScRefFlags::COL_ABS|ScRefFlags::COL_VALID|ScRefFlags::ROW_ABS|ScRefFlags::ROW_VALID),
nullptr, pDok->GetAddressConvention());
- aFuncResult.append(aCellStr);
- PushString( aFuncResult.makeStringAndClear() );
+ OUString aFuncResult = aCellStr1 + ":" + aCellStr2;
+ PushString( aFuncResult );
}
// *** CELL PROPERTIES ***
@@ -2493,12 +2491,8 @@ void ScInterpreter::ScCellExternal()
return;
}
- OUStringBuffer aBuf;
- aBuf.append('\'');
- aBuf.append(*p);
- aBuf.append("'#$");
- aBuf.append(aTabName);
- PushString(aBuf.makeStringAndClear());
+ OUString aBuf = "'" + *p + "'#$" + aTabName;
+ PushString(aBuf);
}
else if ( aInfoType == "CONTENTS" )
{