LCOV - code coverage report
Current view: top level - libreoffice/sc/source/filter/inc - formulabase.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 10 12 83.3 %
Date: 2012-12-27 Functions: 11 15 73.3 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef OOX_XLS_FORMULABASE_HXX
      21             : #define OOX_XLS_FORMULABASE_HXX
      22             : 
      23             : #include <com/sun/star/beans/Pair.hpp>
      24             : #include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp>
      25             : #include <com/sun/star/sheet/FormulaToken.hpp>
      26             : #include <com/sun/star/table/CellAddress.hpp>
      27             : #include <com/sun/star/table/CellRangeAddress.hpp>
      28             : #include <com/sun/star/uno/Sequence.hxx>
      29             : #include "oox/helper/propertyset.hxx"
      30             : #include "oox/helper/refvector.hxx"
      31             : #include "addressconverter.hxx"
      32             : 
      33             : namespace com { namespace sun { namespace star {
      34             :     namespace sheet { class XFormulaOpCodeMapper; }
      35             :     namespace sheet { class XFormulaParser; }
      36             : } } }
      37             : 
      38             : namespace oox { template< typename Type > class Matrix; }
      39             : 
      40             : namespace oox {
      41             : namespace xls {
      42             : 
      43             : // Constants ==================================================================
      44             : 
      45             : const size_t BIFF_TOKARR_MAXLEN                 = 4096;     /// Maximum size of a token array.
      46             : 
      47             : // token class flags ----------------------------------------------------------
      48             : 
      49             : const sal_uInt8 BIFF_TOKCLASS_MASK              = 0x60;
      50             : const sal_uInt8 BIFF_TOKCLASS_NONE              = 0x00;     /// 00-1F: Base tokens.
      51             : const sal_uInt8 BIFF_TOKCLASS_REF               = 0x20;     /// 20-3F: Reference class tokens.
      52             : const sal_uInt8 BIFF_TOKCLASS_VAL               = 0x40;     /// 40-5F: Value class tokens.
      53             : const sal_uInt8 BIFF_TOKCLASS_ARR               = 0x60;     /// 60-7F: Array class tokens.
      54             : 
      55             : const sal_uInt8 BIFF_TOKFLAG_INVALID            = 0x80;     /// This bit must be null for a valid token identifier.
      56             : 
      57             : // base token identifiers -----------------------------------------------------
      58             : 
      59             : const sal_uInt8 BIFF_TOKID_MASK                 = 0x1F;
      60             : 
      61             : const sal_uInt8 BIFF_TOKID_NONE                 = 0x00;     /// Placeholder for invalid token id.
      62             : const sal_uInt8 BIFF_TOKID_EXP                  = 0x01;     /// Array or shared formula reference.
      63             : const sal_uInt8 BIFF_TOKID_TBL                  = 0x02;     /// Multiple operation reference.
      64             : const sal_uInt8 BIFF_TOKID_ADD                  = 0x03;     /// Addition operator.
      65             : const sal_uInt8 BIFF_TOKID_SUB                  = 0x04;     /// Subtraction operator.
      66             : const sal_uInt8 BIFF_TOKID_MUL                  = 0x05;     /// Multiplication operator.
      67             : const sal_uInt8 BIFF_TOKID_DIV                  = 0x06;     /// Division operator.
      68             : const sal_uInt8 BIFF_TOKID_POWER                = 0x07;     /// Power operator.
      69             : const sal_uInt8 BIFF_TOKID_CONCAT               = 0x08;     /// String concatenation operator.
      70             : const sal_uInt8 BIFF_TOKID_LT                   = 0x09;     /// Less than operator.
      71             : const sal_uInt8 BIFF_TOKID_LE                   = 0x0A;     /// Less than or equal operator.
      72             : const sal_uInt8 BIFF_TOKID_EQ                   = 0x0B;     /// Equal operator.
      73             : const sal_uInt8 BIFF_TOKID_GE                   = 0x0C;     /// Greater than or equal operator.
      74             : const sal_uInt8 BIFF_TOKID_GT                   = 0x0D;     /// Greater than operator.
      75             : const sal_uInt8 BIFF_TOKID_NE                   = 0x0E;     /// Not equal operator.
      76             : const sal_uInt8 BIFF_TOKID_ISECT                = 0x0F;     /// Intersection operator.
      77             : const sal_uInt8 BIFF_TOKID_LIST                 = 0x10;     /// List operator.
      78             : const sal_uInt8 BIFF_TOKID_RANGE                = 0x11;     /// Range operator.
      79             : const sal_uInt8 BIFF_TOKID_UPLUS                = 0x12;     /// Unary plus.
      80             : const sal_uInt8 BIFF_TOKID_UMINUS               = 0x13;     /// Unary minus.
      81             : const sal_uInt8 BIFF_TOKID_PERCENT              = 0x14;     /// Percent sign.
      82             : const sal_uInt8 BIFF_TOKID_PAREN                = 0x15;     /// Parentheses.
      83             : const sal_uInt8 BIFF_TOKID_MISSARG              = 0x16;     /// Missing argument.
      84             : const sal_uInt8 BIFF_TOKID_STR                  = 0x17;     /// String constant.
      85             : const sal_uInt8 BIFF_TOKID_NLR                  = 0x18;     /// Natural language reference (NLR).
      86             : const sal_uInt8 BIFF_TOKID_ATTR                 = 0x19;     /// Special attribute.
      87             : const sal_uInt8 BIFF_TOKID_SHEET                = 0x1A;     /// Start of a sheet reference (BIFF2-BIFF4).
      88             : const sal_uInt8 BIFF_TOKID_ENDSHEET             = 0x1B;     /// End of a sheet reference (BIFF2-BIFF4).
      89             : const sal_uInt8 BIFF_TOKID_ERR                  = 0x1C;     /// Error constant.
      90             : const sal_uInt8 BIFF_TOKID_BOOL                 = 0x1D;     /// Boolean constant.
      91             : const sal_uInt8 BIFF_TOKID_INT                  = 0x1E;     /// Integer constant.
      92             : const sal_uInt8 BIFF_TOKID_NUM                  = 0x1F;     /// Floating-point constant.
      93             : 
      94             : // base identifiers of classified tokens --------------------------------------
      95             : 
      96             : const sal_uInt8 BIFF_TOKID_ARRAY                = 0x00;     /// Array constant.
      97             : const sal_uInt8 BIFF_TOKID_FUNC                 = 0x01;     /// Function, fixed number of arguments.
      98             : const sal_uInt8 BIFF_TOKID_FUNCVAR              = 0x02;     /// Function, variable number of arguments.
      99             : const sal_uInt8 BIFF_TOKID_NAME                 = 0x03;     /// Defined name.
     100             : const sal_uInt8 BIFF_TOKID_REF                  = 0x04;     /// 2D cell reference.
     101             : const sal_uInt8 BIFF_TOKID_AREA                 = 0x05;     /// 2D area reference.
     102             : const sal_uInt8 BIFF_TOKID_MEMAREA              = 0x06;     /// Constant reference subexpression.
     103             : const sal_uInt8 BIFF_TOKID_MEMERR               = 0x07;     /// Deleted reference subexpression.
     104             : const sal_uInt8 BIFF_TOKID_MEMNOMEM             = 0x08;     /// Constant reference subexpression without result.
     105             : const sal_uInt8 BIFF_TOKID_MEMFUNC              = 0x09;     /// Variable reference subexpression.
     106             : const sal_uInt8 BIFF_TOKID_REFERR               = 0x0A;     /// Deleted 2D cell reference.
     107             : const sal_uInt8 BIFF_TOKID_AREAERR              = 0x0B;     /// Deleted 2D area reference.
     108             : const sal_uInt8 BIFF_TOKID_REFN                 = 0x0C;     /// Relative 2D cell reference (in names).
     109             : const sal_uInt8 BIFF_TOKID_AREAN                = 0x0D;     /// Relative 2D area reference (in names).
     110             : const sal_uInt8 BIFF_TOKID_MEMAREAN             = 0x0E;     /// Reference subexpression (in names).
     111             : const sal_uInt8 BIFF_TOKID_MEMNOMEMN            = 0x0F;     /// Reference subexpression (in names) without result.
     112             : const sal_uInt8 BIFF_TOKID_FUNCCE               = 0x18;
     113             : const sal_uInt8 BIFF_TOKID_NAMEX                = 0x19;     /// External reference.
     114             : const sal_uInt8 BIFF_TOKID_REF3D                = 0x1A;     /// 3D cell reference.
     115             : const sal_uInt8 BIFF_TOKID_AREA3D               = 0x1B;     /// 3D area reference.
     116             : const sal_uInt8 BIFF_TOKID_REFERR3D             = 0x1C;     /// Deleted 3D cell reference.
     117             : const sal_uInt8 BIFF_TOKID_AREAERR3D            = 0x1D;     /// Deleted 3D area reference
     118             : 
     119             : // specific token constants ---------------------------------------------------
     120             : 
     121             : const sal_uInt8 BIFF_TOK_ARRAY_DOUBLE           = 0;        /// Double value in an array.
     122             : const sal_uInt8 BIFF_TOK_ARRAY_STRING           = 1;        /// String value in an array.
     123             : const sal_uInt8 BIFF_TOK_ARRAY_BOOL             = 2;        /// Boolean value in an array.
     124             : const sal_uInt8 BIFF_TOK_ARRAY_ERROR            = 4;        /// Error code in an array.
     125             : 
     126             : const sal_uInt8 BIFF_TOK_BOOL_FALSE             = 0;        /// FALSE value of a tBool token.
     127             : const sal_uInt8 BIFF_TOK_BOOL_TRUE              = 1;        /// TRUE value of a tBool token.
     128             : 
     129             : const sal_uInt8 BIFF_TOK_ATTR_VOLATILE          = 0x01;     /// Volatile function.
     130             : const sal_uInt8 BIFF_TOK_ATTR_IF                = 0x02;     /// Start of true condition in IF function.
     131             : const sal_uInt8 BIFF_TOK_ATTR_CHOOSE            = 0x04;     /// Jump array of CHOOSE function.
     132             : const sal_uInt8 BIFF_TOK_ATTR_SKIP              = 0x08;     /// Skip tokens.
     133             : const sal_uInt8 BIFF_TOK_ATTR_SUM               = 0x10;     /// SUM function with one parameter.
     134             : const sal_uInt8 BIFF_TOK_ATTR_ASSIGN            = 0x20;     /// BASIC style assignment.
     135             : const sal_uInt8 BIFF_TOK_ATTR_SPACE             = 0x40;     /// Spaces in formula representation.
     136             : const sal_uInt8 BIFF_TOK_ATTR_SPACE_VOLATILE    = 0x41;     /// Leading spaces and volatile formula.
     137             : const sal_uInt8 BIFF_TOK_ATTR_IFERROR           = 0x80;     /// Start of condition in IFERROR function (BIFF12 only).
     138             : 
     139             : const sal_uInt8 BIFF_TOK_ATTR_SPACE_SP          = 0x00;     /// Spaces before next token.
     140             : const sal_uInt8 BIFF_TOK_ATTR_SPACE_BR          = 0x01;     /// Line breaks before next token.
     141             : const sal_uInt8 BIFF_TOK_ATTR_SPACE_SP_OPEN     = 0x02;     /// Spaces before opening parenthesis.
     142             : const sal_uInt8 BIFF_TOK_ATTR_SPACE_BR_OPEN     = 0x03;     /// Line breaks before opening parenthesis.
     143             : const sal_uInt8 BIFF_TOK_ATTR_SPACE_SP_CLOSE    = 0x04;     /// Spaces before closing parenthesis.
     144             : const sal_uInt8 BIFF_TOK_ATTR_SPACE_BR_CLOSE    = 0x05;     /// Line breaks before closing parenthesis.
     145             : const sal_uInt8 BIFF_TOK_ATTR_SPACE_SP_PRE      = 0x06;     /// Spaces before formula (BIFF3).
     146             : 
     147             : const sal_uInt16 BIFF_TOK_FUNCVAR_CMD           = 0x8000;   /// Macro command.
     148             : const sal_uInt16 BIFF_TOK_FUNCVAR_FUNCIDMASK    = 0x7FFF;   /// Mask for function/command index.
     149             : const sal_uInt8 BIFF_TOK_FUNCVAR_CMDPROMPT      = 0x80;     /// User prompt for macro commands.
     150             : const sal_uInt8 BIFF_TOK_FUNCVAR_COUNTMASK      = 0x7F;     /// Mask for parameter count.
     151             : 
     152             : const sal_uInt16 BIFF12_TOK_REF_COLMASK         = 0x3FFF;   /// Mask to extract column from reference (BIFF12).
     153             : const sal_Int32 BIFF12_TOK_REF_ROWMASK          = 0xFFFFF;  /// Mask to extract row from reference (BIFF12).
     154             : const sal_uInt16 BIFF12_TOK_REF_COLREL          = 0x4000;   /// True = column is relative (BIFF12).
     155             : const sal_uInt16 BIFF12_TOK_REF_ROWREL          = 0x8000;   /// True = row is relative (BIFF12).
     156             : 
     157             : const sal_uInt16 BIFF_TOK_REF_COLMASK           = 0x00FF;   /// Mask to extract BIFF8 column from reference.
     158             : const sal_uInt16 BIFF_TOK_REF_ROWMASK           = 0x3FFF;   /// Mask to extract BIFF2-BIFF5 row from reference.
     159             : const sal_uInt16 BIFF_TOK_REF_COLREL            = 0x4000;   /// True = column is relative.
     160             : const sal_uInt16 BIFF_TOK_REF_ROWREL            = 0x8000;   /// True = row is relative.
     161             : 
     162             : const sal_uInt16 BIFF12_TOK_TABLE_COLUMN         = 0x0001;   /// Table reference: Single column.
     163             : const sal_uInt16 BIFF12_TOK_TABLE_COLRANGE       = 0x0002;   /// Table reference: Range of columns.
     164             : const sal_uInt16 BIFF12_TOK_TABLE_ALL            = 0x0004;   /// Table reference: Special [#All] range.
     165             : const sal_uInt16 BIFF12_TOK_TABLE_HEADERS        = 0x0008;   /// Table reference: Special [#Headers] range.
     166             : const sal_uInt16 BIFF12_TOK_TABLE_DATA           = 0x0010;   /// Table reference: Special [#Data] range.
     167             : const sal_uInt16 BIFF12_TOK_TABLE_TOTALS         = 0x0020;   /// Table reference: Special [#Totals] range.
     168             : const sal_uInt16 BIFF12_TOK_TABLE_THISROW        = 0x0040;   /// Table reference: Special [#This Row] range.
     169             : const sal_uInt16 BIFF12_TOK_TABLE_SP_BRACKETS    = 0x0080;   /// Table reference: Spaces in outer brackets.
     170             : const sal_uInt16 BIFF12_TOK_TABLE_SP_SEP         = 0x0100;   /// Table reference: Spaces after separators.
     171             : const sal_uInt16 BIFF12_TOK_TABLE_ROW            = 0x0200;   /// Table reference: Single row.
     172             : const sal_uInt16 BIFF12_TOK_TABLE_CELL           = 0x0400;   /// Table reference: Single cell.
     173             : 
     174             : const sal_uInt8 BIFF_TOK_NLR_ERR                = 0x01;     /// NLR: Invalid/deleted.
     175             : const sal_uInt8 BIFF_TOK_NLR_ROWR               = 0x02;     /// NLR: Row index.
     176             : const sal_uInt8 BIFF_TOK_NLR_COLR               = 0x03;     /// NLR: Column index.
     177             : const sal_uInt8 BIFF_TOK_NLR_ROWV               = 0x06;     /// NLR: Value in row.
     178             : const sal_uInt8 BIFF_TOK_NLR_COLV               = 0x07;     /// NLR: Value in column.
     179             : const sal_uInt8 BIFF_TOK_NLR_RANGE              = 0x0A;     /// NLR: Range.
     180             : const sal_uInt8 BIFF_TOK_NLR_SRANGE             = 0x0B;     /// Stacked NLR: Range.
     181             : const sal_uInt8 BIFF_TOK_NLR_SROWR              = 0x0C;     /// Stacked NLR: Row index.
     182             : const sal_uInt8 BIFF_TOK_NLR_SCOLR              = 0x0D;     /// Stacked NLR: Column index.
     183             : const sal_uInt8 BIFF_TOK_NLR_SROWV              = 0x0E;     /// Stacked NLR: Value in row.
     184             : const sal_uInt8 BIFF_TOK_NLR_SCOLV              = 0x0F;     /// Stacked NLR: Value in column.
     185             : const sal_uInt8 BIFF_TOK_NLR_RANGEERR           = 0x10;     /// NLR: Invalid/deleted range.
     186             : const sal_uInt8 BIFF_TOK_NLR_SXNAME             = 0x1D;     /// NLR: Pivot table name.
     187             : const sal_uInt16 BIFF_TOK_NLR_REL               = 0x8000;   /// True = NLR is relative.
     188             : const sal_uInt16 BIFF_TOK_NLR_MASK              = 0x3FFF;   /// Mask to extract BIFF8 column from NLR.
     189             : 
     190             : const sal_uInt32 BIFF_TOK_NLR_ADDREL            = 0x80000000;   /// NLR relative (in appended data).
     191             : const sal_uInt32 BIFF_TOK_NLR_ADDMASK           = 0x3FFFFFFF;   /// Mask for number of appended ranges.
     192             : 
     193             : // function constants ---------------------------------------------------------
     194             : 
     195             : const sal_uInt8 OOX_MAX_PARAMCOUNT              = 255;      /// Maximum parameter count for OOXML/BIFF12 files.
     196             : const sal_uInt8 BIFF_MAX_PARAMCOUNT             = 30;       /// Maximum parameter count for BIFF2-BIFF8 files.
     197             : 
     198             : const sal_uInt16 BIFF_FUNC_IF                   = 1;        /// Function identifier of the IF function.
     199             : const sal_uInt16 BIFF_FUNC_SUM                  = 4;        /// Function identifier of the SUM function.
     200             : const sal_uInt16 BIFF_FUNC_TRUE                 = 34;       /// Function identifier of the TRUE function.
     201             : const sal_uInt16 BIFF_FUNC_FALSE                = 35;       /// Function identifier of the FALSE function.
     202             : const sal_uInt16 BIFF_FUNC_ROWS                 = 76;       /// Function identifier of the ROWS function.
     203             : const sal_uInt16 BIFF_FUNC_COLUMNS              = 77;       /// Function identifier of the COLUMNS function.
     204             : const sal_uInt16 BIFF_FUNC_OFFSET               = 78;       /// Function identifier of the OFFSET function.
     205             : const sal_uInt16 BIFF_FUNC_EXTERNCALL           = 255;      /// BIFF function id of the EXTERN.CALL function.
     206             : const sal_uInt16 BIFF_FUNC_FLOOR                = 285;      /// Function identifier of the FLOOR function.
     207             : const sal_uInt16 BIFF_FUNC_CEILING              = 288;      /// Function identifier of the CEILING function.
     208             : const sal_uInt16 BIFF_FUNC_HYPERLINK            = 359;      /// Function identifier of the HYPERLINK function.
     209             : const sal_uInt16 BIFF_FUNC_WEEKNUM              = 465;      /// Function identifier of the WEEKNUM function.
     210             : 
     211             : // Formula type ===============================================================
     212             : 
     213             : /** Enumerates all possible types of a formula. */
     214             : enum FormulaType
     215             : {
     216             :     FORMULATYPE_CELL,           /// Simple cell formula, or reference to a shared formula name.
     217             :     FORMULATYPE_ARRAY,          /// Array (matrix) formula.
     218             :     FORMULATYPE_SHAREDFORMULA,  /// Shared formula definition.
     219             :     FORMULATYPE_CONDFORMAT,     /// Condition of a conditional format rule.
     220             :     FORMULATYPE_VALIDATION,     /// Condition of a data validation.
     221             :     FORMULATYPE_DEFINEDNAME     /// Definition of a defined name.
     222             : };
     223             : 
     224             : // Reference helpers ==========================================================
     225             : 
     226             : /** A 2D formula cell reference struct with relative flags. */
     227             : struct BinSingleRef2d
     228             : {
     229             :     sal_Int32           mnCol;              /// Column index.
     230             :     sal_Int32           mnRow;              /// Row index.
     231             :     bool                mbColRel;           /// True = relative column reference.
     232             :     bool                mbRowRel;           /// True = relative row reference.
     233             : 
     234             :     explicit            BinSingleRef2d();
     235             : 
     236             :     void                setBiff12Data( sal_uInt16 nCol, sal_Int32 nRow, bool bRelativeAsOffset );
     237             :     void                setBiff2Data( sal_uInt8 nCol, sal_uInt16 nRow, bool bRelativeAsOffset );
     238             :     void                setBiff8Data( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelativeAsOffset );
     239             : 
     240             :     void                readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset );
     241             :     void                readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
     242             :     void                readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
     243             : };
     244             : 
     245             : // ----------------------------------------------------------------------------
     246             : 
     247             : /** A 2D formula cell range reference struct with relative flags. */
     248           0 : struct BinComplexRef2d
     249             : {
     250             :     BinSingleRef2d      maRef1;             /// Start (top-left) cell address.
     251             :     BinSingleRef2d      maRef2;             /// End (bottom-right) cell address.
     252             : 
     253             :     void                readBiff12Data( SequenceInputStream& rStrm, bool bRelativeAsOffset );
     254             :     void                readBiff2Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
     255             :     void                readBiff8Data( BiffInputStream& rStrm, bool bRelativeAsOffset );
     256             : };
     257             : 
     258             : // Token vector, token sequence ===============================================
     259             : 
     260             : typedef ::com::sun::star::sheet::FormulaToken       ApiToken;
     261             : typedef ::com::sun::star::uno::Sequence< ApiToken > ApiTokenSequence;
     262             : 
     263             : /** Contains the base address and type of a special token representing an array
     264             :     formula or a shared formula (sal_False), or a table operation (sal_True). */
     265             : typedef ::com::sun::star::beans::Pair< ::com::sun::star::table::CellAddress, sal_Bool > ApiSpecialTokenInfo;
     266             : 
     267             : /** A vector of formula tokens with additional convenience functions. */
     268          22 : class ApiTokenVector : public ::std::vector< ApiToken >
     269             : {
     270             : public:
     271             :     explicit            ApiTokenVector();
     272             : 
     273             :     /** Appends a new token with the passed op-code, returns its data field. */
     274             :     ::com::sun::star::uno::Any&
     275             :                         append( sal_Int32 nOpCode );
     276             : 
     277             :     /** Appends a new token with the passed op-code and data. */
     278             :     template< typename Type >
     279           0 :     inline void         append( sal_Int32 nOpCode, const Type& rData ) { append( nOpCode ) <<= rData; }
     280             : };
     281             : 
     282             : // Token sequence iterator ====================================================
     283             : 
     284             : /** Token sequence iterator that is able to skip space tokens. */
     285             : class ApiTokenIterator
     286             : {
     287             : public:
     288             :     explicit            ApiTokenIterator( const ApiTokenSequence& rTokens, sal_Int32 nSpacesOpCode, bool bSkipSpaces );
     289           5 :     inline bool         is() const { return mpToken != mpTokenEnd; }
     290             :     inline const ApiToken* get() const { return mpToken; }
     291           2 :     inline const ApiToken* operator->() const { return mpToken; }
     292             :     inline const ApiToken& operator*() const { return *mpToken; }
     293             : 
     294             :     ApiTokenIterator&   operator++();
     295             : 
     296             : private:
     297             :     void                skipSpaces();
     298             : 
     299             : private:
     300             :     const ApiToken*     mpToken;            /// Pointer to current token of the token sequence.
     301             :     const ApiToken*     mpTokenEnd;         /// Pointer behind last token of the token sequence.
     302             :     const sal_Int32     mnSpacesOpCode;     /// Op-code for whitespace tokens.
     303             :     const bool          mbSkipSpaces;       /// true = Skip whitespace tokens.
     304             : };
     305             : 
     306             : // List of API op-codes =======================================================
     307             : 
     308             : /** Contains all API op-codes needed to build formulas with tokens. */
     309          11 : struct ApiOpCodes
     310             : {
     311             :     // special
     312             :     sal_Int32           OPCODE_UNKNOWN;         /// Internal: function name unknown to mapper.
     313             :     sal_Int32           OPCODE_EXTERNAL;        /// External function call (e.g. add-ins).
     314             :     // formula structure
     315             :     sal_Int32           OPCODE_PUSH;            /// Op-code for common value operands.
     316             :     sal_Int32           OPCODE_MISSING;         /// Placeholder for a missing function parameter.
     317             :     sal_Int32           OPCODE_SPACES;          /// Spaces between other formula tokens.
     318             :     sal_Int32           OPCODE_NAME;            /// Index of a defined name.
     319             :     sal_Int32           OPCODE_DBAREA;          /// Index of a database area.
     320             :     sal_Int32           OPCODE_NLR;             /// Natural language reference.
     321             :     sal_Int32           OPCODE_DDE;             /// DDE link function.
     322             :     sal_Int32           OPCODE_MACRO;           /// Macro function call.
     323             :     sal_Int32           OPCODE_BAD;             /// Bad token (unknown name, formula error).
     324             :     sal_Int32           OPCODE_NONAME;          /// Function style #NAME? error.
     325             :     // separators
     326             :     sal_Int32           OPCODE_OPEN;            /// Opening parenthesis.
     327             :     sal_Int32           OPCODE_CLOSE;           /// Closing parenthesis.
     328             :     sal_Int32           OPCODE_SEP;             /// Function parameter separator.
     329             :     // array separators
     330             :     sal_Int32           OPCODE_ARRAY_OPEN;      /// Opening brace for constant arrays.
     331             :     sal_Int32           OPCODE_ARRAY_CLOSE;     /// Closing brace for constant arrays.
     332             :     sal_Int32           OPCODE_ARRAY_ROWSEP;    /// Row separator in constant arrays.
     333             :     sal_Int32           OPCODE_ARRAY_COLSEP;    /// Column separator in constant arrays.
     334             :     // unary operators
     335             :     sal_Int32           OPCODE_PLUS_SIGN;       /// Unary plus sign.
     336             :     sal_Int32           OPCODE_MINUS_SIGN;      /// Unary minus sign.
     337             :     sal_Int32           OPCODE_PERCENT;         /// Percent sign.
     338             :     // binary operators
     339             :     sal_Int32           OPCODE_ADD;             /// Addition operator.
     340             :     sal_Int32           OPCODE_SUB;             /// Subtraction operator.
     341             :     sal_Int32           OPCODE_MULT;            /// Multiplication operator.
     342             :     sal_Int32           OPCODE_DIV;             /// Division operator.
     343             :     sal_Int32           OPCODE_POWER;           /// Power operator.
     344             :     sal_Int32           OPCODE_CONCAT;          /// String concatenation operator.
     345             :     sal_Int32           OPCODE_EQUAL;           /// Compare equal operator.
     346             :     sal_Int32           OPCODE_NOT_EQUAL;       /// Compare not equal operator.
     347             :     sal_Int32           OPCODE_LESS;            /// Compare less operator.
     348             :     sal_Int32           OPCODE_LESS_EQUAL;      /// Compare less or equal operator.
     349             :     sal_Int32           OPCODE_GREATER;         /// Compare greater operator.
     350             :     sal_Int32           OPCODE_GREATER_EQUAL;   /// Compare greater or equal operator.
     351             :     sal_Int32           OPCODE_INTERSECT;       /// Range intersection operator.
     352             :     sal_Int32           OPCODE_LIST;            /// Range list operator.
     353             :     sal_Int32           OPCODE_RANGE;           /// Range operator.
     354             : };
     355             : 
     356             : // Function parameter info ====================================================
     357             : 
     358             : /** Enumerates validity modes for a function parameter. */
     359             : enum FuncParamValidity
     360             : {
     361             :     FUNC_PARAM_NONE = 0,        /// Default for an unspecified entry in a C-array.
     362             :     FUNC_PARAM_REGULAR,         /// Parameter supported by Calc and Excel.
     363             :     FUNC_PARAM_CALCONLY,        /// Parameter supported by Calc only.
     364             :     FUNC_PARAM_EXCELONLY        /// Parameter supported by Excel only.
     365             : };
     366             : 
     367             : /** Enumerates different types of token class conversion in function parameters. */
     368             : enum FuncParamConversion
     369             : {
     370             :     FUNC_PARAMCONV_ORG,         /// Use original class of current token.
     371             :     FUNC_PARAMCONV_VAL,         /// Convert tokens to VAL class.
     372             :     FUNC_PARAMCONV_ARR,         /// Convert tokens to ARR class.
     373             :     FUNC_PARAMCONV_RPT,         /// Repeat parent conversion in VALTYPE parameters.
     374             :     FUNC_PARAMCONV_RPX,         /// Repeat parent conversion in REFTYPE parameters.
     375             :     FUNC_PARAMCONV_RPO          /// Repeat parent conversion in operands of operators.
     376             : };
     377             : 
     378             : /** Structure that contains all needed information for a parameter in a
     379             :     function.
     380             : 
     381             :     The member meValid specifies which application supports the parameter. If
     382             :     set to CALCONLY, import filters have to insert a default value for this
     383             :     parameter, and export filters have to skip the parameter. If set to
     384             :     EXCELONLY, import filters have to skip the parameter, and export filters
     385             :     have to insert a default value for this parameter.
     386             : 
     387             :     The member mbValType specifies whether the parameter requires tokens to be
     388             :     of value type (VAL or ARR class).
     389             : 
     390             :         If set to false, the parameter is called to be REFTYPE. Tokens with REF
     391             :         default class can be inserted for the parameter (e.g. tAreaR tokens).
     392             : 
     393             :         If set to true, the parameter is called to be VALTYPE. Tokens with REF
     394             :         class need to be converted to VAL tokens first (e.g. tAreaR will be
     395             :         converted to tAreaV), and further conversion is done according to this
     396             :         new token class.
     397             : 
     398             :     The member meConv specifies how to convert the current token class of the
     399             :     token inserted for the parameter. If the token class is still REF this
     400             :     means that the token has default REF class and the parameter is REFTYPE
     401             :     (see member mbValType), the token will not be converted at all and remains
     402             :     in REF class. Otherwise, token class conversion is depending on the actual
     403             :     token class of the return value of the function containing this parameter.
     404             :     The function may return REF class (tFuncR, tFuncVarR, tFuncCER), or it may
     405             :     return VAL or ARR class (tFuncV, tFuncA, tFuncVarV, tFuncVarA, tFuncCEV,
     406             :     tFuncCEA). Even if the function is able to return REF class, it may return
     407             :     VAL or ARR class instead due to the VALTYPE data type of the parent
     408             :     function parameter that calls the own function. Example: The INDIRECT
     409             :     function returns REF class by default. But if called from a VALTYPE
     410             :     function parameter, e.g. in the formula =ABS(INDIRECT("A1")), it returns
     411             :     VAL or ARR class instead. Additionally, the repeating conversion types RPT
     412             :     and RPX rely on the conversion executed for the function token class.
     413             : 
     414             :         1) ORG:
     415             :         Use the original class of the token (VAL or ARR), regardless of any
     416             :         conversion done for the function return class.
     417             : 
     418             :         2) VAL:
     419             :         Convert ARR tokens to VAL class, regardless of any conversion done for
     420             :         the function return class.
     421             : 
     422             :         3) ARR:
     423             :         Convert VAL tokens to ARR class, regardless of any conversion done for
     424             :         the function return class.
     425             : 
     426             :         4) RPT:
     427             :         If the own function returns REF class (thus it is called from a REFTYPE
     428             :         parameter, see above), and the parent conversion type (for the function
     429             :         return class) was ORG, VAL, or ARR, ignore that conversion and always
     430             :         use VAL conversion for the own token instead. If the parent conversion
     431             :         type was RPT or RPX, repeat the conversion that would have been used if
     432             :         the function would return value type.
     433             :         If the own function returns value type (VAL or ARR class, see above),
     434             :         and the parent conversion type (for the function return class) was ORG,
     435             :         VAL, ARR, or RPT, repeat this conversion for the own token. If the
     436             :         parent conversion type was RPX, always use ORG conversion type for the
     437             :         own token instead.
     438             : 
     439             :         5) RPX:
     440             :         This type of conversion only occurs in functions returning VAL class by
     441             :         default. If the own token is value type, and the VAL return class of
     442             :         the own function has been changed to ARR class (due to direct ARR
     443             :         conversion, or due to ARR conversion repeated by RPT or RPX), set the
     444             :         own token to ARR type. Otherwise use the original token type (VAL
     445             :         conversion from parent parameter will not be repeated at all). If
     446             :         nested functions have RPT or value-type RPX parameters, they will not
     447             :         repeat this conversion type, but will use ORG conversion instead (see
     448             :         description of RPT above).
     449             : 
     450             :         6) RPO:
     451             :         This type of conversion is only used for the operands of all operators
     452             :         (unary and binary arithmetic operators, comparison operators, and range
     453             :         operators). It is not used for function parameters. On conversion, it
     454             :         will be replaced by the last conversion type that was not the RPO
     455             :         conversion. This leads to a slightly different behaviour than the RPT
     456             :         conversion for operands in conjunction with a parent RPX conversion.
     457             :  */
     458             : struct FunctionParamInfo
     459             : {
     460             :     FuncParamValidity   meValid;        /// Parameter validity.
     461             :     FuncParamConversion meConv;         /// Token class conversion type.
     462             :     bool                mbValType;      /// Data type (false = REFTYPE, true = VALTYPE).
     463             : };
     464             : 
     465             : // Function data ==============================================================
     466             : 
     467             : /** This enumeration contains constants for all known external libraries
     468             :     containing supported sheet functions. */
     469             : enum FunctionLibraryType
     470             : {
     471             :     FUNCLIB_UNKNOWN = 0,        /// Unknown library (must be zero).
     472             :     FUNCLIB_EUROTOOL            /// EuroTool add-in with EUROCONVERT function.
     473             : };
     474             : 
     475             : // ----------------------------------------------------------------------------
     476             : 
     477             : /** Represents information for a spreadsheet function.
     478             : 
     479             :     The member mpParamInfos points to a C-array of type information structures
     480             :     for all parameters of the function. The last initialized structure
     481             :     describing a regular parameter (member meValid == FUNC_PARAM_REGULAR) in
     482             :     this array is used repeatedly for all following parameters supported by a
     483             :     function.
     484             :  */
     485        9460 : struct FunctionInfo
     486             : {
     487             :     ::rtl::OUString     maOdfFuncName;      /// ODF function name.
     488             :     ::rtl::OUString     maOoxFuncName;      /// OOXML function name.
     489             :     ::rtl::OUString     maBiffMacroName;    /// Expected macro name in EXTERN.CALL function.
     490             :     ::rtl::OUString     maExtProgName;      /// Programmatic function name for external functions.
     491             :     FunctionLibraryType meFuncLibType;      /// The external library this function is part of.
     492             :     sal_Int32           mnApiOpCode;        /// API function opcode.
     493             :     sal_uInt16          mnBiff12FuncId;     /// BIFF12 function identifier.
     494             :     sal_uInt16          mnBiffFuncId;       /// BIFF2-BIFF8 function identifier.
     495             :     sal_uInt8           mnMinParamCount;    /// Minimum number of parameters.
     496             :     sal_uInt8           mnMaxParamCount;    /// Maximum number of parameters.
     497             :     sal_uInt8           mnRetClass;         /// BIFF token class of the return value.
     498             :     const FunctionParamInfo* mpParamInfos;  /// Information about all parameters.
     499             :     bool                mbParamPairs;       /// True = optional parameters are expected to appear in pairs.
     500             :     bool                mbVolatile;         /// True = volatile function.
     501             :     bool                mbExternal;         /// True = external function in Calc.
     502             :     bool                mbMacroFunc;        /// True = macro sheet function or command.
     503             :     bool                mbVarParam;         /// True = use a tFuncVar token, also if min/max are equal.
     504             : };
     505             : 
     506             : typedef RefVector< FunctionInfo > FunctionInfoVector;
     507             : 
     508             : // Function info parameter class iterator =====================================
     509             : 
     510             : /** Iterator working on the mpParamInfos member of the FunctionInfo struct.
     511             : 
     512             :     This iterator can be used to iterate through the array containing the
     513             :     token class conversion information of function parameters. This iterator
     514             :     repeats the last valid structure in the array - it stops automatically
     515             :     before the first empty array entry or before the end of the array, even for
     516             :     repeated calls to the increment operator.
     517             :  */
     518             : class FunctionParamInfoIterator
     519             : {
     520             : public:
     521             :     explicit            FunctionParamInfoIterator( const FunctionInfo& rFuncInfo );
     522             : 
     523             :     bool                isCalcOnlyParam() const;
     524             :     bool                isExcelOnlyParam() const;
     525             :     FunctionParamInfoIterator& operator++();
     526             : 
     527             : private:
     528             :     const FunctionParamInfo* mpParamInfo;
     529             :     const FunctionParamInfo* mpParamInfoEnd;
     530             :     bool                mbParamPairs;
     531             : };
     532             : 
     533             : // Base function provider =====================================================
     534             : 
     535             : struct FunctionProviderImpl;
     536             : 
     537             : /** Provides access to function info structs for all available sheet functions.
     538             :  */
     539          22 : class FunctionProvider  // not derived from WorkbookHelper to make it usable in file dumpers
     540             : {
     541             : public:
     542             :     explicit            FunctionProvider( FilterType eFilter, BiffType eBiff, bool bImportFilter );
     543             :     virtual             ~FunctionProvider();
     544             : 
     545             :     /** Returns the function info for an OOXML function name, or 0 on error. */
     546             :     const FunctionInfo* getFuncInfoFromOoxFuncName( const ::rtl::OUString& rFuncName ) const;
     547             : 
     548             :     /** Returns the function info for a BIFF12 function index, or 0 on error. */
     549             :     const FunctionInfo* getFuncInfoFromBiff12FuncId( sal_uInt16 nFuncId ) const;
     550             : 
     551             :     /** Returns the function info for a BIFF2-BIFF8 function index, or 0 on error. */
     552             :     const FunctionInfo* getFuncInfoFromBiffFuncId( sal_uInt16 nFuncId ) const;
     553             : 
     554             :     /** Returns the function info for a macro function referred by the
     555             :         EXTERN.CALL function, or 0 on error. */
     556             :     const FunctionInfo* getFuncInfoFromMacroName( const ::rtl::OUString& rFuncName ) const;
     557             : 
     558             :     /** Returns the library type associated with the passed URL of a function
     559             :         library (function add-in). */
     560             :     FunctionLibraryType getFuncLibTypeFromLibraryName( const ::rtl::OUString& rLibraryName ) const;
     561             : 
     562             : protected:
     563             :     /** Returns the list of all function infos. */
     564             :     const FunctionInfoVector& getFuncs() const;
     565             : 
     566             : private:
     567             :     typedef ::boost::shared_ptr< FunctionProviderImpl > FunctionProviderImplRef;
     568             :     FunctionProviderImplRef mxFuncImpl;     /// Shared implementation between all copies of the provider.
     569             : };
     570             : 
     571             : // Op-code and function provider ==============================================
     572             : 
     573             : struct OpCodeProviderImpl;
     574             : 
     575             : /** Provides access to API op-codes for all available formula tokens and to
     576             :     function info structs for all available sheet functions.
     577             :  */
     578          22 : class OpCodeProvider : public FunctionProvider // not derived from WorkbookHelper to make it usable as UNO service
     579             : {
     580             : public:
     581             :     explicit            OpCodeProvider(
     582             :                             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory,
     583             :                             FilterType eFilter, BiffType eBiff, bool bImportFilter );
     584             :     virtual             ~OpCodeProvider();
     585             : 
     586             :     /** Returns the structure containing all token op-codes for operators and
     587             :         special tokens used by the Calc document and its formula parser. */
     588             :     const ApiOpCodes&   getOpCodes() const;
     589             : 
     590             :     /** Returns the function info for an API token, or 0 on error. */
     591             :     const FunctionInfo* getFuncInfoFromApiToken( const ApiToken& rToken ) const;
     592             : 
     593             :     /** Returns the op-code map that is used by the OOXML formula parser. */
     594             :     ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaOpCodeMapEntry >
     595             :                         getOoxParserMap() const;
     596             : 
     597             : private:
     598             :     typedef ::boost::shared_ptr< OpCodeProviderImpl > OpCodeProviderImplRef;
     599             :     OpCodeProviderImplRef mxOpCodeImpl;     /// Shared implementation between all copies of the provider.
     600             : };
     601             : 
     602             : // API formula parser wrapper =================================================
     603             : 
     604             : /** A wrapper around the FormulaParser service provided by the Calc document. */
     605          11 : class ApiParserWrapper : public OpCodeProvider
     606             : {
     607             : public:
     608             :     explicit            ApiParserWrapper(
     609             :                             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxModelFactory,
     610             :                             const OpCodeProvider& rOpCodeProv );
     611             : 
     612             :     /** Returns read/write access to the formula parser property set. */
     613           7 :     inline PropertySet& getParserProperties() { return maParserProps; }
     614             : 
     615             :     /** Calls the XFormulaParser::parseFormula() function of the API parser. */
     616             :     ApiTokenSequence    parseFormula(
     617             :                             const ::rtl::OUString& rFormula,
     618             :                             const ::com::sun::star::table::CellAddress& rRefPos );
     619             : 
     620             : private:
     621             :     ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser >
     622             :                         mxParser;
     623             :     PropertySet         maParserProps;
     624             : };
     625             : 
     626             : // Formula parser/printer base class for filters ==============================
     627             : 
     628             : /** Base class for import formula parsers and export formula compilers. */
     629          11 : class FormulaProcessorBase : public OpCodeProvider, protected ApiOpCodes, public WorkbookHelper
     630             : {
     631             : public:
     632             :     explicit            FormulaProcessorBase( const WorkbookHelper& rHelper );
     633             : 
     634             :     // ------------------------------------------------------------------------
     635             : 
     636             :     /** Generates a cell address string in A1 notation from the passed cell
     637             :         address.
     638             : 
     639             :         @param rAddress  The cell address containing column and row index.
     640             :         @param bAbsolute  True = adds dollar signs before column and row.
     641             :      */
     642             :     static ::rtl::OUString generateAddress2dString(
     643             :                             const ::com::sun::star::table::CellAddress& rAddress,
     644             :                             bool bAbsolute );
     645             : 
     646             :     /** Generates a cell address string in A1 notation from the passed binary
     647             :         cell address.
     648             : 
     649             :         @param rAddress  The cell address containing column and row index.
     650             :         @param bAbsolute  True = adds dollar signs before column and row.
     651             :      */
     652             :     static ::rtl::OUString generateAddress2dString(
     653             :                             const BinAddress& rAddress,
     654             :                             bool bAbsolute );
     655             : 
     656             :     // ------------------------------------------------------------------------
     657             : 
     658             :     /** Generates a string in Calc formula notation from the passed string.
     659             : 
     660             :         @param rString  The string value.
     661             : 
     662             :         @return  The string enclosed in double quotes, where all contained
     663             :             quote characters are doubled.
     664             :      */
     665             :     static ::rtl::OUString generateApiString( const ::rtl::OUString& rString );
     666             : 
     667             :     /** Generates an array string in Calc formula notation from the passed
     668             :         matrix with Any's containing double values or strings.
     669             : 
     670             :         @param rMatrix  The matrix containing double values or strings.
     671             :      */
     672             :     static ::rtl::OUString generateApiArray( const Matrix< ::com::sun::star::uno::Any >& rMatrix );
     673             : 
     674             :     // ------------------------------------------------------------------------
     675             : 
     676             :     /** Tries to extract a single cell reference from a formula token sequence.
     677             : 
     678             :         @param rTokens  The token sequence to be parsed. Should contain exactly
     679             :             one address token or cell range address token. The token sequence
     680             :             may contain whitespace tokens.
     681             : 
     682             :         @return  If the token sequence is valid, this function returns an Any
     683             :             containing a com.sun.star.sheet.SingleReference object, or a
     684             :             com.sun.star.sheet.ComplexReference object. If the token sequence
     685             :             contains too many, or unexpected tokens, an empty Any is returned.
     686             :      */
     687             :     ::com::sun::star::uno::Any
     688             :                         extractReference( const ApiTokenSequence& rTokens ) const;
     689             : 
     690             :     /** Tries to extract a cell range address from a formula token sequence.
     691             : 
     692             :         @param orAddress  (output parameter) If the token sequence is valid,
     693             :             this parameter will contain the extracted cell range address. If
     694             :             the token sequence contains unexpected tokens, nothing meaningful
     695             :             is inserted, and the function returns false.
     696             : 
     697             :         @param rTokens  The token sequence to be parsed. Should contain exactly
     698             :             one cell range address token. The token sequence may contain
     699             :             whitespace tokens.
     700             : 
     701             :         @param bAllowRelative  True = it is allowed that rTokens contains
     702             :             relative references (based on cell A1 of the current sheet).
     703             :             False = only real absolute references will be accepted.
     704             : 
     705             :         @return  True, if the token sequence contains a valid cell range
     706             :             address which has been extracted to orRange, false otherwise.
     707             :      */
     708             :     bool                extractCellRange(
     709             :                             ::com::sun::star::table::CellRangeAddress& orRange,
     710             :                             const ApiTokenSequence& rTokens,
     711             :                             bool bAllowRelative ) const;
     712             : 
     713             :     /** Tries to extract a cell range list from a formula token sequence.
     714             : 
     715             :         @param orRanges  (output parameter) If the token sequence is valid,
     716             :             this parameter will contain the extracted cell range list. Deleted
     717             :             cells or cell ranges (shown as #REF! error in a formula) will be
     718             :             skipped. If the token sequence contains unexpected tokens, an empty
     719             :             list is returned here.
     720             : 
     721             :         @param rTokens  The token sequence to be parsed. Should contain cell
     722             :             address tokens or cell range address tokens, separated by the
     723             :             standard function parameter separator token. The token sequence may
     724             :             contain parentheses and whitespace tokens.
     725             : 
     726             :         @param bAllowRelative  True = it is allowed that rTokens contains
     727             :             relative references (based on cell A1 of the current sheet).
     728             :             False = only real absolute references will be accepted.
     729             : 
     730             :         @param nFilterBySheet  If non-negative, this function returns only cell
     731             :             ranges located in the specified sheet, otherwise returns all cell
     732             :             ranges contained in the token sequence.
     733             :      */
     734             :     void                extractCellRangeList(
     735             :                             ApiCellRangeList& orRanges,
     736             :                             const ApiTokenSequence& rTokens,
     737             :                             bool bAllowRelative,
     738             :                             sal_Int32 nFilterBySheet = -1 ) const;
     739             : 
     740             :     /** Tries to extract a string from a formula token sequence.
     741             : 
     742             :         @param orString  (output parameter) The extracted string.
     743             : 
     744             :         @param rTokens  The token sequence to be parsed. Should contain exactly
     745             :             one string token, may contain whitespace tokens.
     746             : 
     747             :         @return  True = token sequence is valid, output parameter orString
     748             :             contains the string extracted from the token sequence.
     749             :      */
     750             :     bool                extractString(
     751             :                             ::rtl::OUString& orString,
     752             :                             const ApiTokenSequence& rTokens ) const;
     753             : 
     754             :     /** Tries to extract information about a special token used for array
     755             :         formulas, shared formulas, or table operations.
     756             : 
     757             :         @param orTokenInfo  (output parameter) The extracted information about
     758             :             the token. Contains the base address and the token type (sal_False
     759             :             for array or shared formulas, sal_True for table operations).
     760             : 
     761             :         @param rTokens  The token sequence to be parsed. If it contains exactly
     762             :             one OPCODE_BAD token with special token information, this
     763             :             information will be extracted.
     764             : 
     765             :         @return  True = token sequence is valid, output parameter orTokenInfo
     766             :             contains the token information extracted from the token sequence.
     767             :      */
     768             :     bool                extractSpecialTokenInfo(
     769             :                             ApiSpecialTokenInfo& orTokenInfo,
     770             :                             const ApiTokenSequence& rTokens ) const;
     771             : 
     772             :     /** Converts a single string with separators in the passed formula token
     773             :         sequence to a list of string tokens.
     774             : 
     775             :         @param orTokens  (input/output parameter) Expects a single string token
     776             :             in this token sequence (whitespace tokens are allowed). The string
     777             :             is split into substrings. A list of string tokens separated with
     778             :             parameter separator tokens is returned in this psrameter.
     779             : 
     780             :         @param cStringSep  The separator character used to split the input
     781             :             string.
     782             : 
     783             :         @param bTrimLeadingSpaces  True = removes leading whitespace from all
     784             :             substrings inserted into the formula token sequence.
     785             :      */
     786             :     void                convertStringToStringList(
     787             :                             ApiTokenSequence& orTokens,
     788             :                             sal_Unicode cStringSep,
     789             :                             bool bTrimLeadingSpaces ) const;
     790             : };
     791             : 
     792             : // ============================================================================
     793             : 
     794             : } // namespace xls
     795             : } // namespace oox
     796             : 
     797             : #endif
     798             : 
     799             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10