summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinfried Donkers <winfrieddonkers@libreoffice.org>2018-05-09 10:40:03 +0200
committerEike Rathke <erack@redhat.com>2018-05-09 17:04:10 +0200
commit1a8febcaa4f932124d417877a3b08bd059c0362d (patch)
tree674cb0f8c8b090594557f6ff75a790647788cb9f
parent64293a27256699d9400605a9f312f7663bca97fb (diff)
tdf#117433 count empty cells properly with COUNTIF.
All empty columns after the first column of the range were skipped. When the query contains an 'cell is empty' expression, skipping is omitted. Change-Id: I0d5b0d24c2d08bad88479cd5b356529a0a709156 Reviewed-on: https://gerrit.libreoffice.org/54021 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/qa/unit/data/functions/statistical/fods/countif.fods22
-rw-r--r--sc/source/core/data/dociter.cxx2
2 files changed, 18 insertions, 6 deletions
diff --git a/sc/qa/unit/data/functions/statistical/fods/countif.fods b/sc/qa/unit/data/functions/statistical/fods/countif.fods
index 557e70b2044f..8625ebe7aeff 100644
--- a/sc/qa/unit/data/functions/statistical/fods/countif.fods
+++ b/sc/qa/unit/data/functions/statistical/fods/countif.fods
@@ -3865,10 +3865,22 @@
<table:table-cell table:style-name="ce58"/>
</table:table-row>
<table:table-row table:style-name="ro6">
- <table:table-cell table:number-columns-repeated="2"/>
- <table:table-cell table:style-name="ce28"/>
- <table:table-cell table:style-name="ce34"/>
- <table:table-cell table:number-columns-repeated="2"/>
+ <table:table-cell table:formula="of:=COUNTIF([.P20:.R23];&quot;&quot;)" office:value-type="float" office:value="12" calcext:value-type="float">
+ <text:p>12</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="float" office:value="12" calcext:value-type="float">
+ <text:p>12</text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce64" table:formula="of:=ROUND([.A32];12)=ROUND([.B32];12)" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean">
+ <text:p>TRUE</text:p>
+ </table:table-cell>
+ <table:table-cell table:style-name="ce34" table:formula="of:=FORMULA([.A32])" office:value-type="string" office:string-value="=COUNTIF(P20:R23,&quot;&quot;)" calcext:value-type="string">
+ <text:p>=COUNTIF(P20:R23,&quot;&quot;)</text:p>
+ </table:table-cell>
+ <table:table-cell office:value-type="string" calcext:value-type="string">
+ <text:p>tdf#117433</text:p>
+ </table:table-cell>
+ <table:table-cell/>
<table:table-cell table:style-name="ce39"/>
<table:table-cell/>
<table:table-cell office:value-type="float" office:value="3" calcext:value-type="float">
@@ -4469,4 +4481,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/dociter.cxx b/sc/source/core/data/dociter.cxx
index b09c4413301b..0c74233f4c90 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1144,7 +1144,7 @@ bool ScQueryCellIterator::GetThis()
}
pCol = &(pDoc->maTabs[nTab])->aCol[nCol];
}
- while (pCol->IsEmptyData());
+ while (!rItem.mbMatchEmpty && pCol->IsEmptyData());
InitPos();