[Bug 63960] New: Pre-evaluated values in formula cells are written with the wrong type

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 63960] New: Pre-evaluated values in formula cells are written with the wrong type

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63960

            Bug ID: 63960
           Summary: Pre-evaluated values in formula cells are written with
                    the wrong type
           Product: POI
           Version: 4.1.1-FINAL
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SS Common
          Assignee: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

A pre-evaluated value in a Formula cell is written by SheetDataWriter as
follows:

    switch(cell.getCachedFormulaResultType()) {
        case NUMERIC:
            writeAttribute("t", "n");
            break;
        case STRING:
            writeAttribute("t", STCellType.S.toString());
            break;
        case BOOLEAN:
            writeAttribute("t", "b");
            break;
        case ERROR:
            writeAttribute("t", "e");
            break;
    }

The problem is that STCellType.S is for shared strings, but then the value is
immediately written with <v></v> for an inline string. The correct cell type in
this situation is "str", not "s".

This causes Excel to mark the sheet as invalid when opening.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63960] Pre-evaluated values in formula cells are written with the wrong type

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63960

--- Comment #1 from Mat Mannion <[hidden email]> ---
Created attachment 36901
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36901&action=edit
Patch to set cell type to "str" for formula cells with pre-evaluated string
contents

Patch attached.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 63960] [PATCH] Pre-evaluated values in formula cells are written with the wrong type

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=63960

Mat Mannion <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Pre-evaluated values in     |[PATCH] Pre-evaluated
                   |formula cells are written   |values in formula cells are
                   |with the wrong type         |written with the wrong type

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]