poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1787658 - in /poi/trunk: src/java/org/apache/poi/ss/formula/functions/DGet.java test-data/spreadsheet/DGet.xls
Date Sun, 19 Mar 2017 20:29:55 GMT
Author: centic
Date: Sun Mar 19 20:29:55 2017
New Revision: 1787658

URL: http://svn.apache.org/viewvc?rev=1787658&view=rev
Log:
60823: DGET function, correct behavior with multiple result entries but only one non-blank

Modified:
    poi/trunk/src/java/org/apache/poi/ss/formula/functions/DGet.java
    poi/trunk/test-data/spreadsheet/DGet.xls

Modified: poi/trunk/src/java/org/apache/poi/ss/formula/functions/DGet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/functions/DGet.java?rev=1787658&r1=1787657&r2=1787658&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/functions/DGet.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/functions/DGet.java Sun Mar 19 20:29:55 2017
@@ -36,10 +36,18 @@ public final class DGet implements IDSta
         {
             result = eval;
         }
-        else // There was a previous match, since there is only exactly one allowed, bail
out.
+        else // There was a previous match. Only one non-blank result is allowed. #NUM! on
multiple values.
         {
-            result = ErrorEval.NUM_ERROR;
-            return false;
+            if(result instanceof BlankEval) {
+                result = eval;
+            }
+            else {
+                // We have a previous filled result.
+                if(!(eval instanceof BlankEval)) {
+                    result = ErrorEval.NUM_ERROR;
+                    return false;
+                }
+            }
         }
 
         return true;

Modified: poi/trunk/test-data/spreadsheet/DGet.xls
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/DGet.xls?rev=1787658&r1=1787657&r2=1787658&view=diff
==============================================================================
Binary files - no diff available.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message