sc/qa/unit/data/functions/statistical/fods/countif.fods |   22 ++++++++++++----
 sc/source/core/data/dociter.cxx                         |    2 -
 2 files changed, 18 insertions(+), 6 deletions(-)

New commits:
commit 9b2ebcfe80900b2f6299851d3a271bdcaa85049a
Author: Winfried Donkers <winfrieddonk...@libreoffice.org>
Date:   Wed May 9 10:40:03 2018 +0200

    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 <c...@libreoffice.org>
    Reviewed-by: Eike Rathke <er...@redhat.com>
    (cherry picked from commit 1a8febcaa4f932124d417877a3b08bd059c0362d)
    Reviewed-on: https://gerrit.libreoffice.org/54037
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

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 96af2dbc3150..689abc31d07a 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();
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to