You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2013/05/31 19:23:24 UTC

[Bug 55036] New: [PATCH] Function Dec2HEx

https://issues.apache.org/bugzilla/show_bug.cgi?id=55036

            Bug ID: 55036
           Summary: [PATCH] Function Dec2HEx
           Product: POI
           Version: 3.10-dev
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: dev@poi.apache.org
          Reporter: cedric.walter@gmail.com

Created attachment 30350
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30350&action=edit
new function DEc2Hex with testcases

new function DEc2Hex with testcases

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55036] [PATCH] patch for missing function Dec2HEx

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55036

Cédric Walter <ce...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Cédric Walter <ce...@gmail.com> ---
merged in 1531395

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 55036] [PATCH] patch for missing function Dec2HEx

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55036

--- Comment #4 from Cédric Walter <ce...@gmail.com> ---
Created attachment 30374
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30374&action=edit
DEC2HEX_2.patch + test loader from spreadsheet

found also a bug while doing integration tests in excel (negative integer), now
solved

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 55036] [PATCH] patch for missing function Dec2HEx

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55036

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> ---
Thanks for the patch, applied in r1488729

I had to revert FunctionMetadataReader.java because it contained a debug code
specific for your local environment:


     public static FunctionMetadataRegistry createRegistry() {
-        InputStream is =
FunctionMetadataReader.class.getResourceAsStream(METADATA_FILE_NAME);
+        InputStream is = null;
+        try {
+            is = new
FileInputStream("C:\\innoveo\\workspace\\apache-poi-complexwildcard\\poi\\src\\resources\\main\\org\\apache\\poi\\ss\\formula\\function\\functionMetadata.txt");
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();  //To change body of catch statement use File
| Settings | File Templates.
+        }
+       
//FunctionMetadataReader.class.getResourceAsStream(METADATA_FILE_NAME);
         if (is == null) {
             throw new RuntimeException("resource '" + METADATA_FILE_NAME + "'
not found");

Yegor

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55036] [PATCH] patch for missing function Dec2HEx

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55036

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #2 from Yegor Kozlov <ye...@dinom.ru> ---

There is some work to do
.
Dec2Hex is a function from the Excel Analysis Toolpack . It needs to implement
FreeRefFunction and be registered in
org.apache.poi.ss.formula.atp.AnalysisToolPak. Otherwise the formula evaluator
will not find it. 

What you need to do:

(1) Declare Dec2Hex as implementing FreeRefFunction . There is one method to
implement and you need to simply delegate it to the existing implementation:

    public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec)
{
        if (args.length != 2) {
            return ErrorEval.VALUE_INVALID;
        }
        return evaluate(ec.getRowIndex(), ec.getColumnIndex(), args[0],
args[1]);    
    }

(2) register Dec2Hex  in AnalysisToolPack, see how other functions are
registered and follow the pattern.

(3) Provide a test(s) that evaluate functions from a real excel file. Attach
the modified test workbook to this bug report.

Yegor

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55036] [PATCH] patch for missing function Dec2HEx

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55036

Cédric Walter <ce...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[PATCH] Function Dec2HEx    |[PATCH] patch for missing
                   |                            |function Dec2HEx
                 OS|                            |All

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 55036] [PATCH] patch for missing function Dec2HEx

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55036

--- Comment #3 from Cédric Walter <ce...@gmail.com> ---
Created attachment 30373
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30373&action=edit
Tests Dec2Hex() as loaded from a test data spreadsheet

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org