ASF Bugzilla – Attachment 34389 Details for
Bug 56525
XSSFSheet.getColumnStyle doesn't conform to Sheet.getColumnStyle API doc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix XSSFSheet.getColumnStyle to abide to javadoc
bug56525.patch (text/plain), 2.70 KB, created by
Javen O'Neal
on 2016-10-19 07:26:50 UTC
(
hide
)
Description:
Fix XSSFSheet.getColumnStyle to abide to javadoc
Filename:
MIME Type:
Creator:
Javen O'Neal
Created:
2016-10-19 07:26:50 UTC
Size:
2.70 KB
patch
obsolete
>Index: src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java >=================================================================== >--- src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (revision 1765534) >+++ src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (working copy) >@@ -959,7 +959,10 @@ > @Override > public CellStyle getColumnStyle(int column) { > int idx = columnHelper.getColDefaultStyle(column); >- return getWorkbook().getCellStyleAt((short)(idx == -1 ? 0 : idx)); >+ if (idx == -1) { >+ return null; >+ } >+ return getWorkbook().getCellStyleAt(idx); > } > > /** >Index: src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java >=================================================================== >--- src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java (revision 1765534) >+++ src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java (working copy) >@@ -1109,12 +1109,12 @@ > > CellStyle blueStyle = wb.createCellStyle(); > blueStyle.setFillForegroundColor(IndexedColors.AQUA.getIndex()); >- blueStyle.setFillPattern(CellStyle.SOLID_FOREGROUND); >+ blueStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); > assertEquals(1, blueStyle.getIndex()); > > CellStyle pinkStyle = wb.createCellStyle(); > pinkStyle.setFillForegroundColor(IndexedColors.PINK.getIndex()); >- pinkStyle.setFillPattern(CellStyle.SOLID_FOREGROUND); >+ pinkStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); > assertEquals(2, pinkStyle.getIndex()); > > // Starts empty >@@ -1134,9 +1134,9 @@ > assertEquals(1, s.getCTWorksheet().sizeOfColsArray()); > assertEquals(0, cols.sizeOfColArray()); > >- assertEquals(defaultStyle, s.getColumnStyle(0)); >- assertEquals(defaultStyle, s.getColumnStyle(2)); >- assertEquals(defaultStyle, s.getColumnStyle(3)); >+ assertNull(s.getColumnStyle(0)); >+ assertNull(s.getColumnStyle(2)); >+ assertNull(s.getColumnStyle(3)); > > > // Apply the styles >@@ -1145,7 +1145,7 @@ > > // Check > assertEquals(pinkStyle, s.getColumnStyle(0)); >- assertEquals(defaultStyle, s.getColumnStyle(2)); >+ assertNull(s.getColumnStyle(2)); > assertEquals(blueStyle, s.getColumnStyle(3)); > > assertEquals(1, s.getCTWorksheet().sizeOfColsArray()); >@@ -1169,7 +1169,7 @@ > pinkStyle = wbBack.getCellStyleAt(pinkStyle.getIndex()); > > assertEquals(pinkStyle, s.getColumnStyle(0)); >- assertEquals(defaultStyle, s.getColumnStyle(2)); >+ assertNull(s.getColumnStyle(2)); > assertEquals(blueStyle, s.getColumnStyle(3)); > wbBack.close(); > }
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 56525
:
34385
| 34389