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 2014/05/28 17:26:36 UTC

[Bug 56572] New: Implementation of HSSFCellStyle does not match its contract

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

            Bug ID: 56572
           Summary: Implementation of HSSFCellStyle does not match its
                    contract
           Product: POI
           Version: 3.10
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: dev@poi.apache.org
          Reporter: mayeul.rousselet@gmail.com

Hi, 

As define in the interface org.apache.poi.ss.usermodel.Cell, the method
setStyle can accept a null value (from javadoc) : "If the value is null then
the style information is removed causing the cell to used the default workbook
style."

Or when I look at the implemenation in HSSFCell, I saw that: 
public void setCellStyle(CellStyle style) {
        setCellStyle( (HSSFCellStyle)style );
    }
    public void setCellStyle(HSSFCellStyle style) {
        // Verify it really does belong to our workbook
        style.verifyBelongsToWorkbook(_book);

        short styleIndex;
        if(style.getUserStyleName() != null) {
            styleIndex = applyUserCellStyle(style);
        } else {
            styleIndex = style.getIndex();
        }

        // Change our cell record to use this style
        _record.setXFIndex(styleIndex);
    }

So a null value is not checked and not taken into account.

Thanks,

Mayeul

-- 
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 56572] Implementation of HSSFCellStyle does not match its contract

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

Nick Burch <ap...@gagravarr.org> changed:

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

--- Comment #3 from Nick Burch <ap...@gagravarr.org> ---
Thanks for investigating, fixed in r1598258.

-- 
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 56572] Implementation of HSSFCellStyle does not match its contract

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

--- Comment #4 from Mayeul <ma...@gmail.com> ---
I am really amazed by your responsiveness.
Glad to help and thanks a lot.

Mayeul

-- 
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 56572] Implementation of HSSFCellStyle does not match its contract

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

Mayeul <ma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #2 from Mayeul <ma...@gmail.com> ---
Hi,

Xssf behaves as expected : 

public void setCellStyle(CellStyle style) {
    if(style == null) {
        if(_cell.isSetS()) _cell.unsetS();
    } else {
     ....
    }
}

-- 
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 56572] Implementation of HSSFCellStyle does not match its contract

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

Nick Burch <ap...@gagravarr.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
                 OS|                            |All

--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
How does XSSF behave in this case?

(i.e. is this a bug in the javadoc, or a hssf specific bit of missing
functionality)

-- 
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