summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinfried Donkers <winfrieddonkers@libreoffice.org>2021-12-09 17:39:58 +0100
committerEike Rathke <erack@redhat.com>2021-12-10 01:18:43 +0100
commit885465bc0ae6029d8adad57015fb0ff6c26a6ba6 (patch)
tree70b68acfba8fd949a8579c949425e269dbbeca7e
parent19559ebbee160d1625d06feec7e6566772dad231 (diff)
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 <erack@redhat.com> Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/qa/unit/data/functions/database/fods/dcount.fods21
-rw-r--r--sc/qa/unit/data/functions/database/fods/dcounta.fods21
-rw-r--r--sc/source/core/data/funcdesc.cxx4
3 files changed, 36 insertions, 10 deletions
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>&gt;=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 },