LibreOffice Module sc (master) 1
Public Member Functions | Static Public Member Functions | List of all members
oox::xls::FormulaProcessorBase Class Reference

Base class for import formula parsers and export formula compilers. More...

#include <formulabase.hxx>

Inheritance diagram for oox::xls::FormulaProcessorBase:
[legend]
Collaboration diagram for oox::xls::FormulaProcessorBase:
[legend]

Public Member Functions

 FormulaProcessorBase (const WorkbookHelper &rHelper)
 
css::uno::Any extractReference (const ApiTokenSequence &rTokens) const
 Tries to extract a single cell reference from a formula token sequence. More...
 
bool extractCellRange (ScRange &orRange, const ApiTokenSequence &rTokens) const
 Tries to extract a cell range address from a formula token sequence. More...
 
void extractCellRangeList (ScRangeList &orRanges, const ApiTokenSequence &rTokens, sal_Int32 nFilterBySheet) const
 Tries to extract a cell range list from a formula token sequence. More...
 
bool extractString (OUString &orString, const ApiTokenSequence &rTokens) const
 Tries to extract a string from a formula token sequence. More...
 
bool extractSpecialTokenInfo (ApiSpecialTokenInfo &orTokenInfo, const ApiTokenSequence &rTokens) const
 Tries to extract information about a special token used for array formulas, shared formulas, or table operations. More...
 
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 tokens. 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...
 

Static Public Member Functions

static OUString generateAddress2dString (const ScAddress &rAddress, bool bAbsolute)
 Generates a cell address string in A1 notation from the passed cell address. More...
 
static OUString generateAddress2dString (const BinAddress &rAddress, bool bAbsolute)
 Generates a cell address string in A1 notation from the passed binary cell address. More...
 
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 double values or strings. More...
 
- 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)
 

Additional Inherited Members

- Public Types inherited from oox::xls::WorkbookHelper
typedef std::pair< ScRangeData *, bool > RangeDataRet
 
- Protected Types inherited from oox::xls::WorkbookHelper
typedef std::pair< ScRangeData *, bool > RangeDataRet
 
- Protected Member Functions inherited from oox::xls::FunctionProvider
const FunctionInfoVectorgetFuncs () const
 Returns the list of all function infos. More...
 
- Protected 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...
 
- Static Protected Member Functions inherited from oox::xls::WorkbookHelper
static WorkbookGlobalsRef constructGlobals (ExcelFilter &rFilter)
 
- 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...
 

Detailed Description

Base class for import formula parsers and export formula compilers.

Definition at line 629 of file formulabase.hxx.

Constructor & Destructor Documentation

◆ FormulaProcessorBase()

oox::xls::FormulaProcessorBase::FormulaProcessorBase ( const WorkbookHelper rHelper)
explicit

Definition at line 1538 of file formulabase.cxx.

Member Function Documentation

◆ convertStringToStringList()

void oox::xls::FormulaProcessorBase::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 tokens.

Parameters
orTokens(input/output parameter) Expects a single string token in this token sequence (whitespace tokens are allowed). The string is split into substrings. A list of string tokens separated with parameter separator tokens is returned in this parameter.
cStringSepThe separator character used to split the input string.
bTrimLeadingSpacesTrue = removes leading whitespace from all substrings inserted into the formula token sequence.

Definition at line 1681 of file formulabase.cxx.

References Any, comphelper::containerToSequence(), extractString(), nPos, oox::xls::ApiOpCodes::OPCODE_PUSH, and oox::xls::ApiOpCodes::OPCODE_SEP.

Referenced by oox::xls::DataValidationsContextBase::importDataValidation().

◆ extractCellRange()

bool oox::xls::FormulaProcessorBase::extractCellRange ( ScRange orRange,
const ApiTokenSequence rTokens 
) const

Tries to extract a cell range address from a formula token sequence.

Only real absolute references will be accepted.

Parameters
orAddress(output parameter) If the token sequence is valid, this parameter will contain the extracted cell range address. If the token sequence contains unexpected tokens, nothing meaningful is inserted, and the function returns false.
rTokensThe token sequence to be parsed. Should contain exactly one cell range address token. The token sequence may contain whitespace tokens.
Returns
True, if the token sequence contains a valid cell range address which has been extracted to orRange, false otherwise.

Definition at line 1606 of file formulabase.cxx.

References ScRangeList::empty(), extractReference(), and ScRangeList::front().

Referenced by oox::xls::DefinedName::getAbsoluteRange().

◆ extractCellRangeList()

void oox::xls::FormulaProcessorBase::extractCellRangeList ( ScRangeList orRanges,
const ApiTokenSequence rTokens,
sal_Int32  nFilterBySheet 
) const

Tries to extract a cell range list from a formula token sequence.

Only real absolute references will be accepted.

