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...
 
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, const css::uno::Sequence< css::sheet::FormulaToken > &rTokens, 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, const css::uno::Sequence< css::sheet::FormulaToken > &rTokens, 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)
 
- 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 (const OUString &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 417 of file formulaparser.cxx.

Member Typedef Documentation

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

Definition at line 437 of file formulaparser.cxx.

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

Definition at line 438 of file formulaparser.cxx.

Constructor & Destructor Documentation

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

Member Function Documentation

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

Definition at line 657 of file formulaparser.cxx.

References appendSpaces(), and maClosingSpaces.

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

Definition at line 647 of file formulaparser.cxx.

References appendSpaces(), and maLeadingSpaces.

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

Definition at line 652 of file formulaparser.cxx.

References appendSpaces(), and maOpeningSpaces.

Any & oox::xls::FormulaParserImpl::appendRawToken ( sal_Int32  nOpCode)
protected
void oox::xls::FormulaParserImpl::appendSpaces ( WhiteSpaceVec orSpaces,
sal_Int32  nCount,
bool  bLineFeed 
)
staticprotected
size_t oox::xls::FormulaParserImpl::appendWhiteSpaceTokens ( const WhiteSpaceVec pSpaces)
protected
void oox::xls::FormulaParserImpl::convertReference ( SingleReference &  orApiRef,
const BinSingleRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
) const
private
void oox::xls::FormulaParserImpl::convertReference ( ComplexReference &  orApiRef,
const BinSingleRef2d rRef1,
const BinSingleRef2d rRef2,
bool  bDeleted,
bool  bRelativeAsOffset 
) const
private
void oox::xls::FormulaParserImpl::convertReference2d ( SingleReference &  orApiRef,
const BinSingleRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
) const
private

Definition at line 1105 of file formulaparser.cxx.

References convertReference(), and initReference2d().

Referenced by pushReferenceOperand().

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

Definition at line 1111 of file formulaparser.cxx.

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

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

Definition at line 1120 of file formulaparser.cxx.

References convertReference(), and initReference3d().

Referenced by pushReferenceOperand().

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

Finalizes the internal token storage after import.

Definition at line 615 of file formulaparser.cxx.

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

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

Definition at line 662 of file formulaparser.cxx.

References maTokenIndexes.

Referenced by pushSpecialTokenOperand().

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

Definition at line 695 of file formulaparser.cxx.

References maOperandSizeStack.

Referenced by getOperandToken().

ApiToken & oox::xls::FormulaParserImpl::getOperandToken ( size_t  nOpIndex,
size_t  nTokenIndex 
)
protected
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 573 of file formulaparser.cxx.

References SAL_WARN.

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

Converts an OOXML formula string.

Definition at line 567 of file formulaparser.cxx.

void oox::xls::FormulaParserImpl::initializeImport ( const ScAddress rBaseAddress,
FormulaType  eType 
)
protected
void oox::xls::FormulaParserImpl::initReference2d ( SingleReference &  orApiRef) const
private

Definition at line 1031 of file formulaparser.cxx.

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

Referenced by convertReference2d().

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

Definition at line 1046 of file formulaparser.cxx.

Referenced by convertReference3d(), and initReference2d().

Any & oox::xls::FormulaParserImpl::insertRawToken ( sal_Int32  nOpCode,
size_t  nIndexFromEnd 
)
protected
size_t oox::xls::FormulaParserImpl::insertWhiteSpaceTokens ( const WhiteSpaceVec pSpaces,
size_t  nIndexFromEnd 
)
protected
size_t oox::xls::FormulaParserImpl::popOperandSize ( )
protected
bool oox::xls::FormulaParserImpl::pushBiffBoolOperand ( sal_uInt8  nValue)
protected

Definition at line 872 of file formulaparser.cxx.

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

bool oox::xls::FormulaParserImpl::pushBiffErrorOperand ( sal_uInt8  nErrorCode)
protected
bool oox::xls::FormulaParserImpl::pushBinaryOperator ( sal_Int32  nOpCode)
protected

Definition at line 1009 of file formulaparser.cxx.

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

bool oox::xls::FormulaParserImpl::pushBinaryOperatorToken ( sal_Int32  nOpCode,
const WhiteSpaceVec pSpaces = nullptr 
)
protected
bool oox::xls::FormulaParserImpl::pushBoolOperand ( bool  bValue)
protected
bool oox::xls::FormulaParserImpl::pushDdeLinkOperand ( const OUString &  rDdeServer,
const OUString &  rDdeTopic,
const OUString &  rDdeItem 
)
protected
bool oox::xls::FormulaParserImpl::pushDefinedNameOperand ( const DefinedNameRef rxDefName)
protected
bool oox::xls::FormulaParserImpl::pushEmbeddedRefOperand ( const DefinedNameBase rName,
bool  bPushBadToken 
)
protected
bool oox::xls::FormulaParserImpl::pushErrorOperand ( double  fEncodedError)
protected
bool oox::xls::FormulaParserImpl::pushExternalFuncOperand ( const FunctionInfo rFuncInfo)
protected
bool oox::xls::FormulaParserImpl::pushExternalNameOperand ( const ExternalNameRef rxExtName,
const ExternalLink rExtLink 
)
protected
bool oox::xls::FormulaParserImpl::pushFunctionOperator ( sal_Int32  nOpCode,
size_t  nParamCount 
)
protected
bool oox::xls::FormulaParserImpl::pushFunctionOperator ( const FunctionInfo rFuncInfo,
size_t  nParamCount 
)
protected
bool oox::xls::FormulaParserImpl::pushFunctionOperatorToken ( sal_Int32  nOpCode,
size_t  nParamCount,
const WhiteSpaceVec pLeadingSpaces = nullptr,
const WhiteSpaceVec pClosingSpaces = nullptr 
)
protected
bool oox::xls::FormulaParserImpl::pushFunctionOperatorToken ( const FunctionInfo rFuncInfo,
size_t  nParamCount,
const WhiteSpaceVec pLeadingSpaces = nullptr,
const WhiteSpaceVec pClosingSpaces = nullptr 
)
protected
bool oox::xls::FormulaParserImpl::pushOperand ( sal_Int32  nOpCode)
protected

Definition at line 839 of file formulaparser.cxx.

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

Referenced by pushErrorOperand(), and pushExternalFuncOperand().

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

Definition at line 725 of file formulaparser.cxx.

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

Referenced by pushOperand().

bool oox::xls::FormulaParserImpl::pushParenthesesOperandToken ( const WhiteSpaceVec pClosingSpaces = nullptr)
protected
bool oox::xls::FormulaParserImpl::pushParenthesesOperator ( )
protected
bool oox::xls::FormulaParserImpl::pushParenthesesOperatorToken ( const WhiteSpaceVec pOpeningSpaces = nullptr,
const WhiteSpaceVec pClosingSpaces = nullptr 
)
protected
bool oox::xls::FormulaParserImpl::pushReferenceOperand ( const BinSingleRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
)
protected

Definition at line 882 of file formulaparser.cxx.

References convertReference2d(), and pushValueOperand().

Referenced by pushReferenceOperand().

bool oox::xls::FormulaParserImpl::pushReferenceOperand ( const BinComplexRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
)
protected
template<typename Type >
bool oox::xls::FormulaParserImpl::pushReferenceOperand ( const LinkSheetRange rSheetRange,
const Type rApiRef 
)
protected
bool oox::xls::FormulaParserImpl::pushReferenceOperand ( const LinkSheetRange rSheetRange,
const BinSingleRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
)
protected
bool oox::xls::FormulaParserImpl::pushReferenceOperand ( const LinkSheetRange rSheetRange,
const BinComplexRef2d rRef,
bool  bDeleted,
bool  bRelativeAsOffset 
)
protected
bool oox::xls::FormulaParserImpl::pushSpecialTokenOperand ( const BinAddress rBaseAddr)
protected
bool oox::xls::FormulaParserImpl::pushUnaryPostOperator ( sal_Int32  nOpCode)
protected

Definition at line 1004 of file formulaparser.cxx.

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

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

Definition at line 999 of file formulaparser.cxx.

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

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

Definition at line 483 of file formulaparser.cxx.

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

template<typename Type >
bool oox::xls::FormulaParserImpl::pushValueOperandToken ( const Type rValue,
sal_Int32  nOpCode,
const WhiteSpaceVec pSpaces = nullptr 
)
protected
template<typename Type >
bool oox::xls::FormulaParserImpl::pushValueOperandToken ( const Type rValue)
inlineprotected
bool oox::xls::FormulaParserImpl::resetSpaces ( )
protected
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 1138 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(), and oox::xls::Library.

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 1161 of file formulaparser.cxx.

References oox::xls::WorkbookHelper::getDefinedNames().

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

Member Data Documentation

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

Maximum row index in imported document.

Definition at line 533 of file formulaparser.cxx.

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

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

List of whitespaces before opening parenthesis.

Definition at line 544 of file formulaparser.cxx.

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

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

List of whitespaces before next token.

Definition at line 543 of file formulaparser.cxx.

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

std::vector<size_t> oox::xls::FormulaParserImpl::maOperandSizeStack
private
std::vector<size_t> oox::xls::FormulaParserImpl::maTokenIndexes
private
ApiTokenVector oox::xls::FormulaParserImpl::maTokenStorage
private

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

Definition at line 539 of file formulaparser.cxx.

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

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

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

Definition at line 535 of file formulaparser.cxx.

Referenced by initializeImport(), and initReference2d().

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

Base address for relative references.

Definition at line 534 of file formulaparser.cxx.

Referenced by initializeImport().

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

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

Definition at line 536 of file formulaparser.cxx.

Referenced by initializeImport(), and pushSpecialTokenOperand().

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

Definition at line 528 of file formulaparser.cxx.

Referenced by convertReference().

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

Maximum column index in own document.

Definition at line 529 of file formulaparser.cxx.

Referenced by convertReference().

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

Maximum row index in own document.

Definition at line 530 of file formulaparser.cxx.

Referenced by convertReference().

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

Maximum column index in imported document.

Definition at line 531 of file formulaparser.cxx.

Referenced by convertReference().


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