25#include <osl/diagnose.h>
33 : pStack( new
TokenId[ nSize ] )
79 sal_uInt32 nNew = ::std::max(
static_cast<sal_uInt32
>(nOld) * 2,
80 static_cast<sal_uInt32
>(nOld) + 1);
85 return static_cast<sal_uInt16
>(nNew);
94 sal_uInt16* pP_IdNew =
new (::std::nothrow) sal_uInt16[ nP_IdNew ];
98 for( sal_uInt16 nL = 0 ; nL <
nP_Id ; nL++ )
99 pP_IdNew[ nL ] =
pP_Id[ nL ];
103 pP_Id.reset( pP_IdNew );
128 std::unique_ptr<sal_uInt16[]> pElementNew(
new (::std::nothrow) sal_uInt16[ nElementNew ]);
129 std::unique_ptr<E_TYPE[]> pTypeNew(
new (::std::nothrow)
E_TYPE[ nElementNew ]);
130 std::unique_ptr<sal_uInt16[]> pSizeNew(
new (::std::nothrow) sal_uInt16[ nElementNew ]);
131 if (!pElementNew || !pTypeNew || !pSizeNew)
136 for( sal_uInt16 nL = 0 ; nL <
nElement ; nL++ )
139 pTypeNew[ nL ] =
pType[ nL ];
140 pSizeNew[ nL ] =
pSize[ nL ];
145 pElement = std::move( pElementNew );
146 pType = std::move( pTypeNew );
147 pSize = std::move( pSizeNew );
161 memset( ppNew, 0,
sizeof(
ScMatrix* ) * nNewSize );
162 for( sal_uInt16 nL = 0 ; nL <
nP_Matrix ; nL++ )
211 pScToken->AddError(
pP_Err[
n ] );
325 OSL_FAIL(
"-TokenPool::GetElement(): undefined state!?");
336 OSL_ENSURE(
m_nRek <=
nP_Id,
"*TokenPool::GetElement(): recursion loops!?");
339 OSL_ENSURE(
nId <
nElementCurrent,
"*TokenPool::GetElementRek(): nId >= nElementCurrent" );
343 SAL_WARN(
"sc.filter",
"*TokenPool::GetElementRek(): nId >= nElementCurrent");
352 SAL_WARN(
"sc.filter",
"-TokenPool::GetElementRek(): pType[ nId ] != T_Id");
362 if (nFirstId >=
nP_Id)
364 SAL_WARN(
"sc.filter",
"TokenPool::GetElementRek: nFirstId >= nP_Id");
368 sal_uInt16* pCurrent = nCnt ? &
pP_Id[ nFirstId ] :
nullptr;
369 if (nCnt >
nP_Id - nFirstId)
371 SAL_WARN(
"sc.filter",
"TokenPool::GetElementRek: nCnt > nP_Id - nFirstId");
372 nCnt =
nP_Id - nFirstId;
375 for( ; nCnt > 0 ; nCnt--, pCurrent++ )
382 SAL_WARN(
"sc.filter",
"TokenPool::GetElementRek: *pCurrent >= nElementCurrent");
689 sal_uInt16
nId =
static_cast<sal_uInt16
>(rId);
700 sal_uInt16 nSecId =
pP_Id[ nPid ];
715 const OUString*
p =
nullptr;
716 sal_uInt16
n =
static_cast<sal_uInt16
>(rId);
Matrix data type that can store values of mixed types.
void AddExternalSingleReference(sal_uInt16 nFileId, const svl::SharedString &rTabName, const ScSingleRefData &rRef)
virtual formula::FormulaToken * AddOpCode(OpCode eCode) override
formula::FormulaToken * AddColRowName(const ScSingleRefData &rRef)
ScSingleRefOpToken with ocColRowName.
formula::FormulaToken * AddExternalDoubleReference(sal_uInt16 nFileId, const svl::SharedString &rTabName, const ScComplexRefData &rRef)
formula::FormulaToken * AddMatrix(const ScMatrixRef &p)
formula::FormulaToken * AddDoubleReference(const ScComplexRefData &rRef)
formula::FormulaToken * AddSingleReference(const ScSingleRefData &rRef)
ScSingleRefToken with ocPush.
void AddRangeName(sal_uInt16 n, sal_Int16 nSheet)
formula::FormulaToken * AddExternalName(sal_uInt16 nFileId, const svl::SharedString &rName)
TokenId StoreName(sal_uInt16 nIndex, sal_Int16 nSheet)
static const sal_uInt16 nScTokenOff
TokenId StoreExtName(sal_uInt16 nFileId, const OUString &rName)
TokenId StoreNlf(const ScSingleRefData &rTr)
bool IsSingleOp(const TokenId &rId, const DefTokenId eId) const
::std::vector< ExtCellRef > maExtCellRefs
ScMatrix * GetMatrix(unsigned int n) const
bool GetElement(const sal_uInt16 nId, ScTokenArray *pScToken)
std::unique_ptr< sal_uInt16[]> pP_Id
svl::SharedStringPool & mrStringPool
TokenPoolPool< sal_uInt16, 8 > pP_Err
std::unique_ptr< E_TYPE[]> pType
TokenPoolPool< std::unique_ptr< EXTCONT >, 32 > ppP_Ext
::std::vector< ExtAreaRef > maExtAreaRefs
TokenPoolPool< double, 8 > pP_Dbl
::std::vector< ExtName > maExtNames
sal_uInt16 nP_MatrixCurrent
TokenPool(svl::SharedStringPool &rSPool)
std::unique_ptr< ScMatrix *[]> ppP_Matrix
::std::vector< RangeName > maRangeNames
bool GetElementRek(const sal_uInt16 nId, ScTokenArray *pScToken)
TokenId StoreExtRef(sal_uInt16 nFileId, const OUString &rTabName, const ScSingleRefData &rRef)
TokenPoolPool< std::unique_ptr< ScSingleRefData >, 16 > ppP_Nlf
sal_uInt16 nElementCurrent
TokenPoolPool< std::unique_ptr< ScSingleRefData >, 32 > ppP_RefTr
std::unique_ptr< sal_uInt16[]> pSize
TokenPoolPool< std::unique_ptr< OUString >, 4 > ppP_Str
std::unique_ptr< sal_uInt16[]> pElement
const OUString * GetExternal(const TokenId &rId) const
void operator>>(TokenId &rId)
bool CheckElementOrGrow()
SharedString intern(const OUString &rStr)
#define SAL_WARN(area, stream)
Complex reference (a range) into the sheet.
Single reference (one address) into the sheet.
bool Grow(sal_uInt16 nByMin=1)
T * getIfInRange(sal_uInt16 n) const
for storage of external area references
for storage of external cell references
for storage of external names
for storage of named ranges
static sal_uInt16 lcl_canGrow(sal_uInt16 nOld)
Returns the new number of elements, or 0 if overflow.