LibreOffice Module sc (master) 1
Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
oox::xls::FormulaParserImpl Class Reference
Inheritance diagram for oox::xls::FormulaParserImpl:
[legend]
Collaboration diagram for oox::xls::FormulaParserImpl:
[legend]

Public Member Functions

 FormulaParserImpl (const FormulaParser &rParent)
 
virtual ApiTokenSequence importOoxFormula (const ScAddress &rBaseAddress, const OUString &rFormulaString)
 Converts an OOXML formula string. More...
 
virtual ApiTokenSequence importBiff12Formula (const ScAddress &rBaseAddress, FormulaType eType, SequenceInputStream &rStrm)
 Imports and converts a BIFF12 token array from the passed stream. More...
 
OUString resolveOleTarget (sal_Int32 nRefId, bool bUseRefSheets) const
 Tries to resolve the passed ref-id to an OLE target URL. More...
 
- Public Member Functions inherited from oox::xls::FormulaFinalizer
 FormulaFinalizer (const OpCodeProvider &rOpCodeProv)
 
ApiTokenSequence finalizeTokenArray (const ApiTokenSequence &rTokens)
 Finalizes and returns the passed token array. More...
 
- Public Member Functions inherited from oox::xls::OpCodeProvider
 OpCodeProvider (const css::uno::Reference< css::lang::XMultiServiceFactory > &rxModelFactory, bool bImportFilter)
 
virtual ~OpCodeProvider () override
 
 OpCodeProvider (OpCodeProvider const &)=default
 
 OpCodeProvider (OpCodeProvider &&)=default
 
OpCodeProvideroperator= (OpCodeProvider const &)=delete
 
OpCodeProvideroperator= (OpCodeProvider &&)=delete
 
const ApiOpCodesgetOpCodes () const
 Returns the structure containing all token op-codes for operators and special tokens used by the Calc document and its formula parser. More...
 
const FunctionInfogetFuncInfoFromApiToken (const ApiToken &rToken) const
 Returns the function info for an API token, or 0 on error. More...
 
css::uno::Sequence< css::sheet::FormulaOpCodeMapEntry > getOoxParserMap () const
 Returns the op-code map that is used by the OOXML formula parser. More...
 
- Public Member Functions inherited from oox::xls::FunctionProvider
 FunctionProvider (bool bImportFilter)
 
virtual ~FunctionProvider ()
 
 FunctionProvider (FunctionProvider const &)=default
 
 FunctionProvider (FunctionProvider &&)=default
 
FunctionProvideroperator= (FunctionProvider const &)=delete
 
FunctionProvideroperator= (FunctionProvider &&)=delete
 
const FunctionInfogetFuncInfoFromOoxFuncName (const OUString &rFuncName) const
 Returns the function info for an OOXML function name, or 0 on error. More...
 
const FunctionInfogetFuncInfoFromBiff12FuncId (sal_uInt16 nFuncId) const
 Returns the function info for a BIFF12 function index, or 0 on error. More...
 
const FunctionInfogetFuncInfoFromMacroName (const OUString &rFuncName) const
 Returns the function info for a macro function referred by the EXTERN.CALL function, or 0 on error. More...
 
- Public Member Functions inherited from oox::xls::WorkbookHelper
 WorkbookHelper (WorkbookGlobals &rBookGlob)
 
virtual ~WorkbookHelper ()
 
 WorkbookHelper (WorkbookHelper const &)=default
 
 WorkbookHelper (WorkbookHelper &&)=default
 
WorkbookHelperoperator= (WorkbookHelper const &)=delete
 
WorkbookHelperoperator= (WorkbookHelper &&)=delete
 
::oox::core::FilterBasegetBaseFilter () const
 Returns the base filter object (base class of all filters). More...
 
SegmentProgressBargetProgressBar () const
 Returns the filter progress bar. More...
 
sal_Int16 getCurrentSheetIndex () const
 Returns the index of the current Calc sheet, if filter currently processes a sheet. More...
 
bool isGeneratorKnownGood () const
 Returns true when reading a file generated by a known good generator. More...
 
bool hasCalculatedFormulaCells () const
 Returns true if any formula cell is calculated. More...
 
void setCalculatedFormulaCells ()
 Set if any formula cell is calculated. More...
 
void setVbaProjectStorage (const StorageRef &rxVbaPrjStrg)
 Sets the VBA project storage used to import VBA source code and forms. More...
 
void setCurrentSheetIndex (SCTAB nSheet)
 Sets the index of the current Calc sheet, if filter currently processes a sheet. More...
 
void finalizeWorkbookImport ()
 Final conversion after importing the workbook. More...
 
void useInternalChartDataTable (bool bInternal)
 
ScDocumentgetScDocument ()
 
const ScDocumentgetScDocument () const
 
ScDocumentImportgetDocImport ()
 
const ScDocumentImportgetDocImport () const
 
ScEditEngineDefaultergetEditEngine () const
 
const css::uno::Reference< css::sheet::XSpreadsheetDocument > & getDocument () const
 Returns a reference to the source/target spreadsheet document model. More...
 
css::uno::Reference< css::sheet::XSpreadsheet > getSheetFromDoc (sal_Int32 nSheet) const
 Returns a reference to the specified spreadsheet in the document model. More...
 
css::uno::Reference< css::sheet::XSpreadsheet > getSheetFromDoc (const OUString &rSheet) const
 Returns a reference to the specified spreadsheet in the document model. More...
 
