Improve tests: + bugs + Trailing ocMissing problems: + allow ocMissing ocSep ocMissing ocClose etc. at end of fn. [ without an error (!) ] + for nParamCount + elide trailing optional params (?) [ or not ? ] + what about functions with trailing optionals ? + behave differently if vararg ? lbound/ubound ? + trailing ocMissing + elide trailers on XML export + tests + add missing argument to end of (normal) optional arg function, that doesn't assume '0' default [?] + [ or - better, elide extra ';'s only down to min(nargs) ] + export / add missing ops into formulae where XL does not allow them to be entered / re-import to XL & test. + round-trip to XL ... + Do we get an 'svMissing' / 'ocMissing' between 'ocSep' from the parser ? [ if empty ? (or just ocSpace ?) ] #if 0 { // #84460# May occur if imported from Xcl. // The real value for missing parameters depends on the function // where it is used, interpreter would have to handle this. // If it does remove this error case here, that could also be the // time to generate ocMissing in between subsequent ocSep. // Xcl import should map missings to values if possible. SetError( errParameterExpected ); } #endif + interpr1.cxx 'GetDBParams' - missing ? + explicit svMissing handling (!?) ... + interpr4.cxx: + ScInterpreter::PopDouble() - seems to handle svMissing + also PopString (gdb) bt #0 ScCompiler::SetError (this=0xbff77644, nError=508) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:1088 #1 0xa1cbfa83 in ScCompiler::Factor (this=0xbff77644) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:3052 #2 0xa1cc000f in ScCompiler::UnionCutLine (this=0xbff77644) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:3166 #3 0xa1cc016b in ScCompiler::UnaryLine (this=0xbff77644) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:3190 #4 0xa1cc017f in ScCompiler::PostOpLine (this=0xbff77644) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:3197 #5 0xa1cc01dd in ScCompiler::PowLine (this=0xbff77644) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:3209 #6 0xa1cc0263 in ScCompiler::MulDivLine (this=0xbff77644) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:3223 #7 0xa1cc031b in ScCompiler::AddSubLine (this=0xbff77644) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:3237 #8 0xa1cc03d3 in ScCompiler::ConcatLine (this=0xbff77644) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:3251 #9 0xa1cc0459 in ScCompiler::CompareLine (this=0xbff77644) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:3265 #10 0xa1cc0511 in ScCompiler::NotLine (this=0xbff77644) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:3279 #11 0xa1cc05dd in ScCompiler::Expression (this=0xbff77644) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:3300 #12 0xa1cc0837 in ScCompiler::CompileTokenArray (this=0xbff77644) at /data/OpenOffice/ood680-m4/sc/source/core/tool/compiler.cxx:2782 re-factor eOp >= ... inline-functions 'isFunction(eOp)' [ or whatever ] Factor::3052: + detects fn start + iterates over args + NextToken() - odd semantic + Expression - PutCode's a full expression ? + via NotLine (?) ... [ cf. above ] + -> UnaryLine * Where to hack the compiler CompileString: + ScCompiler::IsOpCode - catches ';' & generates ocSep + need to spew a double op-code from it (?) + where is this inserted ? if( eLastOp == ocSep && pRawToken->GetOpCode() == ocSep ) { fprintf( stderr, "Add ocMissing before sep\n"); // FIXME: should we check for known functions with // optional args so the correction dialog can do better ? ScRawToken aMissingToken; aMissingToken.SetOpCode( ocMissing ); if ( !pArr->AddToken( aMissingToken ) ) { fprintf (stderr, "Error adding ocMissing\n"); SetError(errCodeOverflow); break; } } excform.cxx: // #84453# skip missing parameters at end of parameter list while( (nSkipEnd < nLast) && aPool.IsSingleOp( eParam[ nSkipEnd + 1 ], ocMissing ) ) xeformula.cxx: /* #i37355# insert tMissArg token for missing parameters -- Excel import filter adds ocMissing token (handled in Factor()), but Calc itself does not do this if a new formula is entered. */ switch( aTokData.GetOpCode() ) {