ASF Bugzilla – Attachment 34244 Details for
Bug 60130
[PATCH] DGET function, correct behavior with empty target cell
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
dget_empty_target_cell.patch
dget_empty_target_cell.patch (text/plain), 1.37 KB, created by
Patrick Böker
on 2016-09-14 09:08:48 UTC
(
hide
)
Description:
dget_empty_target_cell.patch
Filename:
MIME Type:
Creator:
Patrick Böker
Created:
2016-09-14 09:08:48 UTC
Size:
1.37 KB
patch
obsolete
>diff --git a/src/java/org/apache/poi/ss/formula/functions/DGet.java b/src/java/org/apache/poi/ss/formula/functions/DGet.java >index 91a9934..0bf9cc2 100644 >--- a/src/java/org/apache/poi/ss/formula/functions/DGet.java >+++ b/src/java/org/apache/poi/ss/formula/functions/DGet.java >@@ -17,7 +17,10 @@ > > package org.apache.poi.ss.formula.functions; > >+import org.apache.poi.ss.formula.eval.BlankEval; > import org.apache.poi.ss.formula.eval.ErrorEval; >+import org.apache.poi.ss.formula.eval.EvaluationException; >+import org.apache.poi.ss.formula.eval.OperandResolver; > import org.apache.poi.ss.formula.eval.ValueEval; > > /** >@@ -46,8 +49,18 @@ public final class DGet implements IDStarAlgorithm { > public ValueEval getResult() { > if(result == null) { > return ErrorEval.VALUE_INVALID; >- } else { >- return result; >- } >+ } else if(result instanceof BlankEval) { >+ return ErrorEval.VALUE_INVALID; >+ } else >+ try { >+ if(OperandResolver.coerceValueToString(OperandResolver.getSingleValue(result, 0, 0)).equals("")) { >+ return ErrorEval.VALUE_INVALID; >+ } >+ else { >+ return result; >+ } >+ } catch (EvaluationException e) { >+ return e.getErrorEval(); >+ } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 60130
: 34244 |
34245