sc/qa/unit/data/functions/database/fods/dcount.fods | 21 +++++++++++++++---- sc/qa/unit/data/functions/database/fods/dcounta.fods | 21 +++++++++++++++---- sc/source/core/data/funcdesc.cxx | 4 +-- 3 files changed, 36 insertions(+), 10 deletions(-)
New commits: commit 1db4d3c869dbd4d68c0ab7b15c60bb2dad0a9f67 Author: Winfried Donkers <winfrieddonk...@libreoffice.org> AuthorDate: Thu Dec 9 17:39:58 2021 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Dec 10 13:52:37 2021 +0100 tdf#133353, Make 2nd argument optional for DCOUNT and DCOUNTA. The functions accept empty second arguments, but the function wizard and hints stated that it was required. Change-Id: I74fcfcc31492ed776085d1bc6ee6a9ff22a87818 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126620 Tested-by: Eike Rathke <er...@redhat.com> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit 885465bc0ae6029d8adad57015fb0ff6c26a6ba6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126594 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/unit/data/functions/database/fods/dcount.fods b/sc/qa/unit/data/functions/database/fods/dcount.fods index 392bc86d017d..4e2b792e08f2 100644 --- a/sc/qa/unit/data/functions/database/fods/dcount.fods +++ b/sc/qa/unit/data/functions/database/fods/dcount.fods @@ -2183,9 +2183,22 @@ <table:table-cell table:number-columns-repeated="11"/> </table:table-row> <table:table-row table:style-name="ro2"> - <table:table-cell table:number-columns-repeated="2"/> - <table:table-cell table:style-name="ce30"/> - <table:table-cell table:number-columns-repeated="6"/> + <table:table-cell table:formula="of:=DCOUNT([.J1:.N11];;[.J41:.N42])" office:value-type="float" office:value="2" calcext:value-type="float"> + <text:p>2</text:p> + </table:table-cell> + <table:table-cell office:value-type="float" office:value="2" calcext:value-type="float"> + <text:p>2</text:p> + </table:table-cell> + <table:table-cell table:style-name="ce60" table:formula="of:=[.A21]=[.B21]" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> + <text:p>TRUE</text:p> + </table:table-cell> + <table:table-cell table:formula="of:=FORMULA([.A21])" office:value-type="string" office:string-value="=DCOUNT(J1:N11,,J41:N42)" calcext:value-type="string"> + <text:p>=DCOUNT(J1:N11,,J41:N42)</text:p> + </table:table-cell> + <table:table-cell office:value-type="string" calcext:value-type="string"> + <text:p>Tdf#13353</text:p> + </table:table-cell> + <table:table-cell table:number-columns-repeated="4"/> <table:table-cell table:style-name="ce35" office:value-type="string" calcext:value-type="string"> <text:p>>=I</text:p> </table:table-cell> @@ -2940,4 +2953,4 @@ </table:database-ranges> </office:spreadsheet> </office:body> -</office:document> \ No newline at end of file +</office:document> diff --git a/sc/qa/unit/data/functions/database/fods/dcounta.fods b/sc/qa/unit/data/functions/database/fods/dcounta.fods index 1080e2cf64a5..c95c1472d713 100644 --- a/sc/qa/unit/data/functions/database/fods/dcounta.fods +++ b/sc/qa/unit/data/functions/database/fods/dcounta.fods @@ -864,9 +864,22 @@ <table:table-cell/> </table:table-row> <table:table-row table:style-name="ro2"> - <table:table-cell table:number-columns-repeated="2"/> - <table:table-cell table:style-name="ce13"/> - <table:table-cell table:number-columns-repeated="6"/> + <table:table-cell table:formula="of:=DCOUNTA([.J1:.N10];;[.J41:.N42])" office:value-type="float" office:value="2" calcext:value-type="float"> + <text:p>2</text:p> + </table:table-cell> + <table:table-cell office:value-type="float" office:value="2" calcext:value-type="float"> + <text:p>2</text:p> + </table:table-cell> + <table:table-cell table:style-name="ce29" table:formula="of:=[.A8]=[.B8]" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> + <text:p>TRUE</text:p> + </table:table-cell> + <table:table-cell table:formula="of:=FORMULA([.A8])" office:value-type="string" office:string-value="=DCOUNTA(J1:N10,,J41:N42)" calcext:value-type="string"> + <text:p>=DCOUNTA(J1:N10,,J41:N42)</text:p> + </table:table-cell> + <table:table-cell office:value-type="string" calcext:value-type="string"> + <text:p>Tdf#13353</text:p> + </table:table-cell> + <table:table-cell table:number-columns-repeated="4"/> <table:table-cell office:value-type="string" calcext:value-type="string"> <text:p>Greta</text:p> </table:table-cell> @@ -1491,4 +1504,4 @@ </table:named-expressions> </office:spreadsheet> </office:body> -</office:document> \ No newline at end of file +</office:document> diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx index 51f03a4e4bf4..01d8143a16f8 100644 --- a/sc/source/core/data/funcdesc.cxx +++ b/sc/source/core/data/funcdesc.cxx @@ -576,8 +576,8 @@ ScFunctionList::ScFunctionList() { SC_OPCODE_NOMINAL, ENTRY(SC_OPCODE_NOMINAL_ARY), 0, ID_FUNCTION_GRP_FINANCIAL, HID_FUNC_NOMINAL, 2, { 0, 0 }, 0 }, { SC_OPCODE_SUB_TOTAL, ENTRY(SC_OPCODE_SUB_TOTAL_ARY), 0, ID_FUNCTION_GRP_MATH, HID_FUNC_TEILERGEBNIS, 2, { 0, 0 }, 0 }, { SC_OPCODE_DB_SUM, ENTRY(SC_OPCODE_DB_SUM_ARY), 0, ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBSUMME, 3, { 0, 0, 0 }, 0 }, - { SC_OPCODE_DB_COUNT, ENTRY(SC_OPCODE_DB_COUNT_ARY), 0, ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBANZAHL, 3, { 0, 0, 0 }, 0 }, - { SC_OPCODE_DB_COUNT_2, ENTRY(SC_OPCODE_DB_COUNT_2_ARY), 0, ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBANZAHL2, 3, { 0, 0, 0 }, 0 }, + { SC_OPCODE_DB_COUNT, ENTRY(SC_OPCODE_DB_COUNT_ARY), 0, ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBANZAHL, 3, { 0, 1, 0 }, 0 }, + { SC_OPCODE_DB_COUNT_2, ENTRY(SC_OPCODE_DB_COUNT_2_ARY), 0, ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBANZAHL2, 3, { 0, 1, 0 }, 0 }, { SC_OPCODE_DB_AVERAGE, ENTRY(SC_OPCODE_DB_AVERAGE_ARY), 0, ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBMITTELWERT, 3, { 0, 0, 0 }, 0 }, { SC_OPCODE_DB_GET, ENTRY(SC_OPCODE_DB_GET_ARY), 0, ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBAUSZUG, 3, { 0, 0, 0 }, 0 }, { SC_OPCODE_DB_MAX, ENTRY(SC_OPCODE_DB_MAX_ARY), 0, ID_FUNCTION_GRP_DATABASE, HID_FUNC_DBMAX, 3, { 0, 0, 0 }, 0 },