LibreOffice Module sc (master) 1
formulabase.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <com/sun/star/beans/Pair.hpp>
23#include <com/sun/star/sheet/FormulaToken.hpp>
24#include <com/sun/star/table/CellAddress.hpp>
27#include "workbookhelper.hxx"
28
29namespace com::sun::star {
30 namespace lang { class XMultiServiceFactory; }
31 namespace sheet { class XFormulaParser; }
32}
33
34namespace oox { template< typename Type > class Matrix; }
35namespace com::sun::star::sheet { struct FormulaOpCodeMapEntry; }
36namespace oox { class SequenceInputStream; }
37namespace oox::xls { struct BinAddress; }
38class ScRangeList;
39
40namespace oox::xls {
41
42// Constants ==================================================================
43
44const size_t BIFF_TOKARR_MAXLEN = 4096;
45
46// token class flags ----------------------------------------------------------
47
53
55
56// base token identifiers -----------------------------------------------------
57
59
92
93// base identifiers of classified tokens --------------------------------------
94
117
118// specific token constants ---------------------------------------------------
119
124
127
137
145
146const sal_uInt16 BIFF_TOK_FUNCVAR_CMD = 0x8000;
147const sal_uInt16 BIFF_TOK_FUNCVAR_FUNCIDMASK = 0x7FFF;
150
151const sal_uInt16 BIFF12_TOK_REF_COLMASK = 0x3FFF;
152const sal_Int32 BIFF12_TOK_REF_ROWMASK = 0xFFFFF;
153const sal_uInt16 BIFF12_TOK_REF_COLREL = 0x4000;
154const sal_uInt16 BIFF12_TOK_REF_ROWREL = 0x8000;
155
156const sal_uInt16 BIFF_TOK_REF_COLMASK = 0x00FF;
157const sal_uInt16 BIFF_TOK_REF_ROWMASK = 0x3FFF;
158const sal_uInt16 BIFF_TOK_REF_COLREL = 0x4000;
159const sal_uInt16 BIFF_TOK_REF_ROWREL = 0x8000;
160
161const sal_uInt16 BIFF12_TOK_TABLE_COLUMN = 0x0001;
162const sal_uInt16 BIFF12_TOK_TABLE_COLRANGE = 0x0002;
163const sal_uInt16 BIFF12_TOK_TABLE_ALL = 0x0004;
164const sal_uInt16 BIFF12_TOK_TABLE_HEADERS = 0x0008;
165const sal_uInt16 BIFF12_TOK_TABLE_DATA = 0x0010;
166const sal_uInt16 BIFF12_TOK_TABLE_TOTALS = 0x0020;
167const sal_uInt16 BIFF12_TOK_TABLE_THISROW = 0x0040;
168const sal_uInt16 BIFF12_TOK_TABLE_SP_BRACKETS = 0x0080;
169const sal_uInt16 BIFF12_TOK_TABLE_SP_SEP = 0x0100;
170const sal_uInt16 BIFF12_TOK_TABLE_ROW = 0x0200;
171const sal_uInt16 BIFF12_TOK_TABLE_CELL = 0x0400;
172
186const sal_uInt16 BIFF_TOK_NLR_REL = 0x8000;
187const sal_uInt16 BIFF_TOK_NLR_MASK = 0x3FFF;
188
189const sal_uInt32 BIFF_TOK_NLR_ADDREL = 0x80000000;
190const sal_uInt32 BIFF_TOK_NLR_ADDMASK = 0x3FFFFFFF;
191
192// function constants ---------------------------------------------------------
193
196
197const sal_uInt16 BIFF_FUNC_IF = 1;
198const sal_uInt16 BIFF_FUNC_SUM = 4;
199const sal_uInt16 BIFF_FUNC_TRUE = 34;
200const sal_uInt16 BIFF_FUNC_FALSE = 35;
201const sal_uInt16 BIFF_FUNC_ROWS = 76;
202const sal_uInt16 BIFF_FUNC_COLUMNS = 77;
203const sal_uInt16 BIFF_FUNC_OFFSET = 78;
204const sal_uInt16 BIFF_FUNC_EXTERNCALL = 255;
205const sal_uInt16 BIFF_FUNC_FLOOR = 285;
206const sal_uInt16 BIFF_FUNC_CEILING = 288;
207const sal_uInt16 BIFF_FUNC_HYPERLINK = 359;
208const sal_uInt16 BIFF_FUNC_WEEKNUM = 465;
209
210// Formula type ===============================================================
211
213enum class FormulaType
214{
215 Cell,
216 Array,
218 CondFormat,
220};
221
222// Reference helpers ==========================================================
223
226{
227 sal_Int32 mnCol;
228 sal_Int32 mnRow;
229 bool mbColRel;
230 bool mbRowRel;
231
232 explicit BinSingleRef2d();
233
234 void setBiff12Data( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset );
235
236 void readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset );
237};
238
241{
244
245 void readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset );
246};
247
248// Token vector, token sequence ===============================================
249
250typedef css::sheet::FormulaToken ApiToken;
251typedef css::uno::Sequence< ApiToken > ApiTokenSequence;
252
255typedef css::beans::Pair< css::table::CellAddress, sal_Bool > ApiSpecialTokenInfo;
256
259{
260public:
261 explicit ApiTokenVector();
262
263 ApiToken& operator[]( size_t i ) { return mvTokens[i]; }
264
265 size_t size() const { return mvTokens.size(); }
266
267 ApiToken& back() { return mvTokens.back(); }
268 const ApiToken& back() const { return mvTokens.back(); }
269
270 void clear() { mvTokens.clear(); }
271
272 void pop_back() { mvTokens.pop_back(); }
273
274 void push_back( const ApiToken& rToken ) { mvTokens.push_back( rToken ); }
275
276 void reserve( size_t n ) { mvTokens.reserve( n ); }
277
278 void resize( size_t n ) { mvTokens.resize( n ); }
279
281 css::uno::Any& append( sal_Int32 nOpCode );
282
284 template< typename Type >
285 void append( sal_Int32 nOpCode, const Type& rData ) { append( nOpCode ) <<= rData; }
286
289
290private:
291 ::std::vector< ApiToken > mvTokens;
292};
293
294// Token sequence iterator ====================================================
295
298{
299public:
300 explicit ApiTokenIterator( const ApiTokenSequence& rTokens, sal_Int32 nSpacesOpCode );
301 bool is() const { return mpToken != mpTokenEnd; }
302 const ApiToken* operator->() const { return mpToken; }
303
305
306private:
307 void skipSpaces();
308
309private:
312 const sal_Int32 mnSpacesOpCode;
313};
314
315// List of API op-codes =======================================================
316
319{
320 // special
321 sal_Int32 OPCODE_UNKNOWN;
322 sal_Int32 OPCODE_EXTERNAL;
323 // formula structure
324 sal_Int32 OPCODE_PUSH;
325 sal_Int32 OPCODE_MISSING;
326 sal_Int32 OPCODE_SPACES;
327 sal_Int32 OPCODE_NAME;
328 sal_Int32 OPCODE_DBAREA;
329 sal_Int32 OPCODE_NLR;
330 sal_Int32 OPCODE_DDE;
331 sal_Int32 OPCODE_MACRO;
332 sal_Int32 OPCODE_BAD;
333 sal_Int32 OPCODE_NONAME;
334 // separators
335 sal_Int32 OPCODE_OPEN;
336 sal_Int32 OPCODE_CLOSE;
337 sal_Int32 OPCODE_SEP;
338 // array separators
343 // unary operators
346 sal_Int32 OPCODE_PERCENT;
347 // binary operators
348 sal_Int32 OPCODE_ADD;
349 sal_Int32 OPCODE_SUB;
350 sal_Int32 OPCODE_MULT;
351 sal_Int32 OPCODE_DIV;
352 sal_Int32 OPCODE_POWER;
353 sal_Int32 OPCODE_CONCAT;
354 sal_Int32 OPCODE_EQUAL;
356 sal_Int32 OPCODE_LESS;
358 sal_Int32 OPCODE_GREATER;
361 sal_Int32 OPCODE_LIST;
362 sal_Int32 OPCODE_RANGE;
363};
364
365// Function parameter info ====================================================
366
369{
370 Regular,
371 CalcOnly,
372 ExcelOnly
373};
374
456{
458};
459
460// Function data ==============================================================
461
465{
469
479{
480 OUString maOdfFuncName;
481 OUString maOoxFuncName;
483 OUString maExtProgName;
485 sal_Int32 mnApiOpCode;
486 sal_uInt16 mnBiff12FuncId;
487 sal_uInt16 mnBiffFuncId;
498};
499
501
502// Function info parameter class iterator =====================================
503
513{
514public:
515 explicit FunctionParamInfoIterator( const FunctionInfo& rFuncInfo );
516
517 bool isCalcOnlyParam() const;
518 bool isExcelOnlyParam() const;
520
521private:
525};
526
527// Base function provider =====================================================
528
530
533class FunctionProvider // not derived from WorkbookHelper to make it usable in file dumpers
534{
535public:
536 explicit FunctionProvider(bool bImportFilter);
537 virtual ~FunctionProvider();
538
543
545 const FunctionInfo* getFuncInfoFromOoxFuncName( const OUString& rFuncName ) const;
546
548 const FunctionInfo* getFuncInfoFromBiff12FuncId( sal_uInt16 nFuncId ) const;
549
552 const FunctionInfo* getFuncInfoFromMacroName( const OUString& rFuncName ) const;
553
556 static FunctionLibraryType getFuncLibTypeFromLibraryName( std::u16string_view rLibraryName );
557
558protected:
560 const FunctionInfoVector& getFuncs() const;
561
562private:
563 typedef std::shared_ptr< FunctionProviderImpl > FunctionProviderImplRef;
565};
566
567// Op-code and function provider ==============================================
568
569struct OpCodeProviderImpl;
570
574class OpCodeProvider : public FunctionProvider // not derived from WorkbookHelper to make it usable as UNO service
575{
576public:
577 explicit OpCodeProvider(const css::uno::Reference<css::lang::XMultiServiceFactory>& rxModelFactory,
578 bool bImportFilter);
579 virtual ~OpCodeProvider() override;
580
581 OpCodeProvider(OpCodeProvider const &) = default;
585
588 const ApiOpCodes& getOpCodes() const;
589
591 const FunctionInfo* getFuncInfoFromApiToken( const ApiToken& rToken ) const;
592
594 css::uno::Sequence< css::sheet::FormulaOpCodeMapEntry >
595 getOoxParserMap() const;
596
597private:
598 typedef std::shared_ptr< OpCodeProviderImpl > OpCodeProviderImplRef;
600};
601
602// API formula parser wrapper =================================================
603
606{
607public:
608 explicit ApiParserWrapper(
609 const css::uno::Reference< css::lang::XMultiServiceFactory >& rxModelFactory,
610 const OpCodeProvider& rOpCodeProv );
611
614
617 const OUString& rFormula,
618 const ScAddress& rRefPos );
619
620private:
621 css::uno::Reference< css::sheet::XFormulaParser >
624};
625
626// Formula parser/printer base class for filters ==============================
627
630{
631public:
632 explicit FormulaProcessorBase( const WorkbookHelper& rHelper );
633
640 static OUString generateAddress2dString(
641 const ScAddress& rAddress,
642 bool bAbsolute );
643
650 static OUString generateAddress2dString(
651 const BinAddress& rAddress,
652 bool bAbsolute );
653
661 static OUString generateApiString( const OUString& rString );
662
668 static OUString generateApiArray( const Matrix< css::uno::Any >& rMatrix );
669
681 css::uno::Any
682 extractReference( const ApiTokenSequence& rTokens ) const;
683
699 bool extractCellRange(
700 ScRange& orRange,
701 const ApiTokenSequence& rTokens ) const;
702
722 ScRangeList& orRanges,
723 const ApiTokenSequence& rTokens,
724 sal_Int32 nFilterBySheet ) const;
725
736 bool extractString(
737 OUString& orString,
738 const ApiTokenSequence& rTokens ) const;
739
755 ApiSpecialTokenInfo& orTokenInfo,
756 const ApiTokenSequence& rTokens ) const;
757
773 ApiTokenSequence& orTokens,
774 sal_Unicode cStringSep,
775 bool bTrimLeadingSpaces ) const;
776};
777
778} // namespace oox::xls
779
780/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A wrapper around the FormulaParser service provided by the Calc document.
css::uno::Reference< css::sheet::XFormulaParser > mxParser
ApiParserWrapper(const css::uno::Reference< css::lang::XMultiServiceFactory > &rxModelFactory, const OpCodeProvider &rOpCodeProv)
ApiTokenSequence parseFormula(const OUString &rFormula, const ScAddress &rRefPos)
Calls the XFormulaParser::parseFormula() function of the API parser.
PropertySet & getParserProperties()
Returns read/write access to the formula parser property set.
Token sequence iterator that is able to skip space tokens.
const sal_Int32 mnSpacesOpCode
Pointer behind last token of the token sequence.
ApiTokenIterator & operator++()
const ApiToken * mpToken
const ApiToken * mpTokenEnd
Pointer to current token of the token sequence.
ApiTokenIterator(const ApiTokenSequence &rTokens, sal_Int32 nSpacesOpCode)
const ApiToken * operator->() const
A vector of formula tokens with additional convenience functions.
ApiTokenSequence toSequence() const
Converts to a sequence.
::std::vector< ApiToken > mvTokens
css::uno::Any & append(sal_Int32 nOpCode)
Appends a new token with the passed op-code, returns its data field.
const ApiToken & back() const
ApiToken & operator[](size_t i)
void append(sal_Int32 nOpCode, const Type &rData)
Appends a new token with the passed op-code and data.
void push_back(const ApiToken &rToken)
Represents a conditional formatting object with a list of affected cell ranges.
Base class for import formula parsers and export formula compilers.
bool extractCellRange(ScRange &orRange, const ApiTokenSequence &rTokens) const
Tries to extract a cell range address from a formula token sequence.
void convertStringToStringList(ApiTokenSequence &orTokens, sal_Unicode cStringSep, bool bTrimLeadingSpaces) const
Converts a single string with separators in the passed formula token sequence to a list of string tok...
css::uno::Any extractReference(const ApiTokenSequence &rTokens) const
Tries to extract a single cell reference from a formula token sequence.
bool extractString(OUString &orString, const ApiTokenSequence &rTokens) const
Tries to extract a string from a formula token sequence.
static OUString generateApiArray(const Matrix< css::uno::Any > &rMatrix)
Generates an array string in Calc formula notation from the passed matrix with Any's containing doubl...
static OUString generateApiString(const OUString &rString)
Generates a string in Calc formula notation from the passed string.
FormulaProcessorBase(const WorkbookHelper &rHelper)
bool extractSpecialTokenInfo(ApiSpecialTokenInfo &orTokenInfo, const ApiTokenSequence &rTokens) const
Tries to extract information about a special token used for array formulas, shared formulas,...
void extractCellRangeList(ScRangeList &orRanges, const ApiTokenSequence &rTokens, sal_Int32 nFilterBySheet) const
Tries to extract a cell range list from a formula token sequence.
static OUString generateAddress2dString(const ScAddress &rAddress, bool bAbsolute)
Generates a cell address string in A1 notation from the passed cell address.
Iterator working on the mpParamInfos member of the FunctionInfo struct.
const FunctionParamInfo * mpParamInfo
const FunctionParamInfo * mpParamInfoEnd
FunctionParamInfoIterator & operator++()
FunctionParamInfoIterator(const FunctionInfo &rFuncInfo)
Provides access to function info structs for all available sheet functions.
FunctionProvider & operator=(FunctionProvider const &)=delete
const FunctionInfo * getFuncInfoFromMacroName(const OUString &rFuncName) const
Returns the function info for a macro function referred by the EXTERN.CALL function,...
const FunctionInfo * getFuncInfoFromBiff12FuncId(sal_uInt16 nFuncId) const
Returns the function info for a BIFF12 function index, or 0 on error.
FunctionProviderImplRef mxFuncImpl
FunctionProvider(FunctionProvider &&)=default
static FunctionLibraryType getFuncLibTypeFromLibraryName(std::u16string_view rLibraryName)
Returns the library type associated with the passed URL of a function library (function add-in).
FunctionProvider(bool bImportFilter)
std::shared_ptr< FunctionProviderImpl > FunctionProviderImplRef
const FunctionInfo * getFuncInfoFromOoxFuncName(const OUString &rFuncName) const
Returns the function info for an OOXML function name, or 0 on error.
FunctionProvider(FunctionProvider const &)=default
const FunctionInfoVector & getFuncs() const
Returns the list of all function infos.
Provides access to API op-codes for all available formula tokens and to function info structs for all...
OpCodeProvider(OpCodeProvider const &)=default
const ApiOpCodes & getOpCodes() const
Returns the structure containing all token op-codes for operators and special tokens used by the Calc...
OpCodeProvider(const css::uno::Reference< css::lang::XMultiServiceFactory > &rxModelFactory, bool bImportFilter)
css::uno::Sequence< css::sheet::FormulaOpCodeMapEntry > getOoxParserMap() const
Returns the op-code map that is used by the OOXML formula parser.
virtual ~OpCodeProvider() override
std::shared_ptr< OpCodeProviderImpl > OpCodeProviderImplRef
OpCodeProvider(OpCodeProvider &&)=default
OpCodeProviderImplRef mxOpCodeImpl
OpCodeProvider & operator=(OpCodeProvider const &)=delete
const FunctionInfo * getFuncInfoFromApiToken(const ApiToken &rToken) const
Returns the function info for an API token, or 0 on error.
Helper class to provide access to global workbook data.
sal_Int64 n
Type
Array
int i
const sal_uInt8 BIFF_TOKID_MEMFUNC
Constant reference subexpression without result.
const sal_uInt8 BIFF_TOKID_ENDSHEET
Start of a sheet reference (BIFF2-BIFF4).
Definition: formulabase.hxx:87
const sal_uInt8 BIFF_TOKID_LT
String concatenation operator.
Definition: formulabase.hxx:69
const sal_uInt16 BIFF_TOK_NLR_REL
NLR: Pivot table name.
const sal_uInt8 BIFF_TOK_NLR_ROWR
NLR: Invalid/deleted.
const sal_uInt16 BIFF_TOK_REF_ROWMASK
Mask to extract BIFF8 column from reference.
const sal_uInt8 BIFF_TOKID_LIST
Intersection operator.
Definition: formulabase.hxx:76
const sal_uInt16 BIFF_TOK_REF_COLREL
Mask to extract BIFF2-BIFF5 row from reference.
const sal_uInt16 BIFF_FUNC_EXTERNCALL
Function identifier of the OFFSET function.
const sal_Int32 BIFF12_TOK_REF_ROWMASK
Mask to extract column from reference (BIFF12).
css::sheet::FormulaToken ApiToken
const sal_uInt8 BIFF_TOK_ATTR_CHOOSE
Start of true condition in IF function.
const sal_uInt8 BIFF_TOKID_GE
Equal operator.
Definition: formulabase.hxx:72
const sal_uInt8 BIFF_TOKID_RANGE
List operator.
Definition: formulabase.hxx:77
const sal_uInt16 BIFF_FUNC_SUM
Function identifier of the IF function.
const sal_uInt8 BIFF_TOK_ATTR_SKIP
Jump array of CHOOSE function.
const sal_uInt8 BIFF_TOKID_REFN
Deleted 2D area reference.
const sal_uInt8 BIFF_TOKID_UMINUS
Unary plus.
Definition: formulabase.hxx:79
const sal_uInt8 BIFF_TOK_ATTR_SPACE_BR
Spaces before next token.
const sal_uInt8 BIFF_TOKCLASS_REF
00-1F: Base tokens.
Definition: formulabase.hxx:50
const sal_uInt16 BIFF_FUNC_COLUMNS
Function identifier of the ROWS function.
const sal_uInt8 BIFF_TOK_NLR_ROWV
NLR: Column index.
const sal_uInt16 BIFF12_TOK_TABLE_COLRANGE
Table reference: Single column.
const sal_uInt8 BIFF_TOKID_NAMEX
const sal_uInt16 BIFF_FUNC_TRUE
Function identifier of the SUM function.
const sal_uInt8 BIFF_TOKID_AREAERR
Deleted 2D cell reference.
const sal_uInt8 BIFF_TOKID_NE
Greater than operator.
Definition: formulabase.hxx:74
const sal_uInt8 BIFF_TOK_ATTR_VOLATILE
TRUE value of a tBool token.
const sal_uInt16 BIFF12_TOK_TABLE_DATA
Table reference: Special [#Headers] range.
const sal_uInt32 BIFF_TOK_NLR_ADDREL
Mask to extract BIFF8 column from NLR.
const sal_uInt8 BIFF_TOK_FUNCVAR_CMDPROMPT
Mask for function/command index.
const sal_uInt8 BIFF_TOKID_REF3D
External reference.
css::uno::Sequence< ApiToken > ApiTokenSequence
const sal_uInt16 BIFF_TOK_FUNCVAR_FUNCIDMASK
Macro command.
const size_t BIFF_TOKARR_MAXLEN
Definition: formulabase.hxx:44
const sal_uInt8 BIFF_MAX_PARAMCOUNT
Maximum parameter count for OOXML/BIFF12 files.
const sal_uInt8 BIFF_TOK_ATTR_ASSIGN
SUM function with one parameter.
const sal_uInt8 BIFF_TOKID_REFERR
Variable reference subexpression.
const sal_uInt16 BIFF12_TOK_TABLE_TOTALS
Table reference: Special [#Data] range.
const sal_uInt8 BIFF_TOKID_TBL
Array or shared formula reference.
Definition: formulabase.hxx:62
const sal_uInt8 BIFF_TOKID_AREAN
Relative 2D cell reference (in names).
const sal_uInt8 BIFF_TOKID_ATTR
Natural language reference (NLR).
Definition: formulabase.hxx:85
const sal_uInt8 BIFF_TOKID_EXP
Placeholder for invalid token id.
Definition: formulabase.hxx:61
const sal_uInt8 BIFF_TOKID_ISECT
Not equal operator.
Definition: formulabase.hxx:75
const sal_uInt16 BIFF12_TOK_REF_COLREL
Mask to extract row from reference (BIFF12).
css::beans::Pair< css::table::CellAddress, sal_Bool > ApiSpecialTokenInfo
Contains the base address and type of a special token representing an array formula or a shared formu...
const sal_uInt8 BIFF_TOKID_SUB
Addition operator.
Definition: formulabase.hxx:64
const sal_uInt8 BIFF_TOKID_NAME
Function, variable number of arguments.
Definition: formulabase.hxx:98
const sal_uInt8 BIFF_TOK_NLR_SCOLR
Stacked NLR: Row index.
RefVector< FunctionInfo > FunctionInfoVector
const sal_uInt16 BIFF12_TOK_REF_ROWREL
True = column is relative (BIFF12).
const sal_uInt8 BIFF_TOKCLASS_ARR
40-5F: Value class tokens.
Definition: formulabase.hxx:52
FormulaType
Function identifier of the WEEKNUM function.
@ SharedFormula
Array (matrix) formula.
const sal_uInt16 BIFF_FUNC_FLOOR
BIFF function id of the EXTERN.CALL function.
const sal_uInt8 BIFF_TOKID_INT
Boolean constant.
Definition: formulabase.hxx:90
const sal_uInt8 BIFF_TOK_NLR_SXNAME
NLR: Invalid/deleted range.
const sal_uInt8 BIFF_TOKID_MEMNOMEM
Deleted reference subexpression.
const sal_uInt8 BIFF_TOK_ATTR_SPACE_SP_PRE
Line breaks before closing parenthesis.
const sal_uInt8 BIFF_TOKID_FUNCVAR
Function, fixed number of arguments.
Definition: formulabase.hxx:97
const sal_uInt16 BIFF12_TOK_TABLE_HEADERS
Table reference: Special [#All] range.
const sal_uInt8 BIFF_TOKID_MUL
Subtraction operator.
Definition: formulabase.hxx:65
const sal_uInt8 BIFF_TOK_ATTR_SPACE
BASIC style assignment.
const sal_uInt8 BIFF_TOKID_GT
Greater than or equal operator.
Definition: formulabase.hxx:73
const sal_uInt8 BIFF_TOK_ATTR_SPACE_BR_CLOSE
Spaces before closing parenthesis.
const sal_uInt8 BIFF_TOK_ARRAY_DOUBLE
Deleted 3D area reference.
const sal_uInt8 BIFF_TOKID_AREAERR3D
Deleted 3D cell reference.
const sal_uInt16 BIFF12_TOK_TABLE_ROW
Table reference: Spaces after separators.
const sal_uInt8 BIFF_TOKID_REFERR3D
3D area reference.
const sal_uInt8 BIFF_TOKID_MEMAREAN
Relative 2D area reference (in names).
const sal_uInt32 BIFF_TOK_NLR_ADDMASK
NLR relative (in appended data).
const sal_uInt8 BIFF_TOKID_AREA
2D cell reference.
const sal_uInt8 BIFF_TOK_ATTR_IFERROR
Leading spaces and volatile formula.
const sal_uInt16 BIFF_TOK_NLR_MASK
True = NLR is relative.
const sal_uInt8 BIFF_TOK_ATTR_SPACE_VOLATILE
Spaces in formula representation.
const sal_uInt8 BIFF_TOK_NLR_SCOLV
Stacked NLR: Value in row.
const sal_uInt8 BIFF_TOKID_LE
Less than operator.
Definition: formulabase.hxx:70
const sal_uInt8 BIFF_TOK_BOOL_TRUE
FALSE value of a tBool token.
const sal_uInt8 BIFF_TOK_NLR_ERR
Table reference: Single cell.
const sal_uInt8 BIFF_TOKID_ERR
End of a sheet reference (BIFF2-BIFF4).
Definition: formulabase.hxx:88
const sal_uInt8 BIFF_TOKID_AREA3D
3D cell reference.
const sal_uInt8 BIFF_TOKID_EQ
Less than or equal operator.
Definition: formulabase.hxx:71
const sal_uInt8 BIFF_TOKID_CONCAT
Power operator.
Definition: formulabase.hxx:68
const sal_uInt8 BIFF_TOKID_PAREN
Percent sign.
Definition: formulabase.hxx:81
const sal_uInt8 BIFF_TOK_NLR_SRANGE
NLR: Range.
const sal_uInt8 BIFF_TOK_ARRAY_BOOL
String value in an array.
const sal_uInt8 OOX_MAX_PARAMCOUNT
Mask for number of appended ranges.
const sal_uInt8 BIFF_TOKID_PERCENT
Unary minus.
Definition: formulabase.hxx:80
const sal_uInt16 BIFF_TOK_REF_COLMASK
True = row is relative (BIFF12).
const sal_uInt8 BIFF_TOKID_MISSARG
Parentheses.
Definition: formulabase.hxx:82
const sal_uInt8 BIFF_TOKCLASS_VAL
20-3F: Reference class tokens.
Definition: formulabase.hxx:51
const sal_uInt8 BIFF_TOKID_MEMERR
Constant reference subexpression.
const sal_uInt16 BIFF12_TOK_TABLE_SP_SEP
Table reference: Spaces in outer brackets.
const sal_uInt8 BIFF_TOKID_REF
Defined name.
Definition: formulabase.hxx:99
const sal_uInt8 BIFF_TOKID_FUNC
Array constant.
Definition: formulabase.hxx:96
const sal_uInt16 BIFF_FUNC_OFFSET
Function identifier of the COLUMNS function.
const sal_uInt16 BIFF12_TOK_TABLE_THISROW
Table reference: Special [#Totals] range.
const sal_uInt8 BIFF_TOKID_MASK
This bit must be null for a valid token identifier.
Definition: formulabase.hxx:58
const sal_uInt8 BIFF_TOK_ARRAY_ERROR
Boolean value in an array.
const sal_uInt8 BIFF_TOK_ATTR_SPACE_BR_OPEN
Spaces before opening parenthesis.
const sal_uInt16 BIFF_FUNC_CEILING
Function identifier of the FLOOR function.
const sal_uInt16 BIFF_FUNC_FALSE
Function identifier of the TRUE function.
const sal_uInt16 BIFF_TOK_REF_ROWREL
True = column is relative.
const sal_uInt8 BIFF_TOKID_SHEET
Special attribute.
Definition: formulabase.hxx:86
const sal_uInt8 BIFF_TOK_ATTR_SPACE_SP
Start of condition in IFERROR function (BIFF12 only).
const sal_uInt16 BIFF12_TOK_TABLE_SP_BRACKETS
Table reference: Special [#This Row] range.
FunctionLibraryType
This enumeration contains constants for all known external libraries containing supported sheet funct...
@ FUNCLIB_EUROTOOL
Unknown library (must be zero).
const sal_uInt8 BIFF_TOK_NLR_SROWR
Stacked NLR: Range.
const sal_uInt16 BIFF_FUNC_IF
Maximum parameter count for BIFF2-BIFF8 files.
const sal_uInt8 BIFF_TOKID_UPLUS
Range operator.
Definition: formulabase.hxx:78
const sal_uInt8 BIFF_TOK_ATTR_SPACE_SP_OPEN
Line breaks before next token.
const sal_uInt8 BIFF_TOKID_NLR
String constant.
Definition: formulabase.hxx:84
const sal_uInt8 BIFF_TOKID_MEMAREA
2D area reference.
const sal_uInt8 BIFF_TOKID_DIV
Multiplication operator.
Definition: formulabase.hxx:66
const sal_uInt16 BIFF12_TOK_TABLE_ALL
Table reference: Range of columns.
const sal_uInt8 BIFF_TOK_ATTR_SPACE_SP_CLOSE
Line breaks before opening parenthesis.
const sal_uInt8 BIFF_TOKID_ADD
Multiple operation reference.
Definition: formulabase.hxx:63
const sal_uInt8 BIFF_TOK_NLR_COLR
NLR: Row index.
const sal_uInt8 BIFF_TOK_NLR_SROWV
Stacked NLR: Column index.
const sal_uInt8 BIFF_TOKID_NUM
Integer constant.
Definition: formulabase.hxx:91
const sal_uInt8 BIFF_TOK_ATTR_IF
Volatile function.
FuncParamValidity
Enumerates validity modes for a function parameter.
@ CalcOnly
Parameter supported by Calc and Excel.
@ ExcelOnly
Parameter supported by Calc only.
const sal_uInt16 BIFF12_TOK_TABLE_CELL
Table reference: Single row.
const sal_uInt16 BIFF_FUNC_HYPERLINK
Function identifier of the CEILING function.
const sal_uInt16 BIFF_FUNC_ROWS
Function identifier of the FALSE function.
const sal_uInt8 BIFF_TOKID_BOOL
Error constant.
Definition: formulabase.hxx:89
const sal_uInt8 BIFF_TOK_ARRAY_STRING
Double value in an array.
const sal_uInt8 BIFF_TOKID_FUNCCE
Reference subexpression (in names) without result.
const sal_uInt8 BIFF_TOK_BOOL_FALSE
Error code in an array.
const sal_uInt8 BIFF_TOKCLASS_MASK
Maximum size of a token array.
Definition: formulabase.hxx:48
const sal_uInt8 BIFF_TOKID_STR
Missing argument.
Definition: formulabase.hxx:83
const sal_uInt8 BIFF_TOKID_NONE
Definition: formulabase.hxx:60
const sal_uInt8 BIFF_TOK_FUNCVAR_COUNTMASK
User prompt for macro commands.
const sal_uInt8 BIFF_TOK_NLR_COLV
NLR: Value in row.
const sal_uInt8 BIFF_TOK_NLR_RANGEERR
Stacked NLR: Value in column.
const sal_uInt16 BIFF_TOK_FUNCVAR_CMD
Spaces before formula (BIFF3).
const sal_uInt8 BIFF_TOK_ATTR_SUM
Skip tokens.
const sal_uInt8 BIFF_TOK_NLR_RANGE
NLR: Value in column.
const sal_uInt16 BIFF12_TOK_REF_COLMASK
Mask for parameter count.
const sal_uInt8 BIFF_TOKID_POWER
Division operator.
Definition: formulabase.hxx:67
const sal_uInt16 BIFF_FUNC_WEEKNUM
Function identifier of the HYPERLINK function.
const sal_uInt8 BIFF_TOKFLAG_INVALID
60-7F: Array class tokens.
Definition: formulabase.hxx:54
const sal_uInt8 BIFF_TOKID_MEMNOMEMN
Reference subexpression (in names).
const sal_uInt16 BIFF12_TOK_TABLE_COLUMN
True = row is relative.
const sal_uInt8 BIFF_TOKID_ARRAY
Floating-point constant.
Definition: formulabase.hxx:95
const sal_uInt8 BIFF_TOKCLASS_NONE
Definition: formulabase.hxx:49
Regular
Contains all API op-codes needed to build formulas with tokens.
sal_Int32 OPCODE_PLUS_SIGN
Column separator in constant arrays.
sal_Int32 OPCODE_MISSING
Op-code for common value operands.
sal_Int32 OPCODE_GREATER_EQUAL
Compare greater operator.
sal_Int32 OPCODE_POWER
Division operator.
sal_Int32 OPCODE_NAME
Spaces between other formula tokens.
sal_Int32 OPCODE_DBAREA
Index of a defined name.
sal_Int32 OPCODE_LESS_EQUAL
Compare less operator.
sal_Int32 OPCODE_ARRAY_OPEN
Function parameter separator.
sal_Int32 OPCODE_DDE
Natural language reference.
sal_Int32 OPCODE_ARRAY_COLSEP
Row separator in constant arrays.
sal_Int32 OPCODE_SEP
Closing parenthesis.
sal_Int32 OPCODE_PERCENT
Unary minus sign.
sal_Int32 OPCODE_LESS
Compare not equal operator.
sal_Int32 OPCODE_CLOSE
Opening parenthesis.
sal_Int32 OPCODE_LIST
Range intersection operator.
sal_Int32 OPCODE_INTERSECT
Compare greater or equal operator.
sal_Int32 OPCODE_ADD
Percent sign.
sal_Int32 OPCODE_BAD
Macro function call.
sal_Int32 OPCODE_OPEN
Function style #NAME? error.
sal_Int32 OPCODE_NLR
Index of a database area.
sal_Int32 OPCODE_MACRO
DDE link function.
sal_Int32 OPCODE_SUB
Addition operator.
sal_Int32 OPCODE_RANGE
Range list operator.
sal_Int32 OPCODE_NOT_EQUAL
Compare equal operator.
sal_Int32 OPCODE_MULT
Subtraction operator.
sal_Int32 OPCODE_NONAME
Bad token (unknown name, formula error).
sal_Int32 OPCODE_ARRAY_ROWSEP
Closing brace for constant arrays.
sal_Int32 OPCODE_SPACES
Placeholder for a missing function parameter.
sal_Int32 OPCODE_ARRAY_CLOSE
Opening brace for constant arrays.
sal_Int32 OPCODE_EXTERNAL
Internal: function name unknown to mapper.
sal_Int32 OPCODE_CONCAT
Power operator.
sal_Int32 OPCODE_EQUAL
String concatenation operator.
sal_Int32 OPCODE_PUSH
External function call (e.g. add-ins).
sal_Int32 OPCODE_MINUS_SIGN
Unary plus sign.
sal_Int32 OPCODE_GREATER
Compare less or equal operator.
sal_Int32 OPCODE_DIV
Multiplication operator.
A 2D cell address struct for binary filters.
A 2D formula cell range reference struct with relative flags.
BinSingleRef2d maRef2
Start (top-left) cell address.
void readBiff12Data(SequenceInputStream &rStrm, bool bRelativeAsOffset)
End (bottom-right) cell address.
A 2D formula cell reference struct with relative flags.
BinSingleRef2d()
True = relative row reference.
Definition: formulabase.cxx:88
void setBiff12Data(sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset)
Definition: formulabase.cxx:96
bool mbRowRel
True = relative column reference.
sal_Int32 mnRow
Column index.
void readBiff12Data(SequenceInputStream &rStrm, bool bRelativeAsOffset)
Represents information for a spreadsheet function.
FunctionLibraryType meFuncLibType
Programmatic function name for external functions.
OUString maBiffMacroName
OOXML function name.
bool mbExternal
True = volatile function.
sal_uInt16 mnBiffFuncId
BIFF12 function identifier.
const FunctionParamInfo * mpParamInfos
BIFF token class of the return value.
sal_uInt8 mnRetClass
Maximum number of parameters.
bool mbParamPairs
Information about all parameters.
OUString maExtProgName
Expected macro name in EXTERN.CALL function.
sal_Int32 mnApiOpCode
The external library this function is part of.
sal_uInt8 mnMinParamCount
BIFF2-BIFF8 function identifier.
bool mbVarParam
True = macro sheet function or command.
bool mbMacroFunc
True = internal function in Calc. (Both can be true!)
sal_uInt8 mnMaxParamCount
Minimum number of parameters.
bool mbInternal
True = external function in Calc.
OUString maOoxFuncName
ODF function name.
bool mbVolatile
True = optional parameters are expected to appear in pairs.
sal_uInt16 mnBiff12FuncId
API function opcode.
Structure that contains all needed information for a parameter in a function.
FuncParamValidity meValid
unsigned char sal_uInt8
sal_uInt16 sal_Unicode