RE: fdo77985 Calc function NETWORKDAYS
Hi Eike, Rather implement an ODFF compliant NETWORKDAYS function at the interpreter that shares implementation with ScNetWorkdays_MS() (syntax and semantics are equal, aren't they? I didn't look up now) and rename the Add-In one to NETWORKDAYS_ADD, note that this will also need adapting the entry in sc/source/core/tool/odffmap.cxx and the entries in the mappings of sc/source/filter/excel/xlformula.cxx and sc/source/filter/oox/formulabase.cxx, the latter may probably write NETWORKDAYS.INTL for the ODFF NETWORKDAYS. I'll help you to figure out details. It seems that function NOMINAL is both an Add-in and a regular calc function. I will see if I can copy that principle for NETWORKDAYS. Winfried ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
RE: fdo77985 Calc function NETWORKDAYS
Hi Eike, I'd avoid changing existing Add-In functions, it's a source of hassle ;-) Fine, I prefer to keep away from the add-in code, too. Rather implement an ODFF compliant NETWORKDAYS function at the interpreter [...] OK, then there will be 3 NETWORKDAYS functions: Add-in, OOXML and ODFF: Add-in is a subset of ODFF as Add-in misses the 4th argument (defining weekend days); OOXML differs from ODFF as the 3rd and 4th argument are the other way round and the weekend day argument for OOXML uses a 7-character string of 0 and 1, whereas ODFF uses a list of numbers (0 and not 0). The difference between OOXML and ODFF doesn't concern me, that I can solve easily in the code. The difference between Add-in and ODFF looks problematic to me when using ODFF NETWORKDAYS with 2 arguments and saving to xls. And how about compatibility with documents saved before introduction of ODFF NETWORKDAYS? Are these regarded as Add-inn? A solution (which I don't like) could be to assume that NETWORKDAYS with 2 or 3 arguments is Add-in, and with 4 arguments is ODFF. I don't know if this can be implemented. I will start making the ODFF NETWORKDAYS function and rename the Add-in function to NETWORKDAYS_ADD. Winfried ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: fdo77985 Calc function NETWORKDAYS
Hi Winfried, On Tuesday, 2014-04-29 10:26:03 +0200, Winfried Donkers wrote: Calc function NETWORKDAYS is an add-in function and compatible with Excel's function NETWORKDAYS, but _not_ with Oasis ODFF 1.2 (http://docs.oasis-open.org/office/v1.2/cos01/OpenDocument-v1.2-cos01-part2.html#__RefHeading__1018198_715980110) . My first impression is that I could tweak the current code and make the function compatible with both. For Excel the 3rd argument is a reference to a (range of) date, for ODFF it is a (reference to) matrix of 0 and 1. That means I can distinguish between the two. That distinction is important when exporting to Excel, too. Do you think this is worth trying? Or would you prefer two internal functions, one regular in ScInterpreter (new, but using code from ScInterpreter::ScNetWorkdays_MS()) and one add-in (existing)? In that case I would need some hints where to make the switch from NETWORKDAYS in the cell (UI or file) and the two internal functions. I'd avoid changing existing Add-In functions, it's a source of hassle ;-) We also have better control over functionality and mappings in the compiler when using internal interpreter functions. Rather implement an ODFF compliant NETWORKDAYS function at the interpreter that shares implementation with ScNetWorkdays_MS() (syntax and semantics are equal, aren't they? I didn't look up now) and rename the Add-In one to NETWORKDAYS_ADD, note that this will also need adapting the entry in sc/source/core/tool/odffmap.cxx and the entries in the mappings of sc/source/filter/excel/xlformula.cxx and sc/source/filter/oox/formulabase.cxx, the latter may probably write NETWORKDAYS.INTL for the ODFF NETWORKDAYS. I'll help you to figure out details. Eike -- LibreOffice Calc developer. Number formatter stricken i18n transpositionizer. GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918 630B 6A6C D5B7 6563 2D3A Support the FSFE, care about Free Software! https://fsfe.org/support/?erack pgp1csyvRXw4w.pgp Description: PGP signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
RE: fdo77985 Calc function NETWORKDAYS()
Hi Miguel (adding the mailing list again) Yes, you are right, I messed up my message. Actually, I think it makes implementing full ODF-compliance easier :-) Winfried -Oorspronkelijk bericht- Van: mari...@miguelangel.mobi [mailto:mari...@miguelangel.mobi] Verzonden: dinsdag 29 april 2014 16:24 Aan: Winfried Donkers Onderwerp: NETWORKDAYS() Hi Winfried, maybe I'm wrong but reading in ODF definition I think the third parameter it's the same as excel. It's a fourth parameter for ODF about what weekdays are the workdays. The optional 3rd parameter Holidays can be used to specify a list of dates to be treated as holidays. Note that this parameter can be omitted as an empty parameter (two consecutive ;; semicolons) to be able to pass the set of Workdays without Holidays. The optional 4th parameter Workdays can be used to specify a different definition for the standard work week... Best regards. Miguel Ángel. _ Sent from http://nabble.documentfoundation.org ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice