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 2016/04/02 22:23:36 UTC

[Bug 59264] New: Change CellStyle border style constants from short to enum

https://bz.apache.org/bugzilla/show_bug.cgi?id=59264

            Bug ID: 59264
           Summary: Change CellStyle border style constants from short to
                    enum
           Product: POI
           Version: 3.15-dev
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: SS Common
          Assignee: dev@poi.apache.org
          Reporter: onealj@apache.org
            Blocks: 58787

The BORDER_* constants in CellStyle [1] should be converted to enums to them
more discoverable and safer.

A conversion was already done at the XSSF level in bug 45942 with
BorderStyle.java. These changes need to be brought up to Common SS so that they
can be used by HSSF workbooks as well.

[1] https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/CellStyle.html

-- 
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 59264] Unify interface for setting cell border line styles using BorderStyle enum instead of short code

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

Javen O'Neal <on...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |59836

-- 
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 59264] Change CellStyle border style constants from short to enum

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

--- Comment #4 from Javen O'Neal <on...@apache.org> ---
Implemented in r1737751, r1737752, r1737879, r1737884, r1737885, r1737886

Backwards-incompatible changes:
* Change: BorderStyle.MEDIUM_DASH_DOT_DOTC renamed to MEDIUM_DASH_DOT_DOT
  Affected classes:
    o.a.p.ss.usermodel.BorderStyle
* Change: getBorderX returns BorderStyle instead of short.
  Affected classes:
    o.a.p.hssf.usermodel.HSSFBorderFormatting
    o.a.p.hssf.usermodel.HSSFCellStyle
    o.a.p.ss.usermodel.BorderFormatting
    o.a.p.ss.usermodel.BorderStyle
    o.a.p.ss.usermodel.CellStyle
    o.a.p.xssf.usermodel.XSSFBorderFormatting
    o.a.p.xssf.usermodel.XSSFCellStyle

Deprecated features (will be removed in a future release):
* Change: short BORDER_* constants deprecated. Use BorderStyle enum values
instead.
  Affected classes:
    o.a.p.ss.usermodel.BorderFormatting
    o.a.p.ss.usermodel.CellStyle
* Change: setBorderX(short) deprecated. Use setBorderX(BorderStyle) instead.
  Affected classes:
    o.a.p.hssf.usermodel.HSSFBorderFormatting
    o.a.p.hssf.usermodel.HSSFCellStyle
    o.a.p.ss.usermodel.BorderFormatting
    o.a.p.ss.usermodel.BorderStyle
    o.a.p.ss.usermodel.CellStyle
    o.a.p.xssf.usermodel.XSSFBorderFormatting
    o.a.p.xssf.usermodel.XSSFCellStyle
* Change: getBorderLeftEnum deprecated. Use getBorderLeft instead.
  Affected classes:
    o.a.p.xssf.usermodel.XSSFCellStyle
* Change: CellUtil.getFormatProperties/setFormatProperties operate on
BorderStyle enums instead of shorts for border line styles
  Affected classes:
    o.a.p.ss.util.CellUtil
  Side-note: This deprecation warning is inside a private method. How do I
alert developers that setting BorderStyles with short/Short will be deprecated
besides raising an runtime ClassCastException when BorderStyles become
required?

Per comment 1, BaseTestBorderStyle [1] tests to make sure that HAIR and DOTTED
enums are as expected. HAIR is smaller dots than DOTTED. Anyone wondering what
each border style looks like can open test-data/spreadsheet/59264.xls or
59264.xlsx.

[1]
https://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestBorderStyle.java?view=markup&pathrev=1737879

-- 
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 59264] Unify interface for setting cell border line styles using BorderStyle enum instead of short code

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

Javen O'Neal <on...@apache.org> changed:

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

--- Comment #5 from Javen O'Neal <on...@apache.org> ---
Updated JavaDocs in r1737894. These changes will be available in POI 3.15 beta
2.

Updated change log in r1737888.

-- 
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 59264] Unify interface for setting cell border line styles using BorderStyle enum instead of short code

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

--- Comment #6 from Javen O'Neal <on...@apache.org> ---
r1760627 reverted part of r1737879 for backwards compatibility with POI 3.14.
BorderFormatting#getBorder[Top|Bottom|Left|Right|Diagonal]() returns short
BorderFormatting#getBorder[Top|Bottom|Left|Right|Diagonal]Enum() returns
BorderStyle enum

r1760630 reverted part of r1737879 for backwards compatibility with POI 3.14.
CellStyle#getBorder[Top|Bottom|Left|Right]() returns short
CellStyle#getBorder[Top|Bottom|Left|Right]Enum() returns BorderStyle enum

These changes will be included in POI 3.15 final. POI will be binary backwards
compatible with POI 3.14.

-- 
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 59264] Unify interface for setting cell border line styles using BorderStyle enum instead of short code

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

Javen O'Neal <on...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Change CellStyle border     |Unify interface for setting
                   |style constants from short  |cell border line styles
                   |to enum                     |using BorderStyle enum
                   |                            |instead of short code

-- 
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 59264] Change CellStyle border style constants from short to enum

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

--- Comment #2 from Javen O'Neal <on...@apache.org> ---
Created attachment 33726
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33726&action=edit
Created a worksheet showing how the border styles are used

Similar to attachment 30660 from bug 55341, but includes text to define what
each type of border style is attempting to be.

-- 
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 59264] Change CellStyle border style constants from short to enum

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

--- Comment #3 from Javen O'Neal <on...@apache.org> ---
Created attachment 33727
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33727&action=edit
XLS version

-- 
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 59264] Change CellStyle border style constants from short to enum

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

--- Comment #1 from Javen O'Neal <on...@apache.org> ---
Created attachment 33725
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33725&action=edit
promote ss.usermodel.BorderStyle.java as class to get/set border style with

Need to be careful not to cause regressions with regard to HAIR/DOTTED (bug
55341). I believe HAIR is smaller dots than DOTTED.

hssf record BorderFormatting has not been replaced yet. Not sure if it needs
to, though, since it's lower level anyways.

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