summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-11-08 15:31:51 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-11-08 20:34:09 +0100
commit1a588c71a0b60d200077138eaff54fced14c4fe2 (patch)
tree5a54419c44bec4082c8254fbf55716403b9be187 /sc/source/ui/unoobj
parent4d66721962f60a9c8b4653dc724f163c45e6ddd9 (diff)
make a number of Calc functions return value by actually returning it
All these returned their value using a reference argument, for apprently no good reason. Change-Id: I6a33417e7df2aac67427c16e5003dfaaa1a814d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124872 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx11
-rw-r--r--sc/source/ui/unoobj/nameuno.cxx6
-rw-r--r--sc/source/ui/unoobj/textuno.cxx3
3 files changed, 8 insertions, 12 deletions
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 6720b9823929..d599e8ea38ba 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1322,8 +1322,7 @@ static OUString lcl_GetInputString( ScDocument& rDoc, const ScAddress& rPos, boo
if (eType == CELLTYPE_FORMULA)
{
ScFormulaCell* pForm = aCell.mpFormula;
- pForm->GetFormula( aVal, formula::FormulaGrammar::mapAPItoGrammar( bEnglish, false));
- return aVal;
+ return pForm->GetFormula( formula::FormulaGrammar::mapAPItoGrammar( bEnglish, false));
}
SvNumberFormatter* pFormatter = bEnglish ? ScGlobal::GetEnglishFormatter() :
@@ -1346,7 +1345,7 @@ static OUString lcl_GetInputString( ScDocument& rDoc, const ScAddress& rPos, boo
}
}
else
- ScCellFormat::GetInputString(aCell, nNumFmt, aVal, *pFormatter, rDoc);
+ aVal = ScCellFormat::GetInputString(aCell, nNumFmt, *pFormatter, rDoc);
// if applicable, prepend ' like in ScTabViewShell::UpdateInputHandler
if ( eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT )
@@ -4794,8 +4793,6 @@ OUString SAL_CALL ScCellRangeObj::getArrayFormula()
if (!pDocSh)
return EMPTY_OUSTRING;
- OUString aFormula;
-
ScDocument& rDoc = pDocSh->GetDocument();
ScRefCellValue aCell1(rDoc, aRange.aStart);
ScRefCellValue aCell2(rDoc, aRange.aEnd);
@@ -4808,10 +4805,10 @@ OUString SAL_CALL ScCellRangeObj::getArrayFormula()
if (pFCell1->GetMatrixOrigin(rDoc, aStart1) && pFCell2->GetMatrixOrigin(rDoc, aStart2))
{
if (aStart1 == aStart2) // both the same matrix
- pFCell1->GetFormula(aFormula); // it doesn't matter from which cell
+ return pFCell1->GetFormula(); // it doesn't matter from which cell
}
}
- return aFormula;
+ return EMPTY_OUSTRING;
}
void ScCellRangeObj::SetArrayFormula_Impl(const OUString& rFormula,
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 6d2bd3cff5ae..69ad7abdae87 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -176,8 +176,8 @@ void ScNamedRangeObj::Modify_Impl( const OUString* pNewName, const ScTokenArray*
if (pNewName)
aInsName = *pNewName;
- OUString aContent; // Content string based =>
- pOld->GetSymbol( aContent, eGrammar); // no problems with changed positions and such.
+ // Content string based => no problems with changed positions and such.
+ OUString aContent = pOld->GetSymbol(eGrammar);
if (pNewContent)
aContent = *pNewContent;
@@ -236,7 +236,7 @@ OUString SAL_CALL ScNamedRangeObj::getContent()
ScRangeData* pData = GetRangeData_Impl();
if (pData)
// GRAM_API for API compatibility.
- pData->GetSymbol( aContent,formula::FormulaGrammar::GRAM_API);
+ aContent = pData->GetSymbol(formula::FormulaGrammar::GRAM_API);
return aContent;
}
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index b590d73d8b92..46ec6dbf2fbd 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -823,8 +823,7 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder()
else
{
sal_uInt32 nFormat = rDoc.GetNumberFormat(aCellPos);
- OUString aText;
- ScCellFormat::GetInputString(aCell, nFormat, aText, *rDoc.GetFormatTable(), rDoc);
+ OUString aText = ScCellFormat::GetInputString(aCell, nFormat, *rDoc.GetFormatTable(), rDoc);
if (!aText.isEmpty())
pEditEngine->SetTextNewDefaults(aText, aDefaults);
else