Kaydet (Commit) 3caa8c63 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Revert "check bounds in RPN tokens, tdf#90694 related and others"

Breaks the Windows tinderbox.

This reverts commit 4baf76dd.
üst 7f423067
...@@ -114,30 +114,6 @@ namespace ...@@ -114,30 +114,6 @@ namespace
rRef.SetAbsTab(0); rRef.SetAbsTab(0);
} }
struct TokenPointerRange
{
FormulaToken** mpStart;
FormulaToken** mpStop;
TokenPointerRange( FormulaToken** p, sal_uInt16 n ) :
mpStart(p), mpStop( p + static_cast<size_t>(n)) {}
};
struct TokenPointers
{
TokenPointerRange maPointerRange[2];
TokenPointers( FormulaToken** pCode, sal_uInt16 nLen, FormulaToken** pRPN, sal_uInt16 nRPN ) :
maPointerRange{ TokenPointerRange( pCode, nLen), TokenPointerRange( pRPN, nRPN)} {}
static bool skipToken( size_t i, const FormulaToken* const * pp )
{
// Handle all tokens in RPN, and code tokens only if they have a
// reference count of 1, which means they are not referenced in
// RPN.
return i == 0 && (*pp)->GetRef() > 1;
}
};
} // namespace } // namespace
// Align MemPools on 4k boundaries - 64 bytes (4k is a MUST for OS/2) // Align MemPools on 4k boundaries - 64 bytes (4k is a MUST for OS/2)
...@@ -3874,16 +3850,10 @@ void checkBounds( ...@@ -3874,16 +3850,10 @@ void checkBounds(
void ScTokenArray::CheckRelativeReferenceBounds( void ScTokenArray::CheckRelativeReferenceBounds(
const sc::RefUpdateContext& rCxt, const ScAddress& rPos, SCROW nGroupLen, std::vector<SCROW>& rBounds ) const const sc::RefUpdateContext& rCxt, const ScAddress& rPos, SCROW nGroupLen, std::vector<SCROW>& rBounds ) const
{ {
TokenPointers aPtrs( pCode, nLen, pRPN, nRPN); FormulaToken** p = pCode;
for (size_t j=0; j<2; ++j) FormulaToken** pEnd = p + static_cast<size_t>(nLen);
{
FormulaToken** p = aPtrs.maPointerRange[j].mpStart;
FormulaToken** pEnd = aPtrs.maPointerRange[j].mpStop;
for (; p != pEnd; ++p) for (; p != pEnd; ++p)
{ {
if (TokenPointers::skipToken(j,p))
continue;
switch ((*p)->GetType()) switch ((*p)->GetType())
{ {
case svSingleRef: case svSingleRef:
...@@ -3904,22 +3874,15 @@ void ScTokenArray::CheckRelativeReferenceBounds( ...@@ -3904,22 +3874,15 @@ void ScTokenArray::CheckRelativeReferenceBounds(
; ;
} }
} }
}
} }
void ScTokenArray::CheckRelativeReferenceBounds( void ScTokenArray::CheckRelativeReferenceBounds(
const ScAddress& rPos, SCROW nGroupLen, const ScRange& rRange, std::vector<SCROW>& rBounds ) const const ScAddress& rPos, SCROW nGroupLen, const ScRange& rRange, std::vector<SCROW>& rBounds ) const
{ {
TokenPointers aPtrs( pCode, nLen, pRPN, nRPN); FormulaToken** p = pCode;
for (size_t j=0; j<2; ++j) FormulaToken** pEnd = p + static_cast<size_t>(nLen);
{
FormulaToken** p = aPtrs.maPointerRange[j].mpStart;
FormulaToken** pEnd = aPtrs.maPointerRange[j].mpStop;
for (; p != pEnd; ++p) for (; p != pEnd; ++p)
{ {
if (TokenPointers::skipToken(j,p))
continue;
switch ((*p)->GetType()) switch ((*p)->GetType())
{ {
case svSingleRef: case svSingleRef:
...@@ -3941,23 +3904,16 @@ void ScTokenArray::CheckRelativeReferenceBounds( ...@@ -3941,23 +3904,16 @@ void ScTokenArray::CheckRelativeReferenceBounds(
; ;
} }
} }
}
} }
void ScTokenArray::CheckExpandReferenceBounds( void ScTokenArray::CheckExpandReferenceBounds(
const sc::RefUpdateContext& rCxt, const ScAddress& rPos, SCROW nGroupLen, std::vector<SCROW>& rBounds ) const const sc::RefUpdateContext& rCxt, const ScAddress& rPos, SCROW nGroupLen, std::vector<SCROW>& rBounds ) const
{ {
const SCROW nInsRow = rCxt.maRange.aStart.Row(); const SCROW nInsRow = rCxt.maRange.aStart.Row();
TokenPointers aPtrs( pCode, nLen, pRPN, nRPN); const FormulaToken* const * p = pCode;
for (size_t j=0; j<2; ++j) const FormulaToken* const * pEnd = p + static_cast<size_t>(nLen);
{
const FormulaToken* const * p = aPtrs.maPointerRange[j].mpStart;
const FormulaToken* const * pEnd = aPtrs.maPointerRange[j].mpStop;
for (; p != pEnd; ++p) for (; p != pEnd; ++p)
{ {
if (TokenPointers::skipToken(j,p))
continue;
switch ((*p)->GetType()) switch ((*p)->GetType())
{ {
case svDoubleRef: case svDoubleRef:
...@@ -4041,7 +3997,6 @@ void ScTokenArray::CheckExpandReferenceBounds( ...@@ -4041,7 +3997,6 @@ void ScTokenArray::CheckExpandReferenceBounds(
; ;
} }
} }
}
} }
namespace { namespace {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment