22 #include <tokenarray.hxx>
31 class SharedStringPool;
48 operator const sal_uInt16&()
const {
return nId; }
70 template<
typename T,
int InitialCapacity>
78 ppP_Str( new T[InitialCapacity] ),
79 m_capacity(InitialCapacity),
83 bool Grow(sal_uInt16 nByMin = 1)
85 sal_uInt16 nP_StrNew =
lcl_canGrow(m_capacity, nByMin);
89 T* ppP_StrNew =
new T[ nP_StrNew ];
92 ppP_StrNew[
i ] = std::move(ppP_Str[
i ]);
94 m_capacity = nP_StrNew;
96 ppP_Str.reset( ppP_StrNew );
100 static sal_uInt16
lcl_canGrow( sal_uInt16 nOld, sal_uInt16 nByMin )
103 return nByMin ? nByMin : 1;
106 sal_uInt32 nNew = ::std::max( static_cast<sal_uInt32>(nOld) * 2,
107 static_cast<sal_uInt32>(nOld) + nByMin);
110 if (nNew - nByMin < nOld)
112 return static_cast<sal_uInt16
>(nNew);
116 return ( n < m_capacity ) ? &ppP_Str[ n ] :
nullptr;
145 std::unique_ptr<sal_uInt16[]>
pP_Id;
155 eId( e ), aText( r ){}
203 std::unique_ptr<sal_uInt16[]>
pSize;
267 static const sal_uInt16
nSize = 1024;
286 SAL_WARN(
"sc.filter",
"*TokenStack::Get(): is empty, is empty, ...");
307 SAL_WARN(
"sc.filter",
"*TokenStack::<<(): Stack overflow for " << static_cast<sal_uInt16>(rNewId));
322 SAL_WARN(
"sc.filter",
"*TokenStack::>>(): is empty, is empty, ...");
337 sal_uInt16
nId =
static_cast<sal_uInt16
>(rId);
341 SAL_WARN(
"sc.filter",
"-TokenPool::operator <<: TokenId 0");
346 SAL_WARN(
"sc.filter",
"-TokenPool::operator <<: TokenId in DefToken-Range! " << static_cast<sal_uInt16>(rId));
365 if (static_cast<sal_uInt32>(eId) +
nScTokenOff >= 0xFFFF)
367 SAL_WARN(
"sc.filter",
"-TokenPool::operator<<: enum too large! " << static_cast<sal_uInt32>(eId));
384 sal_uInt16
nId =
static_cast<sal_uInt16
>(rStack.
Get());
412 std::unique_ptr<ScTokenArray> pScToken(
new ScTokenArray(rDoc) );
419 GetElement( static_cast<sal_uInt16>(rId) - 1, pScToken.get());
Matrix data type that can store values of mixed types.
TokenPoolPool< std::unique_ptr< OUString >, 4 > ppP_Str
svl::SharedStringPool & mrStringPool
std::unique_ptr< T[]> ppP_Str
std::unique_ptr< sal_uInt16[]> pElement
std::unique_ptr< sal_uInt16[]> pP_Id
bool GetElementRek(const sal_uInt16 nId, ScTokenArray *pScToken)
TokenId & operator=(const TokenId &r)
bool GrowTripel(sal_uInt16 nByMin)
Single reference (one address) into the sheet.
TokenPoolPool< std::unique_ptr< EXTCONT >, 32 > ppP_Ext
std::unique_ptr< ScMatrix *[]> ppP_Matrix
sal_uInt16 nP_MatrixCurrent
TokenId StoreExtName(sal_uInt16 nFileId, const OUString &rName)
TokenPoolPool< std::unique_ptr< ScSingleRefData >, 16 > ppP_Nlf
std::unique_ptr< E_TYPE[]> pType
for storage of external area references
const OUString * GetExternal(const TokenId &rId) const
bool GetElement(const sal_uInt16 nId, ScTokenArray *pScToken)
TokenPool(svl::SharedStringPool &rSPool)
bool HasMoreTokens() const
TokenId StoreNlf(const ScSingleRefData &rTr)
sal_uInt16 nElementCurrent
::std::vector< RangeName > maRangeNames
for storage of named ranges
T & operator[](sal_uInt16 n)
static const sal_uInt16 nSize
TokenId(const TokenId &r)
static const sal_uInt16 nScTokenOff
std::unique_ptr< TokenId[]> pStack
EXTCONT(const DefTokenId e, const OUString &r)
bool IsSingleOp(const TokenId &rId, const DefTokenId eId) const
static sal_uInt16 lcl_canGrow(sal_uInt16 nOld, sal_uInt16 nByMin)
Returns the new number of elements, or 0 if overflow.
void operator>>(TokenId &rId)
ScMatrix * GetMatrix(unsigned int n) const
TokenId StoreName(sal_uInt16 nIndex, sal_Int16 nSheet)
T * getIfInRange(sal_uInt16 n) const
for storage of external cell references
std::unique_ptr< ScTokenArray > GetTokenArray(const ScDocument &rDoc, const TokenId &rId)
::std::vector< ExtCellRef > maExtCellRefs
TokenPoolPool< sal_uInt16, 8 > pP_Err
bool Grow(sal_uInt16 nByMin=1)
::std::vector< ExtAreaRef > maExtAreaRefs
T const & operator[](sal_uInt16 n) const
std::unique_ptr< sal_uInt16[]> pSize
These need to be in global namespace just like their respective types are.
TokenId StoreExtRef(sal_uInt16 nFileId, const OUString &rTabName, const ScSingleRefData &rRef)
Complex reference (a range) into the sheet.
::std::vector< ExtName > maExtNames
for storage of external names
#define SAL_WARN(area, stream)
bool CheckElementOrGrow()
TokenStack & operator<<(const TokenId &rNewId)
TokenPoolPool< std::unique_ptr< ScSingleRefData >, 32 > ppP_RefTr
void operator>>(TokenId &rId)
TokenPool & operator<<(const TokenId &rId)
TokenPoolPool< double, 8 > pP_Dbl