[Libreoffice-commits] core.git: sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Mar 24 19:43:32 UTC 2021
sc/source/filter/lotus/op.cxx | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
New commits:
commit 5e8a5ce17a8b22d04db713c28721593f2e3d0382
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Mar 24 09:37:25 2021 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Mar 24 20:42:45 2021 +0100
cid#1242836 rearrange to clear Untrusted value as argument
and...
cid#1242942 Untrusted value as argument
cid#1474015 Untrusted value as argument
cid#1474196 Untrusted value as argument
Change-Id: I3952844908a0d98f04e21bb50c11c53fabcd23a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113029
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index 040cf761600c..e8be41505c25 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -73,10 +73,11 @@ void OP_Integer(LotusContext& rContext, SvStream& r, sal_uInt16 /*n*/)
SCCOL nCol(static_cast<SCCOL>(nTmpCol));
SCROW nRow(static_cast<SCROW>(nTmpRow));
- if (rContext.rDoc.ValidColRow(nCol, nRow))
+ ScAddress aAddr(nCol, nRow, 0);
+ if (rContext.rDoc.ValidAddress(aAddr))
{
rContext.rDoc.EnsureTable(0);
- rContext.rDoc.SetValue(ScAddress(nCol, nRow, 0), static_cast<double>(nValue));
+ rContext.rDoc.SetValue(aAddr, static_cast<double>(nValue));
// 0 digits in fractional part!
SetFormat(rContext, nCol, nRow, 0, nFormat, 0);
@@ -92,11 +93,12 @@ void OP_Number(LotusContext& rContext, SvStream& r, sal_uInt16 /*n*/)
SCCOL nCol(static_cast<SCCOL>(nTmpCol));
SCROW nRow(static_cast<SCROW>(nTmpRow));
- if (rContext.rDoc.ValidColRow(nCol, nRow))
+ ScAddress aAddr(nCol, nRow, 0);
+ if (rContext.rDoc.ValidAddress(aAddr))
{
fValue = ::rtl::math::round( fValue, 15 );
rContext.rDoc.EnsureTable(0);
- rContext.rDoc.SetValue(ScAddress(nCol, nRow, 0), fValue);
+ rContext.rDoc.SetValue(aAddr, fValue);
SetFormat(rContext, nCol, nRow, 0, nFormat, nFractionalFloat);
}
@@ -379,11 +381,12 @@ void OP_Number123(LotusContext& rContext, SvStream& r, sal_uInt16 /*n*/)
SCCOL nCol(static_cast<SCCOL>(nTmpCol));
SCROW nRow(static_cast<SCROW>(nTmpRow));
- if (rContext.rDoc.ValidColRow(nCol, nRow) && nTab <= rContext.rDoc.GetMaxTableNumber())
+ ScAddress aAddr(nCol, nRow, nTab);
+ if (rContext.rDoc.ValidAddress(aAddr) && nTab <= rContext.rDoc.GetMaxTableNumber())
{
double fValue = Snum32ToDouble( nValue );
rContext.rDoc.EnsureTable(nTab);
- rContext.rDoc.SetValue(ScAddress(nCol,nRow,nTab), fValue);
+ rContext.rDoc.SetValue(aAddr, fValue);
}
}
@@ -399,7 +402,7 @@ void OP_Formula123(LotusContext& rContext, SvStream& r, sal_uInt16 n)
std::unique_ptr<ScTokenArray> pResult;
sal_Int32 nBytesLeft = (n > 12) ? n - 12 : 0;
- ScAddress aAddress( nCol, nRow, nTab );
+ ScAddress aAddress(nCol, nRow, nTab);
svl::SharedStringPool& rSPool = rContext.rDoc.GetSharedStringPool();
LotusToSc aConv(rContext, r, rSPool, rContext.eCharset, true);
@@ -408,12 +411,12 @@ void OP_Formula123(LotusContext& rContext, SvStream& r, sal_uInt16 n)
if (!aConv.good())
return;
- if (rContext.rDoc.ValidColRow(nCol, nRow) && nTab <= rContext.rDoc.GetMaxTableNumber())
+ if (rContext.rDoc.ValidAddress(aAddress) && nTab <= rContext.rDoc.GetMaxTableNumber())
{
ScFormulaCell* pCell = new ScFormulaCell(rContext.rDoc, aAddress, std::move(pResult));
pCell->AddRecalcMode( ScRecalcMode::ONLOAD_ONCE );
rContext.rDoc.EnsureTable(nTab);
- rContext.rDoc.SetFormulaCell(ScAddress(nCol,nRow,nTab), pCell);
+ rContext.rDoc.SetFormulaCell(aAddress, pCell);
}
}
@@ -427,10 +430,11 @@ void OP_IEEENumber123(LotusContext& rContext, SvStream& r, sal_uInt16 /*n*/)
SCCOL nCol(static_cast<SCCOL>(nTmpCol));
SCROW nRow(static_cast<SCROW>(nTmpRow));
- if (rContext.rDoc.ValidColRow(nCol, nRow) && nTab <= rContext.rDoc.GetMaxTableNumber())
+ ScAddress aAddr(nCol, nRow, nTab);
+ if (rContext.rDoc.ValidAddress(aAddr) && nTab <= rContext.rDoc.GetMaxTableNumber())
{
rContext.rDoc.EnsureTable(nTab);
- rContext.rDoc.SetValue(ScAddress(nCol,nRow,nTab), dValue);
+ rContext.rDoc.SetValue(aAddr, dValue);
}
}
More information about the Libreoffice-commits
mailing list