(IMCOSH, IMCOT, IMCSC, IMCSCH, IMSEC, IMSECH, IMSINH and IMTAN, I'll call
them IMxx).
In Calc these functions are defined in scaddins and also mentioned in
sc/source/filter/oox/formulabase.cxx in saFuncTable2013[].
The problem is that the IMxx functions saved as xlsx by Calc won't open
correctly by Excel and vice versa.
Calc writes the IMxx functions in xlsx as =IMxx(...), just as on ods.
Excel writes the IMxx functions in xlsx as =_xlfn.IMxx(...), and in ods as
=IMxx(...).
The other Add-In functions are written by both Calc and Excel as
=FUNCTIONNAME(...).
This is due to that the functions defined in the Add-In were defined by
Excel long ago and are part of OOXML, and those Add-In functions are
treated accordingly during export. Unfortunately the exceptional IM*
cases don't seem to fit into the XclFunctionInfo tables of
sc/source/filter/excel/xlformula.cxx, only the case of writing an
internal function as Add-In is handled there (those with
EXC_FUNCFLAG_ADDINEQUIV set). But the lookup is done by OpCode in those
tables, so that doesn't work for ocExternal.
Any suggestions for a solution?
I could imagine to define some extra range of OpCode for XclFunctionInfo
starting at 0xFF00 or any other unused high value and for
ocExternal/svExternal do an extra lookup depending on the value of the
XclExpScToken's aTokData.mpScToken->GetExternal() programmatical name,
that for example is "com.sun.star.sheet.addin.Analysis.getImcsch", using
a simple std:map like
opcodevalue["com.sun.star.sheet.addin.Analysis.getImcsch"] = 0xFF00;
The corresponding XclFunctionInfo entry then could be
{ 0xFF00, 255, 2, 2, V, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY, EXC_FUNCNAME(
"IMCSCH" ) },
Note that these 255-export-only definitions due to the BIFF .xls macro
call storage use minparam+1 and maxparam+1, so for IMCSCH that expects
one parameter the definition is 2,2
In XclExpFmlaCompImpl::ProcessFunction() there's
maFuncProv.GetFuncInfoFromOpCode( eOpCode )
which for (eOpCode == ocExternal && rTokData.GetType() == svExternal)
would needed to be called with the new eOpCode according to the mapping.
I hope that helps.
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.