css::uno::Reference< css::table::XCellRange > getCellRangeFromDoc (const ScRange &rRange) const
 Returns the XCellRange interface for the passed cell range address. More...
 
css::uno::Reference< css::container::XNameContainer > getCellStyleFamily () const
 Returns the cell styles container from the Calc document. More...
 
css::uno::Reference< css::style::XStyle > getStyleObject (const OUString &rStyleName, bool bPageStyle) const
 Returns the specified cell or page style from the Calc document. More...
 
RangeDataRet createNamedRangeObject (OUString &orName, sal_Int32 nIndex, sal_Int32 nNameFlags, bool bHidden) const
 Creates and returns a defined name on-the-fly in the Calc document. More...
 
RangeDataRet createLocalNamedRangeObject (OUString &orName, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab, bool bHidden) const
 Creates and returns a defined name on-the-fly in the sheet. More...
 
css::uno::Reference< css::sheet::XDatabaseRange > createDatabaseRangeObject (OUString &orName, const ScRange &rRangeAddr) const
 Creates and returns a database range on-the-fly in the Calc document. More...
 
css::uno::Reference< css::sheet::XDatabaseRange > createUnnamedDatabaseRangeObject (const ScRange &rRangeAddr) const
 Creates and returns an unnamed database range on-the-fly in the Calc document. More...
 
ScDBDatafindDatabaseRangeByIndex (sal_uInt16 nIndex) const
 Finds the (already existing) database range of the given formula token index. More...
 
css::uno::Reference< css::style::XStyle > createStyleObject (OUString &orStyleName, bool bPageStyle) const
 Creates and returns a com.sun.star.style.Style object for cells or pages. More...
 
FormulaBuffergetFormulaBuffer () const
 
WorkbookSettingsgetWorkbookSettings () const
 Returns the global workbook settings object. More...
 
ViewSettingsgetViewSettings () const
 Returns the workbook and sheet view settings object. More...
 
WorksheetBuffergetWorksheets () const
 Returns the worksheet buffer containing sheet names and properties. More...
 
ThemeBuffergetTheme () const
 Returns the office theme object read from the theme substorage. More...
 
StylesBuffergetStyles () const
 Returns all cell formatting objects read from the styles substream. More...
 
SharedStringsBuffergetSharedStrings () const
 Returns the shared strings read from the shared strings substream. More...
 
ExternalLinkBuffergetExternalLinks () const
 Returns the external links read from the external links substream. More...
 
DefinedNamesBuffergetDefinedNames () const
 Returns the defined names read from the workbook globals. More...
 