Parameters
orRanges(output parameter) If the token sequence is valid, this parameter will contain the extracted cell range list. Deleted cells or cell ranges (shown as #REF! error in a formula) will be skipped. If the token sequence contains unexpected tokens, an empty list is returned here.
rTokensThe token sequence to be parsed. Should contain cell address tokens or cell range address tokens, separated by the standard function parameter separator token. The token sequence may contain parentheses and whitespace tokens.
nFilterBySheetIf non-negative, this function returns only cell ranges located in the specified sheet, otherwise returns all cell ranges contained in the token sequence.

Definition at line 1619 of file formulabase.cxx.

References oox::xls::WorkbookHelper::getAddressConverter(), oox::xls::ApiTokenIterator::is(), oox::xls::ApiOpCodes::OPCODE_CLOSE, oox::xls::ApiOpCodes::OPCODE_LIST, oox::xls::ApiOpCodes::OPCODE_OPEN, oox::xls::ApiOpCodes::OPCODE_PUSH, oox::xls::ApiOpCodes::OPCODE_SEP, oox::xls::ApiOpCodes::OPCODE_SPACES, ScRangeList::RemoveAll(), and oox::xls::AddressConverter::validateCellRangeList().

Referenced by oox::xls::DefinedName::convertFormula().

◆ extractReference()

Any oox::xls::FormulaProcessorBase::extractReference ( const ApiTokenSequence rTokens) const

Tries to extract a single cell reference from a formula token sequence.

Parameters
rTokensThe token sequence to be parsed. Should contain exactly one address token or cell range address token. The token sequence may contain whitespace tokens.
Returns
If the token sequence is valid, this function returns an Any containing a com.sun.star.sheet.SingleReference object, or a com.sun.star.sheet.ComplexReference object. If the token sequence contains too many, or unexpected tokens, an empty Any is returned.

Definition at line 1594 of file formulabase.cxx.

References Any, oox::xls::ApiTokenIterator::is(), oox::xls::ApiOpCodes::OPCODE_PUSH, and oox::xls::ApiOpCodes::OPCODE_SPACES.

Referenced by extractCellRange().

◆ extractSpecialTokenInfo()

bool oox::xls::FormulaProcessorBase::extractSpecialTokenInfo ( ApiSpecialTokenInfo orTokenInfo,
const ApiTokenSequence rTokens 
) const

Tries to extract information about a special token used for array formulas, shared formulas, or table operations.

Parameters
orTokenInfo(output parameter) The extracted information about the token. Contains the base address and the token type (sal_False for array or shared formulas, sal_True for table operations).
rTokensThe token sequence to be parsed. If it contains exactly one OPCODE_BAD token with special token information, this information will be extracted.
Returns
True = token sequence is valid, output parameter orTokenInfo contains the token information extracted from the token sequence.

Definition at line 1675 of file formulabase.cxx.

References oox::xls::ApiTokenIterator::is(), oox::xls::ApiOpCodes::OPCODE_BAD, and oox::xls::ApiOpCodes::OPCODE_SPACES.

◆ extractString()

bool oox::xls::FormulaProcessorBase::extractString ( OUString &  orString,
const ApiTokenSequence rTokens 
) const

Tries to extract a string from a formula token sequence.

Parameters
orString(output parameter) The extracted string.
rTokensThe token sequence to be parsed. Should contain exactly one string token, may contain whitespace tokens.
Returns
True = token sequence is valid, output parameter orString contains the string extracted from the token sequence.

Definition at line 1669 of file formulabase.cxx.

References oox::xls::ApiTokenIterator::is(), oox::xls::ApiOpCodes::OPCODE_PUSH, and oox::xls::ApiOpCodes::OPCODE_SPACES.

Referenced by convertStringToStringList().

◆ generateAddress2dString() [1/2]

OUString oox::xls::FormulaProcessorBase::generateAddress2dString ( const BinAddress rAddress,
bool  bAbsolute 
)
static

Generates a cell address string in A1 notation from the passed binary cell address.

Parameters
rAddressThe cell address containing column and row index.
bAbsoluteTrue = adds dollar signs before column and row.

Definition at line 1550 of file formulabase.cxx.

References aBuffer, oox::xls::BinAddress::mnCol, and oox::xls::BinAddress::mnRow.

◆ generateAddress2dString() [2/2]

OUString oox::xls::FormulaProcessorBase::generateAddress2dString ( const ScAddress rAddress,
bool  bAbsolute 
)
static

Generates a cell address string in A1 notation from the passed cell address.

Parameters
rAddressThe cell address containing column and row index.
bAbsoluteTrue = adds dollar signs before column and row.

Definition at line 1545 of file formulabase.cxx.

References generateAddress2dString().

Referenced by oox::xls::CondFormatRule::finalizeImport(), generateAddress2dString(), and oox::xls::SheetDataContext::importDataTable().

◆ generateApiArray()

OUString oox::xls::FormulaProcessorBase::generateApiArray ( const Matrix< css::uno::Any > &  rMatrix)
static

Generates an array string in Calc formula notation from the passed matrix with Any's containing double values or strings.

Parameters
rMatrixThe matrix containing double values or strings.

Definition at line 1565 of file formulabase.cxx.

References aBuffer, API_TOKEN_ARRAY_CLOSE, API_TOKEN_ARRAY_COLSEP, API_TOKEN_ARRAY_OPEN, oox::Matrix< typename Type >::empty(), oox::Matrix< typename Type >::height(), oox::Matrix< typename Type >::row_begin(), oox::Matrix< typename Type >::row_end(), and u.

Referenced by oox::xls::ExcelChartConverter::createDataSequence().


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