23 #include <tokenarray.hxx>
55 #define RO { EXC_PARAM_REGULAR, EXC_PARAMCONV_ORG, false }
56 #define RA { EXC_PARAM_REGULAR, EXC_PARAMCONV_ARR, false }
57 #define RR { EXC_PARAM_REGULAR, EXC_PARAMCONV_RPT, false }
58 #define RX { EXC_PARAM_REGULAR, EXC_PARAMCONV_RPX, false }
59 #define VO { EXC_PARAM_REGULAR, EXC_PARAMCONV_ORG, true }
60 #define VV { EXC_PARAM_REGULAR, EXC_PARAMCONV_VAL, true }
61 #define VA { EXC_PARAM_REGULAR, EXC_PARAMCONV_ARR, true }
62 #define VR { EXC_PARAM_REGULAR, EXC_PARAMCONV_RPT, true }
63 #define VX { EXC_PARAM_REGULAR, EXC_PARAMCONV_RPX, true }
64 #define RO_E { EXC_PARAM_EXCELONLY, EXC_PARAMCONV_ORG, false }
65 #define VR_E { EXC_PARAM_EXCELONLY, EXC_PARAMCONV_RPT, true }
66 #define C { EXC_PARAM_CALCONLY, EXC_PARAMCONV_ORG, false }
71 #define EXC_FUNCNAME( ascii ) "_xlfn." ascii
72 #define EXC_FUNCNAME_ODF( ascii ) "_xlfnodf." ascii
73 #define EXC_FUNCNAME_ADDIN( ascii ) "com.sun.star.sheet.addin." ascii
79 {
ocIf, 1, 2, 3,
R, {
VO,
RO }, 0,
nullptr },
80 {
ocIsNA, 2, 1, 1,
V, {
VR }, 0,
nullptr },
86 {
ocRow, 8, 0, 1,
V, {
RO }, 0,
nullptr },
92 {
ocFixed, 14, 1, 2,
V, {
VR,
VR,
C }, 0,
nullptr },
93 {
ocSin, 15, 1, 1,
V, {
VR }, 0,
nullptr },
95 {
ocCos, 16, 1, 1,
V, {
VR }, 0,
nullptr },
97 {
ocTan, 17, 1, 1,
V, {
VR }, 0,
nullptr },
101 {
ocPi, 19, 0, 0,
V, {}, 0,
nullptr },
102 {
ocSqrt, 20, 1, 1,
V, {
VR }, 0,
nullptr },
103 {
ocExp, 21, 1, 1,
V, {
VR }, 0,
nullptr },
104 {
ocLn, 22, 1, 1,
V, {
VR }, 0,
nullptr },
106 {
ocAbs, 24, 1, 1,
V, {
VR }, 0,
nullptr },
107 {
ocInt, 25, 1, 1,
V, {
VR }, 0,
nullptr },
112 {
ocRept, 30, 2, 2,
V, {
VR }, 0,
nullptr },
113 {
ocMid, 31, 3, 3,
V, {
VR }, 0,
nullptr },
114 {
ocLen, 32, 1, 1,
V, {
VR }, 0,
nullptr },
116 {
ocTrue, 34, 0, 0,
V, {}, 0,
nullptr },
117 {
ocFalse, 35, 0, 0,
V, {}, 0,
nullptr },
119 {
ocOr, 37, 1,
MX,
V, {
RX }, 0,
nullptr },
120 {
ocNot, 38, 1, 1,
V, {
VR }, 0,
nullptr },
121 {
ocMod, 39, 2, 2,
V, {
VR }, 0,
nullptr },
130 {
ocText, 48, 2, 2,
V, {
VR }, 0,
nullptr },
131 {
ocLinest, 49, 1, 2,
A, {
RA,
RA,
C, C }, 0,
nullptr },
132 {
ocTrend, 50, 1, 3,
A, {
RA,
RA,
RA,
C }, 0,
nullptr },
133 {
ocLogest, 51, 1, 2,
A, {
RA,
RA,
C, C }, 0,
nullptr },
134 {
ocGrowth, 52, 1, 3,
A, {
RA,
RA,
RA,
C }, 0,
nullptr },
135 {
ocPV, 56, 3, 5,
V, {
VR }, 0,
nullptr },
136 {
ocFV, 57, 3, 5,
V, {
VR }, 0,
nullptr },
137 {
ocNper, 58, 3, 5,
V, {
VR }, 0,
nullptr },
138 {
ocPMT, 59, 3, 5,
V, {
VR }, 0,
nullptr },
139 {
ocRate, 60, 3, 6,
V, {
VR }, 0,
nullptr },
141 {
ocIRR, 62, 1, 2,
V, {
RA,
VR }, 0,
nullptr },
143 {
ocMatch, 64, 2, 3,
V, {
VR,
RX,
RR }, 0,
nullptr },
155 {
ocRows, 76, 1, 1,
V, {
RO }, 0,
nullptr },
160 {
ocType, 86, 1, 1,
V, {
VX }, 0,
nullptr },
165 {
ocHLookup, 101, 3, 3,
V, {
VV,
RO,
RO,
C }, 0,
nullptr },
166 {
ocVLookup, 102, 3, 3,
V, {
VV,
RO,
RO,
C }, 0,
nullptr },
167 {
ocIsRef, 105, 1, 1,
V, {
RX }, 0,
nullptr },
168 {
ocLog, 109, 1, 2,
V, {
VR }, 0,
nullptr },
169 {
ocChar, 111, 1, 1,
V, {
VR }, 0,
nullptr },
170 {
ocLower, 112, 1, 1,
V, {
VR }, 0,
nullptr },
171 {
ocUpper, 113, 1, 1,
V, {
VR }, 0,
nullptr },
173 {
ocLeft, 115, 1, 2,
V, {
VR }, 0,
nullptr },
174 {
ocRight, 116, 1, 2,
V, {
VR }, 0,
nullptr },
175 {
ocExact, 117, 2, 2,
V, {
VR }, 0,
nullptr },
176 {
ocTrim, 118, 1, 1,
V, {
VR }, 0,
nullptr },
179 {
ocCode, 121, 1, 1,
V, {
VR }, 0,
nullptr },
180 {
ocFind, 124, 2, 3,
V, {
VR }, 0,
nullptr },
182 {
ocIsErr, 126, 1, 1,
V, {
VR }, 0,
nullptr },
186 {
ocT, 130, 1, 1,
V, {
RO }, 0,
nullptr },
187 {
ocN, 131, 1, 1,
V, {
RO }, 0,
nullptr },
190 {
ocSLN, 142, 3, 3,
V, {
VR }, 0,
nullptr },
191 {
ocSYD, 143, 4, 4,
V, {
VR }, 0,
nullptr },
192 {
ocDDB, 144, 4, 5,
V, {
VR }, 0,
nullptr },
194 {
ocClean, 162, 1, 1,
V, {
VR }, 0,
nullptr },
198 {
ocIpmt, 167, 4, 6,
V, {
VR }, 0,
nullptr },
199 {
ocPpmt, 168, 4, 6,
V, {
VR }, 0,
nullptr },
202 {
ocFact, 184, 1, 1,
V, {
VR }, 0,
nullptr },
213 {
ocFindB, 205, 2, 3,
V, {
VR }, 0,
nullptr },
216 {
ocLeftB, 208, 1, 2,
V, {
VR }, 0,
nullptr },
218 {
ocMidB, 210, 3, 3,
V, {
VR }, 0,
nullptr },
219 {
ocLenB, 211, 1, 1,
V, {
VR }, 0,
nullptr },
228 {
ocLinest, 49, 1, 4,
A, {
RA,
RA,
VV }, 0,
nullptr },
229 {
ocTrend, 50, 1, 4,
A, {
RA,
RA,
RA,
VV }, 0,
nullptr },
230 {
ocLogest, 51, 1, 4,
A, {
RA,
RA,
VV }, 0,
nullptr },
231 {
ocGrowth, 52, 1, 4,
A, {
RA,
RA,
RA,
VV }, 0,
nullptr },
232 {
ocTrunc, 197, 1, 2,
V, {
VR }, 0,
nullptr },
234 {
ocGetDiffDate360, 220, 2, 2,
V, {
VR,
VR,
C }, 0,
nullptr },
236 {
ocVBD, 222, 5, 7,
V, {
VR }, 0,
nullptr },
257 {
ocAsc, 214, 1, 1,
V, {
VR }, 0,
nullptr },
258 {
ocJis, 215, 1, 1,
V, {
VR }, 0,
nullptr },
259 {
ocRank, 216, 2, 3,
V, {
VR,
RO,
VR }, 0,
nullptr },
260 {
ocDB, 247, 4, 5,
V, {
VR }, 0,
nullptr },
273 {
ocEven, 279, 1, 1,
V, {
VR }, 0,
nullptr },
275 {
ocFDist, 281, 3, 3,
V, {
VR }, 0,
nullptr },
276 {
ocFInv, 282, 3, 3,
V, {
VR }, 0,
nullptr },
292 {
ocOdd, 298, 1, 1,
V, {
VR }, 0,
nullptr },
295 {
ocTDist, 301, 3, 3,
V, {
VR }, 0,
nullptr },
302 {
ocCovar, 308, 2, 2,
V, {
VA }, 0,
nullptr },
304 {
ocFTest, 310, 2, 2,
V, {
VA }, 0,
nullptr },
307 {
ocRSQ, 313, 2, 2,
V, {
VA }, 0,
nullptr },
308 {
ocSTEYX, 314, 2, 2,
V, {
VA }, 0,
nullptr },
309 {
ocSlope, 315, 2, 2,
V, {
VA }, 0,
nullptr },
310 {
ocTTest, 316, 4, 4,
V, {
VA,
VA,
VR }, 0,
nullptr },
311 {
ocProb, 317, 3, 4,
V, {
VA,
VA,
VR }, 0,
nullptr },
323 {
ocPercentrank, 329, 2, 3,
V, {
RX,
VR,
VR_E }, 0,
nullptr },
326 {
ocTInv, 332, 2, 2,
V, {
VR }, 0,
nullptr },
346 {
ocHLookup, 101, 3, 4,
V, {
VV,
RO,
RO,
VV }, 0,
nullptr },
347 {
ocVLookup, 102, 3, 4,
V, {
VV,
RO,
RO,
VV }, 0,
nullptr },
352 {
ocPower, 337, 2, 2,
V, {
VR }, 0,
nullptr },
353 {
ocRad, 342, 1, 1,
V, {
VR }, 0,
nullptr },
354 {
ocDeg, 343, 1, 1,
V, {
VR }, 0,
nullptr },
356 {
ocSumIf, 345, 2, 3,
V, {
RO,
VR,
RO }, 0,
nullptr },
359 {
ocISPMT, 350, 4, 4,
V, {
VR }, 0,
nullptr },
369 {
ocGetPivotData, 358, 2,
MX,
V, {
RR,
RR,
VR }, 0,
nullptr },
384 #define EXC_FUNCENTRY_V_VR( opcode, minparam, maxparam, flags, asciiname ) \
385 { opcode, NOID, minparam, maxparam, V, { VR }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }, \
386 { opcode, 255, (minparam)+1, (maxparam)+1, V, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }
392 {
ocCountIfs, 255, 3,
MX,
V, {
RO_E,
RO,
VR },
EXC_FUNCFLAG_EXPORTONLY|
EXC_FUNCFLAG_PARAMPAIRS,
EXC_FUNCNAME(
"COUNTIFS" ) },
393 {
ocSumIfs,
NOID, 3,
MX,
V, {
RO,
RO,
VR },
EXC_FUNCFLAG_IMPORTONLY|
EXC_FUNCFLAG_PARAMPAIRS,
EXC_FUNCNAME(
"SUMIFS" ) },
394 {
ocSumIfs, 255, 4,
MX,
V, {
RO_E,
RO,
RO,
VR },
EXC_FUNCFLAG_EXPORTONLY|
EXC_FUNCFLAG_PARAMPAIRS,
EXC_FUNCNAME(
"SUMIFS" ) },
395 {
ocAverageIf,
NOID, 2, 3,
V, {
RO,
VR,
RO },
EXC_FUNCFLAG_IMPORTONLY,
EXC_FUNCNAME(
"AVERAGEIF" ) },
396 {
ocAverageIf, 255, 3, 4,
V, {
RO_E,
RO,
VR, RO },
EXC_FUNCFLAG_EXPORTONLY,
EXC_FUNCNAME(
"AVERAGEIF" ) },
397 {
ocAverageIfs,
NOID, 3,
MX,
V, {
RO,
RO,
VR },
EXC_FUNCFLAG_IMPORTONLY|
EXC_FUNCFLAG_PARAMPAIRS,
EXC_FUNCNAME(
"AVERAGEIFS" ) },
398 {
ocAverageIfs, 255, 4,
MX,
V, {
RO_E,
RO,
RO,
VR },
EXC_FUNCFLAG_EXPORTONLY|
EXC_FUNCFLAG_PARAMPAIRS,
EXC_FUNCNAME(
"AVERAGEIFS" ) },
400 {
ocIfError, 255, 3, 3,
V, {
RO_E,
VO,
RO },
EXC_FUNCFLAG_EXPORTONLY,
EXC_FUNCNAME(
"IFERROR" ) },
401 {
ocNetWorkdays_MS,
NOID, 2, 4,
V, {
VR,
VR,
RO, RO },
EXC_FUNCFLAG_IMPORTONLY,
EXC_FUNCNAME(
"NETWORKDAYS.INTL" ) },
402 {
ocNetWorkdays_MS, 255, 3, 5,
V, {
RO_E,
VR,
VR,
RO, RO },
EXC_FUNCFLAG_EXPORTONLY,
EXC_FUNCNAME(
"NETWORKDAYS.INTL" ) },
403 {
ocWorkday_MS,
NOID, 2, 4,
V, {
VR,
VR,
VR,
RO },
EXC_FUNCFLAG_IMPORTONLY,
EXC_FUNCNAME(
"WORKDAY.INTL" ) },
404 {
ocWorkday_MS, 255, 3, 5,
V, {
RO_E,
VR,
VR,
VR,
RO },
EXC_FUNCFLAG_EXPORTONLY,
EXC_FUNCNAME(
"WORKDAY.INTL" ) },
408 #define EXC_FUNCENTRY_V_VR_IMPORT( opcode, minparam, maxparam, flags, asciiname ) \
409 { opcode, NOID, minparam, maxparam, V, { VR }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }
411 #define EXC_FUNCENTRY_V_RO_EXPORT( opcode, minparam, maxparam, flags, asciiname ) \
412 { opcode, 255, (minparam)+1, (maxparam)+1, V, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }
414 #define EXC_FUNCENTRY_A_VR( opcode, minparam, maxparam, flags, asciiname ) \
415 { opcode, NOID, minparam, maxparam, A, { VR }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }, \
416 { opcode, 255, (minparam)+1, (maxparam)+1, A, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }
418 #define EXC_FUNCENTRY_V_RO( opcode, minparam, maxparam, flags, asciiname ) \
419 { opcode, NOID, minparam, maxparam, V, { RO }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }, \
420 { opcode, 255, (minparam)+1, (maxparam)+1, V, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }
423 #define EXC_FUNCENTRY_V_RX( opcode, minparam, maxparam, flags, asciiname ) \
424 { opcode, NOID, minparam, MX, V, { RX }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }, \
425 { opcode, 255, (minparam)+1, MX, V, { RO_E, RX }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }
427 #define EXC_FUNCENTRY_V_VA( opcode, minparam, maxparam, flags, asciiname ) \
428 { opcode, NOID, minparam, maxparam, V, { VA }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }, \
429 { opcode, 255, (minparam)+1, (maxparam)+1, V, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }
550 {
ocIfNA, 255, 3, 3,
V, {
RO_E,
VO,
RO },
EXC_FUNCFLAG_EXPORTONLY,
EXC_FUNCNAME(
"IFNA" ) },
596 #define EXC_FUNCENTRY_ODF( opcode, minparam, maxparam, flags, asciiname ) \
597 { opcode, NOID, minparam, maxparam, V, { VR }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME_ODF( asciiname ) }, \
598 { opcode, 255, (minparam)+1, (maxparam)+1, V, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME_ODF( asciiname ) }
607 #undef EXC_FUNCENTRY_ODF
609 #define EXC_FUNCENTRY_OOO( opcode, minparam, maxparam, flags, asciiname ) \
610 { opcode, NOID, minparam, maxparam, V, { VR }, EXC_FUNCFLAG_IMPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }, \
611 { opcode, 255, (minparam)+1, (maxparam)+1, V, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY|(flags), EXC_FUNCNAME( asciiname ) }
614 #define EXC_FUNCENTRY_OOO_IBR( opcode, minparam, maxparam, flags, asciiname ) \
615 { opcode, NOID, minparam, maxparam, V, { VR }, EXC_FUNCFLAG_IMPORTONLY|(flags), asciiname }
646 #undef EXC_FUNCENTRY_OOO_IBR
647 #undef EXC_FUNCENTRY_OOO
659 (this->*pFillFunc)(saFuncTable_2, saFuncTable_2 +
SAL_N_ELEMENTS(saFuncTable_2));
661 (this->*pFillFunc)(saFuncTable_3, saFuncTable_3 +
SAL_N_ELEMENTS(saFuncTable_3));
663 (this->*pFillFunc)(saFuncTable_4, saFuncTable_4 +
SAL_N_ELEMENTS(saFuncTable_4));
665 (this->*pFillFunc)(saFuncTable_5, saFuncTable_5 +
SAL_N_ELEMENTS(saFuncTable_5));
667 (this->*pFillFunc)(saFuncTable_8, saFuncTable_8 +
SAL_N_ELEMENTS(saFuncTable_8));
668 (this->*pFillFunc)(saFuncTable_Oox, saFuncTable_Oox +
SAL_N_ELEMENTS(saFuncTable_Oox));
669 (this->*pFillFunc)(saFuncTable_2010, saFuncTable_2010 +
SAL_N_ELEMENTS(saFuncTable_2010));
670 (this->*pFillFunc)(saFuncTable_2013, saFuncTable_2013 +
SAL_N_ELEMENTS(saFuncTable_2013));
671 (this->*pFillFunc)(saFuncTable_2016, saFuncTable_2016 +
SAL_N_ELEMENTS(saFuncTable_2016));
672 (this->*pFillFunc)(saFuncTable_Odf, saFuncTable_Odf +
SAL_N_ELEMENTS(saFuncTable_Odf));
673 (this->*pFillFunc)(saFuncTable_OOoLO, saFuncTable_OOoLO +
SAL_N_ELEMENTS(saFuncTable_OOoLO));
679 OSL_ENSURE( !
maXclFuncMap.empty(),
"XclFunctionProvider::GetFuncInfoFromXclFunc - wrong filter" );
680 XclFuncMap::const_iterator aIt =
maXclFuncMap.find( nXclFunc );
681 return (aIt ==
maXclFuncMap.end()) ?
nullptr : aIt->second;
687 OSL_ENSURE( !
maXclFuncMap.empty(),
"XclFunctionProvider::GetFuncInfoFromXclMacroName - wrong filter" );
695 OSL_ENSURE( !
maScFuncMap.empty(),
"XclFunctionProvider::GetFuncInfoFromOpCode - wrong filter" );
696 ScFuncMap::const_iterator aIt =
maScFuncMap.find( eOpCode );
697 return (aIt ==
maScFuncMap.end()) ?
nullptr : aIt->second;
706 if( pIt->mnXclFunc !=
NOID )
708 if( pIt->IsMacroFunc() )
724 mbVolatile( bVolatile )
729 mbVolatile( bVolatile )
737 OSL_ENSURE(
maTokVec.size() <= 0xFFFF,
"XclTokenArray::GetSize - array too long" );
786 rTokArr.
Read( rStrm );
792 rTokArr.
Write( rStrm );
799 rxTokArr->
Write( rStrm );
801 rStrm << sal_uInt16( 0 );
806 mppScTokenBeg( nullptr ),
807 mppScTokenEnd( nullptr ),
808 mppScToken( nullptr ),
809 mbSkipSpaces( false )
815 Init( rScTokArr, bSkipSpaces );
819 mppScTokenBeg( rTokArrIt.mppScTokenBeg ),
820 mppScTokenEnd( rTokArrIt.mppScTokenEnd ),
821 mppScToken( rTokArrIt.mppScToken ),
822 mbSkipSpaces( bSkipSpaces )
829 sal_uInt16 nTokArrLen = rScTokArr.
GetLen();
830 mppScTokenBeg =
static_cast< const FormulaToken* const*
>( nTokArrLen ? rScTokArr.
GetArray() : nullptr );
854 while(
Is() && ((*this)->GetOpCode() ==
ocSpaces) )
862 bool bIsStr = (rScToken.GetType() ==
svString) && (rScToken.GetOpCode() ==
ocPush);
863 if( bIsStr ) rString = rScToken.GetString().getString();
878 enum { STATE_START, STATE_STR, STATE_SEP, STATE_END } eState = STATE_START;
879 while( eState != STATE_END )
switch( eState )
882 eState = aIt.
Is() ? STATE_STR : STATE_END;
888 if( bRet ) rStringList += aString ;
889 eState = (bRet && (++aIt).Is()) ? STATE_SEP : STATE_END;
894 if( bRet ) rStringList += OUStringChar(cSep);
895 eState = (bRet && (++aIt).Is()) ? STATE_STR : STATE_END;
910 if (aString.isEmpty())
912 sal_Int32 nStringIx = 0;
915 OUString aToken( aString.getToken( 0, cStringSep, nStringIx ) );
934 rAddress = rRef.
toAbs(rDoc, rPos);
949 stBegin, stTableOp, stOpen, stFormula, stFormulaSep,
950 stColFirst, stColFirstSep, stColRel, stColRelSep,
951 stRowFirst, stRowFirstSep, stRowRel, stClose, stError
955 OpCode eOpCode = aIt->GetOpCode();
956 bool bIsSep = eOpCode ==
ocSep;
960 eState = (eOpCode ==
ocTableOp) ? stTableOp : stError;
963 eState = (eOpCode ==
ocOpen) ? stOpen : stError;
966 eState = lclGetAddress(rDoc, rRefs.
maFmlaScPos, *aIt, rScPos) ? stFormula : stError;
969 eState = bIsSep ? stFormulaSep : stError;
972 eState = lclGetAddress(rDoc, rRefs.
maColFirstScPos, *aIt, rScPos) ? stColFirst : stError;
975 eState = bIsSep ? stColFirstSep : stError;
978 eState = lclGetAddress(rDoc, rRefs.
maColRelScPos, *aIt, rScPos) ? stColRel : stError;
981 eState = bIsSep ? stColRelSep : ((eOpCode ==
ocClose) ? stClose : stError);
984 eState = lclGetAddress(rDoc, rRefs.
maRowFirstScPos, *aIt, rScPos) ? stRowFirst : stError;
988 eState = bIsSep ? stRowFirstSep : stError;
991 eState = lclGetAddress(rDoc, rRefs.
maRowRelScPos, *aIt, rScPos) ? stRowRel : stError;
994 eState = (eOpCode ==
ocClose) ? stClose : stError;
1000 return eState == stClose;
const XclFunctionInfo * GetFuncInfoFromXclMacroName(const OUString &rXclMacroName) const
Returns the function data for an Excel function simulated by a macro call, or 0 on error...
std::size_t Write(const void *pData, std::size_t nBytes)
Writes nBytes bytes from memory.
const XclFunctionInfo * GetFuncInfoFromXclFunc(sal_uInt16 nXclFunc) const
Returns the function data for an Excel function index, or 0 on error.
XclBiff
An enumeration for all Excel file format types (BIFF types).
SharedString intern(const OUString &rStr)
ScAddress maRowFirstScPos
This class is used to export Excel record streams.
Single reference (one address) into the sheet.
void FillXclFuncMap(const XclFunctionInfo *pBeg, const XclFunctionInfo *pEnd)
ScAddress toAbs(const ScSheetLimits &rLimits, const ScAddress &rPos) const
std::size_t Read(void *pData, std::size_t nBytes)
Reads nBytes bytes to the existing(!) buffer pData.
bool IsMacroFunc() const
Returns true, if the function is simulated by a macro call.
static bool GetStringList(OUString &rStringList, const ScTokenArray &rScTokArr, sal_Unicode cSep)
Parses the passed formula and tries to find a string token list, i.e.
static bool GetTokenString(OUString &rString, const ::formula::FormulaToken &rScToken)
Tries to extract a string from the passed token.
sal_uInt16 GetSize() const
Returns the size of the token array in bytes.
void Write(XclExpStream &rStrm) const
Writes size field and the tokens.
void WriteSize(XclExpStream &rStrm) const
Writes the size field of the token array.
virtual void Clear() override
void WriteArray(XclExpStream &rStrm) const
Writes the tokens of the token array (without size field).
XclMacroNameMap maXclMacroNameMap
Maps Excel function indexes to function data.
bool mbSkipSpaces
Pointer to current token pointer of token array.
const ::formula::FormulaToken *const * mppScTokenEnd
Pointer to first token pointer of token array.
#define SAL_N_ELEMENTS(arr)
void ReadArray(XclImpStream &rStrm)
Reads the tokens of the token array (without size field).
MS Excel 5.0, MS Excel 7.0 (95)
Represents information for a spreadsheet function for import and export.
OUString GetAddInEquivalentFuncName() const
Returns the programmatical name of the Add-In function as string.
const XclFunctionInfo * GetFuncInfoFromOpCode(OpCode eOpCode) const
Returns the function data for a Calc opcode, or 0 on error.
ScfUInt8Vec maExtDataVec
Byte vector containing token data.
ScFuncMap maScFuncMap
Maps macro function names to function data.
XclTokenArray(bool bVolatile=false)
Creates an empty token array.
void FillScFuncMap(const XclFunctionInfo *pBeg, const XclFunctionInfo *pEnd)
const char * mpcMacroName
Additional flags (EXC_FUNCFLAG_* constants).
Provides access to function info structs for all available functions.
void ReadSize(XclImpStream &rStrm)
Reads the size field of the token array.
virtual formula::FormulaToken * AddOpCode(OpCode eCode) override
XclTokenArrayIterator & operator++()
Binary representation of an Excel token array.
Contains all cell references that can be extracted from a multiple operations formula.
const ::formula::FormulaToken *const * mppScToken
Pointer behind last token pointer of token array.
void Read(XclImpStream &rStrm)
Reads size field and the tokens.
OString stripStart(const OString &rIn, char c)
XclBiff GetBiff() const
Returns the current BIFF version of the importer/exporter.
bool operator==(const XclTokenArray &rTokArr) const
Compares this token array with the passed.
static void ConvertStringToList(ScTokenArray &rScTokArr, svl::SharedStringPool &rSPool, sal_Unicode cStringSep)
Tries to convert a formula that consists of a single string token to a list of strings.
static bool GetString(OUString &rString, const ScTokenArray &rScTokArr)
Parses the passed formula and tries to find a single string token, i.e.
bool IsImport() const
Returns true, if currently a document is imported.
This class is used to import record oriented streams.
void Init(const ScTokenArray &rScTokArr, bool bSkipSpaces)
bool IsAddInEquivalent() const
Returns true, if the function is stored as an add-in call.
Special token array iterator for the Excel filters.
const ::formula::FormulaToken *const * mppScTokenBeg
Access to global data for a filter object (imported or exported document) from other classes...
bool mbVolatile
Byte vector containing extended data (arrays, stacked NLRs).
XclFunctionProvider(const XclRoot &rRoot)
static bool GetMultipleOpRefs(const ScDocument &rDoc, XclMultipleOpRefs &rRefs, const ScTokenArray &rScTokArr, const ScAddress &rScPos)
Parses the passed formula and tries to extract references of a multiple operation.
ScAddress maColFirstScPos
Position of the (first) formula cell.
OUString GetMacroFuncName() const
Returns the name of the external function as string.