TableBuffergetTables () const
 Returns the tables collection (equivalent to Calc's database ranges). More...
 
ScenarioBuffergetScenarios () const
 Returns the scenarios collection. More...
 
ConnectionsBuffergetConnections () const
 Returns the collection of external data connections. More...
 
PivotCacheBuffergetPivotCaches () const
 Returns the collection of pivot caches. More...
 
PivotTableBuffergetPivotTables () const
 Returns the collection of pivot tables. More...
 
FormulaParsergetFormulaParser () const
 Returns a shared import formula parser (import filter only!). More...
 
FormulaParsercreateFormulaParser () const
 Returns an unshared import formula parser (import filter only!). More...
 
UnitConvertergetUnitConverter () const
 Returns the measurement unit converter. More...
 
AddressConvertergetAddressConverter () const
 Returns the converter for string to cell address/range conversion. More...
 
oox::drawingml::chart::ChartConvertergetChartConverter () const
 Returns the chart object converter. More...
 
PageSettingsConvertergetPageSettingsConverter () const
 Returns the page and print settings converter. More...
 
::oox::core::XmlFilterBasegetOoxFilter () const
 Returns the base OOXML/BIFF12 filter object. More...
 
bool importOoxFragment (const rtl::Reference< oox::core::FragmentHandler > &rxHandler)
 Imports a fragment using the passed fragment handler, which contains the full path to the fragment stream. More...
 
bool importOoxFragment (const rtl::Reference< oox::core::FragmentHandler > &rxHandler, oox::core::FastParser &rParser)
 
rtl_TextEncoding getTextEncoding () const
 Returns the text encoding used to import/export byte strings. More...
 

Protected Types

typedef ::std::pair< sal_Int32, bool > WhiteSpace
 
typedef ::std::vector< WhiteSpaceWhiteSpaceVec
 

Protected Member Functions

void initializeImport (const ScAddress &rBaseAddress, FormulaType eType)
 Initializes the formula parser before importing a formula. More...
 
ApiTokenSequence finalizeImport ()
 Finalizes the internal token storage after import. More...
 
bool resetSpaces ()
 
void appendLeadingSpaces (sal_Int32 nCount, bool bLineFeed)
 
void appendOpeningSpaces (sal_Int32 nCount, bool bLineFeed)
 
void appendClosingSpaces (sal_Int32 nCount, bool bLineFeed)
 
size_t getFormulaSize () const
 
Any & appendRawToken (sal_Int32 nOpCode)
 
Any & insertRawToken (sal_Int32 nOpCode, size_t nIndexFromEnd)
 
size_t appendWhiteSpaceTokens (const WhiteSpaceVec *pSpaces)
 
size_t insertWhiteSpaceTokens (const WhiteSpaceVec *pSpaces, size_t nIndexFromEnd)
 
size_t getOperandSize (size_t nOpIndex) const
 
void pushOperandSize (size_t nSize)
 
size_t popOperandSize ()
 
ApiTokengetOperandToken (size_t nOpIndex, size_t nTokenIndex)
 
bool pushOperandToken (sal_Int32 nOpCode, const WhiteSpaceVec *pSpaces=nullptr)
 
template<typename Type >
bool pushValueOperandToken (const Type &rValue, sal_Int32 nOpCode, const WhiteSpaceVec *pSpaces=nullptr)
 
template<typename Type >
bool pushValueOperandToken (const Type &rValue)
 
bool pushParenthesesOperandToken (const WhiteSpaceVec *pClosingSpaces=nullptr)
 
bool pushUnaryPreOperatorToken (sal_Int32 nOpCode, const WhiteSpaceVec *pSpaces=nullptr)
 
bool pushUnaryPostOperatorToken (sal_Int32 nOpCode, const WhiteSpaceVec *pSpaces=nullptr)
 
bool pushBinaryOperatorToken (sal_Int32 nOpCode, const WhiteSpaceVec *pSpaces=nullptr)
 
bool pushParenthesesOperatorToken (const WhiteSpaceVec *pOpeningSpaces=nullptr, const WhiteSpaceVec *pClosingSpaces=nullptr)
 
bool pushFunctionOperatorToken (sal_Int32 nOpCode, size_t nParamCount, const WhiteSpaceVec *pLeadingSpaces=nullptr, const WhiteSpaceVec *pClosingSpaces=nullptr)
 
bool pushFunctionOperatorToken (const FunctionInfo &rFuncInfo, size_t nParamCount, const WhiteSpaceVec *pLeadingSpaces=nullptr, const WhiteSpaceVec *pClosingSpaces=nullptr)
 
bool pushOperand (sal_Int32 nOpCode)
 
template<typename Type >
bool pushValueOperand (const Type &rValue, sal_Int32 nOpCode)
 
template<typename Type >
bool pushValueOperand (const Type &rValue)
 
bool pushBoolOperand (bool bValue)
 
bool pushErrorOperand (double fEncodedError)
 
bool pushBiffBoolOperand (sal_uInt8 nValue)
 
bool pushBiffErrorOperand (sal_uInt8 nErrorCode)
 
bool pushReferenceOperand (const BinSingleRef2d &rRef, bool bDeleted, bool bRelativeAsOffset)
 
bool pushReferenceOperand (const BinComplexRef2d &rRef, bool bDeleted, bool bRelativeAsOffset)
 
template<typename Type >
bool pushReferenceOperand (const LinkSheetRange &rSheetRange, const Type &rApiRef)
 
bool pushReferenceOperand (const LinkSheetRange &rSheetRange, const BinSingleRef2d &rRef, bool bDeleted, bool bRelativeAsOffset)
 
bool pushReferenceOperand (const LinkSheetRange &rSheetRange, const BinComplexRef2d &rRef, bool bDeleted, bool bRelativeAsOffset)
 
bool pushEmbeddedRefOperand (const DefinedNameBase &rName, bool bPushBadToken)
 
bool pushDefinedNameOperand (const DefinedNameRef &rxDefName)
 
bool pushExternalFuncOperand (const FunctionInfo &rFuncInfo)
 
bool pushDdeLinkOperand (const OUString &rDdeServer, const OUString &rDdeTopic, const OUString &rDdeItem)
 
bool pushExternalNameOperand (const ExternalNameRef &rxExtName, const ExternalLink &rExtLink)
 
bool pushSpecialTokenOperand (const BinAddress &rBaseAddr)
 
bool pushUnaryPreOperator (sal_Int32 nOpCode)
 
bool pushUnaryPostOperator (sal_Int32 nOpCode)
 
bool pushBinaryOperator (sal_Int32 nOpCode)
 
bool pushParenthesesOperator ()
 
bool pushFunctionOperator (sal_Int32 nOpCode, size_t nParamCount)
 
bool pushFunctionOperator (const FunctionInfo &rFuncInfo, size_t nParamCount)
 
virtual const FunctionInforesolveBadFuncName (const OUString &rTokenData) const
 Derived classed may try to find a function info struct from the passed string extracted from an OPCODE_BAD token. More...
 
virtual OUString resolveDefinedName (sal_Int32 nTokenIndex) const
 Derived classed may try to find the name of a defined name with the passed index extracted from an OPCODE_NAME token. More...
 
- Protected Member Functions inherited from oox::xls::FunctionProvider
const FunctionInfoVectorgetFuncs () const
 Returns the list of all function infos. More...
 

Static Protected Member Functions

static void appendSpaces (WhiteSpaceVec &orSpaces, sal_Int32 nCount, bool bLineFeed)
 

Protected Attributes

const sal_Int32 mnMaxApiCol
 
const sal_Int32 mnMaxApiRow
 Maximum column index in own document. More...
 
const sal_Int32 mnMaxXlsCol
 Maximum row index in own document. More...
 
const sal_Int32 mnMaxXlsRow
 Maximum column index in imported document. More...
 
ScAddress maBaseAddr
 Maximum row index in imported document. More...
 
bool mbRelativeAsOffset
 Base address for relative references. More...
 
bool mb2dRefsAs3dRefs
 True = relative row/column index is (signed) offset, false = explicit index. More...
 
bool mbSpecialTokens
 True = convert all 2D references to 3D references in sheet specified by base address. More...
 
- Protected Attributes inherited from oox::xls::ApiOpCodes
sal_Int32 OPCODE_UNKNOWN
 
sal_Int32 OPCODE_EXTERNAL
 Internal: function name unknown to mapper. More...
 
sal_Int32 OPCODE_PUSH
 External function call (e.g. add-ins). More...
 
sal_Int32 OPCODE_MISSING
 Op-code for common value operands. More...
 
sal_Int32 OPCODE_SPACES
 Placeholder for a missing function parameter. More...
 
sal_Int32 OPCODE_NAME
 Spaces between other formula tokens. More...
 
sal_Int32 OPCODE_DBAREA
 Index of a defined name. More...
 
sal_Int32 OPCODE_NLR
 Index of a database area. More...
 
sal_Int32 OPCODE_DDE
 Natural language reference. More...
 
sal_Int32 OPCODE_MACRO
 DDE link function. More...
 
sal_Int32 OPCODE_BAD
 Macro function call. More...
 
sal_Int32 OPCODE_NONAME
 Bad token (unknown name, formula error). More...
 
sal_Int32 OPCODE_OPEN
 Function style #NAME? error. More...
 
sal_Int32 OPCODE_CLOSE
 Opening parenthesis. More...
 
sal_Int32 OPCODE_SEP
 Closing parenthesis. More...
 
sal_Int32 OPCODE_ARRAY_OPEN
 Function parameter separator. More...
 
sal_Int32 OPCODE_ARRAY_CLOSE
 Opening brace for constant arrays. More...
 
sal_Int32 OPCODE_ARRAY_ROWSEP
 Closing brace for constant arrays. More...
 
sal_Int32 OPCODE_ARRAY_COLSEP
 Row separator in constant arrays. More...
 
sal_Int32 OPCODE_PLUS_SIGN
 Column separator in constant arrays. More...
 
sal_Int32 OPCODE_MINUS_SIGN
 Unary plus sign. More...
 
sal_Int32 OPCODE_PERCENT
 Unary minus sign. More...
 
sal_Int32 OPCODE_ADD
 Percent sign. More...
 
sal_Int32 OPCODE_SUB
 Addition operator. More...
 
sal_Int32 OPCODE_MULT
 Subtraction operator. More...
 
sal_Int32 OPCODE_DIV
 Multiplication operator. More...
 
sal_Int32 OPCODE_POWER
 Division operator. More...
 
sal_Int32 OPCODE_CONCAT
 Power operator. More...
 
sal_Int32 OPCODE_EQUAL
 String concatenation operator. More...
 
sal_Int32 OPCODE_NOT_EQUAL
 Compare equal operator. More...
 
sal_Int32 OPCODE_LESS
 Compare not equal operator. More...
 
sal_Int32 OPCODE_LESS_EQUAL
 Compare less operator. More...
 
sal_Int32 OPCODE_GREATER
 Compare less or equal operator. More...
 
sal_Int32 OPCODE_GREATER_EQUAL
 Compare greater operator. More...
 
sal_Int32 OPCODE_INTERSECT
 Compare greater or equal operator. More...
 
sal_Int32 OPCODE_LIST
 Range intersection operator. More...
 
sal_Int32 OPCODE_RANGE
 Range list operator. More...
 

Private Member Functions

void initReference2d (SingleReference &orApiRef) const
 
void convertReference (SingleReference &orApiRef, const BinSingleRef2d &rRef, bool bDeleted, bool bRelativeAsOffset) const
 
void convertReference (ComplexReference &orApiRef, const BinSingleRef2d &rRef1, const BinSingleRef2d &rRef2, bool bDeleted, bool bRelativeAsOffset) const
 
void convertReference2d (SingleReference &orApiRef, const BinSingleRef2d &rRef, bool bDeleted, bool bRelativeAsOffset) const
 
void convertReference2d (ComplexReference &orApiRef, const BinSingleRef2d &rRef1, const BinSingleRef2d &rRef2, bool bDeleted, bool bRelativeAsOffset) const
 
void convertReference3d (SingleReference &orApiRef, sal_Int32 nSheet, bool bSameSheet, const BinSingleRef2d &rRef, bool bDeleted, bool bRelativeAsOffset) const
 
void convertReference3d (ComplexReference &orApiRef, const LinkSheetRange &rSheetRange, const BinSingleRef2d &rRef1, const BinSingleRef2d &rRef2, bool bDeleted, bool bRelativeAsOffset) const
 
virtual const FunctionInforesolveBadFuncName (const OUString &rTokenData) const override
 Derived classed may try to find a function info struct from the passed string extracted from an OPCODE_BAD token. More...
 
virtual OUString resolveDefinedName (sal_Int32 nTokenIndex) const override
 Derived classed may try to find the name of a defined name with the passed index extracted from an OPCODE_NAME token. More...
 

Static Private Member Functions

static void initReference3d (SingleReference &orApiRef, sal_Int32 nSheet, bool bSameSheet)
 

Private Attributes

ApiTokenVector maTokenStorage
 True = special handling for tExp and tTbl tokens, false = exit with error. More...
 
std::vector< size_t > maTokenIndexes
 Raw unordered token storage. More...
 
std::vector< size_t > maOperandSizeStack
 Indexes into maTokenStorage. More...
 
WhiteSpaceVec maLeadingSpaces
 Stack with token sizes per operand. More...
 
WhiteSpaceVec maOpeningSpaces
 List of whitespaces before next token. More...
 
WhiteSpaceVec maClosingSpaces
 List of whitespaces before opening parenthesis. More...
 

Additional Inherited Members

- Public Types inherited from oox::xls::WorkbookHelper
typedef std::pair< ScRangeData *, bool > RangeDataRet
 
- Static Public Member Functions inherited from oox::xls::FunctionProvider
static FunctionLibraryType getFuncLibTypeFromLibraryName (std::u16string_view rLibraryName)
 Returns the library type associated with the passed URL of a function library (function add-in). More...
 
- Static Public Member Functions inherited from oox::xls::WorkbookHelper
static WorkbookGlobalsRef constructGlobals (ExcelFilter &rFilter)
 

Detailed Description

Definition at line 418 of file formulaparser.cxx.

Member Typedef Documentation

◆ WhiteSpace

typedef ::std::pair< sal_Int32, bool > oox::xls::FormulaParserImpl::WhiteSpace
protected

Definition at line 438 of file formulaparser.cxx.

◆ WhiteSpaceVec

typedef ::std::vector< WhiteSpace > oox::xls::FormulaParserImpl::WhiteSpaceVec
protected

Definition at line 439 of file formulaparser.cxx.

Constructor & Destructor Documentation

◆ FormulaParserImpl()

oox::xls::FormulaParserImpl::FormulaParserImpl ( const FormulaParser rParent)
explicit

Member Function Documentation

◆ appendClosingSpaces()

void oox::xls::FormulaParserImpl::appendClosingSpaces ( sal_Int32  nCount,
bool  bLineFeed 
)
protected

Definition at line 658 of file formulaparser.cxx.

References appendSpaces(), maClosingSpaces, and nCount.

◆ appendLeadingSpaces()

void oox::xls::FormulaParserImpl::appendLeadingSpaces ( sal_Int32  nCount,
bool  bLineFeed 
)
protected

Definition at line 648 of file formulaparser.cxx.

References appendSpaces(), maLeadingSpaces, and nCount.

◆ appendOpeningSpaces()

void oox::xls::FormulaParserImpl::appendOpeningSpaces ( sal_Int32  nCount,
bool  bLineFeed 
)
protected

Definition at line 653 of file formulaparser.cxx.

References appendSpaces(), maOpeningSpaces, and nCount.

◆ appendRawToken()

Any & oox::xls::FormulaParserImpl::appendRawToken ( sal_Int32  nOpCode)
protected

◆ appendSpaces()

void oox::xls::FormulaParserImpl::appendSpaces ( WhiteSpaceVec orSpaces,
sal_Int32  nCount,
bool  bLineFeed 
)
staticprotected

Definition at line 641 of file formulaparser.cxx.

References nCount.

Referenced by appendClosingSpaces(), appendLeadingSpaces(), and appendOpeningSpaces().

◆ appendWhiteSpaceTokens()

size_t oox::xls::FormulaParserImpl::appendWhiteSpaceTokens ( const WhiteSpaceVec pSpaces)
protected

◆ convertReference() [1/2]

void oox::xls::FormulaParserImpl::convertReference ( ComplexReference &  orApiRef,
const BinSingleRef2d rRef1,
const BinSingleRef2d rRef2,
bool  bDeleted,
bool  bRelativeAsOffset 
) const
private

◆ convertReference() [2/2]

void oox::xls::FormulaParserImpl::convertReference ( SingleReference &  orApiRef,
const BinSingleRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
) const
private

◆ convertReference2d() [1/2]

void oox::xls::FormulaParserImpl::convertReference2d ( ComplexReference &  orApiRef,
const BinSingleRef2d rRef1,
const BinSingleRef2d rRef2,
bool  bDeleted,
bool  bRelativeAsOffset 
) const
private

Definition at line 1112 of file formulaparser.cxx.

References convertReference(), initReference2d(), and oox::setFlag().

◆ convertReference2d() [2/2]

void oox::xls::FormulaParserImpl::convertReference2d ( SingleReference &  orApiRef,
const BinSingleRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
) const
private

Definition at line 1106 of file formulaparser.cxx.

References convertReference(), and initReference2d().

Referenced by pushReferenceOperand().

◆ convertReference3d() [1/2]

void oox::xls::FormulaParserImpl::convertReference3d ( ComplexReference &  orApiRef,
const LinkSheetRange rSheetRange,
const BinSingleRef2d rRef1,
const BinSingleRef2d rRef2,
bool  bDeleted,
bool  bRelativeAsOffset 
) const
private

◆ convertReference3d() [2/2]

void oox::xls::FormulaParserImpl::convertReference3d ( SingleReference &  orApiRef,
sal_Int32  nSheet,
bool  bSameSheet,
const BinSingleRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
) const
private

Definition at line 1121 of file formulaparser.cxx.

References convertReference(), and initReference3d().

Referenced by pushReferenceOperand().

◆ finalizeImport()

ApiTokenSequence oox::xls::FormulaParserImpl::finalizeImport ( )
protected

Finalizes the internal token storage after import.

Definition at line 616 of file formulaparser.cxx.

References oox::xls::FormulaFinalizer::finalizeTokenArray(), maTokenIndexes, and maTokenStorage.

◆ getFormulaSize()

size_t oox::xls::FormulaParserImpl::getFormulaSize ( ) const
protected

Definition at line 663 of file formulaparser.cxx.

References maTokenIndexes.

Referenced by pushSpecialTokenOperand().

◆ getOperandSize()

size_t oox::xls::FormulaParserImpl::getOperandSize ( size_t  nOpIndex) const
protected

Definition at line 696 of file formulaparser.cxx.

References maOperandSizeStack.

Referenced by getOperandToken().

◆ getOperandToken()

ApiToken & oox::xls::FormulaParserImpl::getOperandToken ( size_t  nOpIndex,
size_t  nTokenIndex 
)
protected

◆ importBiff12Formula()

ApiTokenSequence oox::xls::FormulaParserImpl::importBiff12Formula ( const ScAddress rBaseAddress,
FormulaType  eType,
SequenceInputStream rStrm 
)
virtual

Imports and converts a BIFF12 token array from the passed stream.

Definition at line 574 of file formulaparser.cxx.

References SAL_WARN.

◆ importOoxFormula()

ApiTokenSequence oox::xls::FormulaParserImpl::importOoxFormula ( const ScAddress rBaseAddress,
const OUString &  rFormulaString 
)
virtual

Converts an OOXML formula string.

Definition at line 568 of file formulaparser.cxx.

◆ initializeImport()

void oox::xls::FormulaParserImpl::initializeImport ( const ScAddress rBaseAddress,
FormulaType  eType 
)
protected

◆ initReference2d()

void oox::xls::FormulaParserImpl::initReference2d ( SingleReference &  orApiRef) const
private

Definition at line 1032 of file formulaparser.cxx.

References initReference3d(), maBaseAddr, mb2dRefsAs3dRefs, and ScAddress::Tab().

Referenced by convertReference2d().

◆ initReference3d()

void oox::xls::FormulaParserImpl::initReference3d ( SingleReference &  orApiRef,
sal_Int32  nSheet,
bool  bSameSheet 
)
staticprivate

Definition at line 1047 of file formulaparser.cxx.

Referenced by convertReference3d(), and initReference2d().

◆ insertRawToken()

Any & oox::xls::FormulaParserImpl::insertRawToken ( sal_Int32  nOpCode,
size_t  nIndexFromEnd 
)
protected

◆ insertWhiteSpaceTokens()

size_t oox::xls::FormulaParserImpl::insertWhiteSpaceTokens ( const WhiteSpaceVec pSpaces,
size_t  nIndexFromEnd 
)
protected

◆ popOperandSize()

size_t oox::xls::FormulaParserImpl::popOperandSize ( )
protected

◆ pushBiffBoolOperand()

bool oox::xls::FormulaParserImpl::pushBiffBoolOperand ( sal_uInt8  nValue)
protected

Definition at line 873 of file formulaparser.cxx.

References oox::xls::BIFF_TOK_BOOL_FALSE, nValue, and pushBoolOperand().

◆ pushBiffErrorOperand()

bool oox::xls::FormulaParserImpl::pushBiffErrorOperand ( sal_uInt8  nErrorCode)
protected

◆ pushBinaryOperator()

bool oox::xls::FormulaParserImpl::pushBinaryOperator ( sal_Int32  nOpCode)
protected

Definition at line 1010 of file formulaparser.cxx.

References maLeadingSpaces, pushBinaryOperatorToken(), and resetSpaces().

◆ pushBinaryOperatorToken()

bool oox::xls::FormulaParserImpl::pushBinaryOperatorToken ( sal_Int32  nOpCode,
const WhiteSpaceVec pSpaces = nullptr 
)
protected

◆ pushBoolOperand()

bool oox::xls::FormulaParserImpl::pushBoolOperand ( bool  bValue)
protected

◆ pushDdeLinkOperand()

bool oox::xls::FormulaParserImpl::pushDdeLinkOperand ( const OUString &  rDdeServer,
const OUString &  rDdeTopic,
const OUString &  rDdeItem 
)
protected

◆ pushDefinedNameOperand()

bool oox::xls::FormulaParserImpl::pushDefinedNameOperand ( const DefinedNameRef rxDefName)
protected

◆ pushEmbeddedRefOperand()

bool oox::xls::FormulaParserImpl::pushEmbeddedRefOperand ( const DefinedNameBase rName,
bool  bPushBadToken 
)
protected

◆ pushErrorOperand()

bool oox::xls::FormulaParserImpl::pushErrorOperand ( double  fEncodedError)
protected

◆ pushExternalFuncOperand()

bool oox::xls::FormulaParserImpl::pushExternalFuncOperand ( const FunctionInfo rFuncInfo)
protected

◆ pushExternalNameOperand()

bool oox::xls::FormulaParserImpl::pushExternalNameOperand ( const ExternalNameRef rxExtName,
const ExternalLink rExtLink 
)
protected

◆ pushFunctionOperator() [1/2]

bool oox::xls::FormulaParserImpl::pushFunctionOperator ( const FunctionInfo rFuncInfo,
size_t  nParamCount 
)
protected

◆ pushFunctionOperator() [2/2]

bool oox::xls::FormulaParserImpl::pushFunctionOperator ( sal_Int32  nOpCode,
size_t  nParamCount 
)
protected

◆ pushFunctionOperatorToken() [1/2]

bool oox::xls::FormulaParserImpl::pushFunctionOperatorToken ( const FunctionInfo rFuncInfo,
size_t  nParamCount,
const WhiteSpaceVec pLeadingSpaces = nullptr,
const WhiteSpaceVec pClosingSpaces = nullptr 
)
protected

◆ pushFunctionOperatorToken() [2/2]

bool oox::xls::FormulaParserImpl::pushFunctionOperatorToken ( sal_Int32  nOpCode,
size_t  nParamCount,
const WhiteSpaceVec pLeadingSpaces = nullptr,
const WhiteSpaceVec pClosingSpaces = nullptr 
)
protected

◆ pushOperand()

bool oox::xls::FormulaParserImpl::pushOperand ( sal_Int32  nOpCode)
protected

Definition at line 840 of file formulaparser.cxx.

References maLeadingSpaces, pushOperandToken(), and resetSpaces().

Referenced by pushErrorOperand(), and pushExternalFuncOperand().

◆ pushOperandSize()

void oox::xls::FormulaParserImpl::pushOperandSize ( size_t  nSize)
protected

◆ pushOperandToken()

bool oox::xls::FormulaParserImpl::pushOperandToken ( sal_Int32  nOpCode,
const WhiteSpaceVec pSpaces = nullptr 
)
protected

Definition at line 726 of file formulaparser.cxx.

References appendRawToken(), appendWhiteSpaceTokens(), and pushOperandSize().

Referenced by pushOperand().

◆ pushParenthesesOperandToken()

bool oox::xls::FormulaParserImpl::pushParenthesesOperandToken ( const WhiteSpaceVec pClosingSpaces = nullptr)
protected

◆ pushParenthesesOperator()

bool oox::xls::FormulaParserImpl::pushParenthesesOperator ( )
protected

◆ pushParenthesesOperatorToken()

bool oox::xls::FormulaParserImpl::pushParenthesesOperatorToken ( const WhiteSpaceVec pOpeningSpaces = nullptr,
const WhiteSpaceVec pClosingSpaces = nullptr 
)
protected

◆ pushReferenceOperand() [1/5]

bool oox::xls::FormulaParserImpl::pushReferenceOperand ( const BinComplexRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
)
protected

◆ pushReferenceOperand() [2/5]

bool oox::xls::FormulaParserImpl::pushReferenceOperand ( const BinSingleRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
)
protected

Definition at line 883 of file formulaparser.cxx.

References convertReference2d(), and pushValueOperand().

Referenced by pushReferenceOperand().

◆ pushReferenceOperand() [3/5]

bool oox::xls::FormulaParserImpl::pushReferenceOperand ( const LinkSheetRange rSheetRange,
const BinComplexRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
)
protected

◆ pushReferenceOperand() [4/5]

bool oox::xls::FormulaParserImpl::pushReferenceOperand ( const LinkSheetRange rSheetRange,
const BinSingleRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
)
protected

◆ pushReferenceOperand() [5/5]

template<typename Type >
bool oox::xls::FormulaParserImpl::pushReferenceOperand ( const LinkSheetRange rSheetRange,
const Type rApiRef 
)
protected

◆ pushSpecialTokenOperand()

bool oox::xls::FormulaParserImpl::pushSpecialTokenOperand ( const BinAddress rBaseAddr)
protected

◆ pushUnaryPostOperator()

bool oox::xls::FormulaParserImpl::pushUnaryPostOperator ( sal_Int32  nOpCode)
protected

Definition at line 1005 of file formulaparser.cxx.

References maLeadingSpaces, pushUnaryPostOperatorToken(), and resetSpaces().

◆ pushUnaryPostOperatorToken()

bool oox::xls::FormulaParserImpl::pushUnaryPostOperatorToken ( sal_Int32  nOpCode,
const WhiteSpaceVec pSpaces = nullptr 
)
protected

◆ pushUnaryPreOperator()

bool oox::xls::FormulaParserImpl::pushUnaryPreOperator ( sal_Int32  nOpCode)
protected

Definition at line 1000 of file formulaparser.cxx.

References maLeadingSpaces, pushUnaryPreOperatorToken(), and resetSpaces().

◆ pushUnaryPreOperatorToken()

bool oox::xls::FormulaParserImpl::pushUnaryPreOperatorToken ( sal_Int32  nOpCode,
const WhiteSpaceVec pSpaces = nullptr 
)
protected

◆ pushValueOperand() [1/2]

template<typename Type >
bool oox::xls::FormulaParserImpl::pushValueOperand ( const Type rValue)
inlineprotected

Definition at line 484 of file formulaparser.cxx.

References oox::xls::ApiOpCodes::OPCODE_PUSH, and pushValueOperand().

◆ pushValueOperand() [2/2]

template<typename Type >
bool oox::xls::FormulaParserImpl::pushValueOperand ( const Type rValue,
sal_Int32  nOpCode 
)
protected

◆ pushValueOperandToken() [1/2]

template<typename Type >
bool oox::xls::FormulaParserImpl::pushValueOperandToken ( const Type rValue)
inlineprotected

◆ pushValueOperandToken() [2/2]

template<typename Type >
bool oox::xls::FormulaParserImpl::pushValueOperandToken ( const Type rValue,
sal_Int32  nOpCode,
const WhiteSpaceVec pSpaces = nullptr 
)
protected

◆ resetSpaces()

bool oox::xls::FormulaParserImpl::resetSpaces ( )
protected

◆ resolveBadFuncName()

const FunctionInfo * oox::xls::FormulaParserImpl::resolveBadFuncName ( const OUString &  rTokenData) const
overrideprivatevirtual

Derived classed may try to find a function info struct from the passed string extracted from an OPCODE_BAD token.

Parameters
rTokenDataThe string that has been found in an OPCODE_BAD token preceding the function parentheses.

Reimplemented from oox::xls::FormulaFinalizer.

Definition at line 1139 of file formulaparser.cxx.

References oox::xls::FUNCLIB_UNKNOWN, oox::xls::ExternalLinkBuffer::getExternalLink(), oox::xls::WorkbookHelper::getExternalLinks(), oox::xls::FunctionProvider::getFuncInfoFromOoxFuncName(), oox::xls::ExternalLink::getFuncLibraryType(), oox::xls::ExternalLink::getLinkType(), oox::xls::Library, and o3tl::toInt32().

◆ resolveDefinedName()

OUString oox::xls::FormulaParserImpl::resolveDefinedName ( sal_Int32  nTokenIndex) const
overrideprivatevirtual

Derived classed may try to find the name of a defined name with the passed index extracted from an OPCODE_NAME token.

Parameters
nTokenIndexThe index of the defined name that has been found in an OPCODE_NAME token preceding the function parentheses.

Reimplemented from oox::xls::FormulaFinalizer.

Definition at line 1162 of file formulaparser.cxx.

References get(), and oox::xls::WorkbookHelper::getDefinedNames().

◆ resolveOleTarget()

OUString oox::xls::FormulaParserImpl::resolveOleTarget ( sal_Int32  nRefId,
bool  bUseRefSheets 
) const

Member Data Documentation

◆ maBaseAddr

ScAddress oox::xls::FormulaParserImpl::maBaseAddr
protected

Maximum row index in imported document.

Definition at line 534 of file formulaparser.cxx.

Referenced by convertReference(), initializeImport(), initReference2d(), and pushSpecialTokenOperand().

◆ maClosingSpaces

WhiteSpaceVec oox::xls::FormulaParserImpl::maClosingSpaces
private

List of whitespaces before opening parenthesis.

Definition at line 545 of file formulaparser.cxx.

Referenced by appendClosingSpaces(), FormulaParserImpl(), pushFunctionOperator(), pushParenthesesOperator(), and resetSpaces().

◆ maLeadingSpaces

WhiteSpaceVec oox::xls::FormulaParserImpl::maLeadingSpaces
private

◆ maOpeningSpaces

WhiteSpaceVec oox::xls::FormulaParserImpl::maOpeningSpaces
private

List of whitespaces before next token.

Definition at line 544 of file formulaparser.cxx.

Referenced by appendOpeningSpaces(), FormulaParserImpl(), pushParenthesesOperator(), and resetSpaces().

◆ maOperandSizeStack

std::vector<size_t> oox::xls::FormulaParserImpl::maOperandSizeStack
private

◆ maTokenIndexes

std::vector<size_t> oox::xls::FormulaParserImpl::maTokenIndexes
private

◆ maTokenStorage

ApiTokenVector oox::xls::FormulaParserImpl::maTokenStorage
private

True = special handling for tExp and tTbl tokens, false = exit with error.

Definition at line 540 of file formulaparser.cxx.

Referenced by appendRawToken(), finalizeImport(), FormulaParserImpl(), getOperandToken(), initializeImport(), and insertRawToken().

◆ mb2dRefsAs3dRefs

bool oox::xls::FormulaParserImpl::mb2dRefsAs3dRefs
protected

True = relative row/column index is (signed) offset, false = explicit index.

Definition at line 536 of file formulaparser.cxx.

Referenced by initializeImport(), and initReference2d().

◆ mbRelativeAsOffset

bool oox::xls::FormulaParserImpl::mbRelativeAsOffset
protected

Base address for relative references.

Definition at line 535 of file formulaparser.cxx.

Referenced by initializeImport().

◆ mbSpecialTokens

bool oox::xls::FormulaParserImpl::mbSpecialTokens
protected

True = convert all 2D references to 3D references in sheet specified by base address.

Definition at line 537 of file formulaparser.cxx.

Referenced by initializeImport(), and pushSpecialTokenOperand().

◆ mnMaxApiCol

const sal_Int32 oox::xls::FormulaParserImpl::mnMaxApiCol
protected

Definition at line 529 of file formulaparser.cxx.

Referenced by convertReference().

◆ mnMaxApiRow

const sal_Int32 oox::xls::FormulaParserImpl::mnMaxApiRow
protected

Maximum column index in own document.

Definition at line 530 of file formulaparser.cxx.

Referenced by convertReference().

◆ mnMaxXlsCol

const sal_Int32 oox::xls::FormulaParserImpl::mnMaxXlsCol
protected

Maximum row index in own document.

Definition at line 531 of file formulaparser.cxx.

Referenced by convertReference().

◆ mnMaxXlsRow

const sal_Int32 oox::xls::FormulaParserImpl::mnMaxXlsRow
protected

Maximum column index in imported document.

Definition at line 532 of file formulaparser.cxx.

Referenced by convertReference().


The documentation for this class was generated from the following file: