bug 59264: revert CellStyle#getBorder[Top|Bottom|Left|Right]() to return short and add getBorder[Top|Bottom|Left|Right]Enum() returns BorderStyle enum for backwards compatibility with POI 3.14 and earlier
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1760630 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
292d7ec27c
commit
38cd94d676
@ -160,8 +160,8 @@ public class SVTableCellRenderer extends JLabel
|
|||||||
SVTableUtils.getAWTColor(s.getRightBorderColor(), SVTableUtils.black),
|
SVTableUtils.getAWTColor(s.getRightBorderColor(), SVTableUtils.black),
|
||||||
SVTableUtils.getAWTColor(s.getBottomBorderColor(), SVTableUtils.black),
|
SVTableUtils.getAWTColor(s.getBottomBorderColor(), SVTableUtils.black),
|
||||||
SVTableUtils.getAWTColor(s.getLeftBorderColor(), SVTableUtils.black),
|
SVTableUtils.getAWTColor(s.getLeftBorderColor(), SVTableUtils.black),
|
||||||
s.getBorderTop(), s.getBorderRight(),
|
s.getBorderTopEnum(), s.getBorderRightEnum(),
|
||||||
s.getBorderBottom(), s.getBorderLeft(),
|
s.getBorderBottomEnum(), s.getBorderLeftEnum(),
|
||||||
hasFocus);
|
hasFocus);
|
||||||
setBorder(cellBorder);
|
setBorder(cellBorder);
|
||||||
isBorderSet=true;
|
isBorderSet=true;
|
||||||
|
@ -367,23 +367,23 @@ public class ExcelComparator {
|
|||||||
String borderName;
|
String borderName;
|
||||||
switch (borderSide) {
|
switch (borderSide) {
|
||||||
case 't': default:
|
case 't': default:
|
||||||
b1 = style1.getBorderTop() == BorderStyle.THIN;
|
b1 = style1.getBorderTopEnum() == BorderStyle.THIN;
|
||||||
b2 = style2.getBorderTop() == BorderStyle.THIN;
|
b2 = style2.getBorderTopEnum() == BorderStyle.THIN;
|
||||||
borderName = "TOP";
|
borderName = "TOP";
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
b1 = style1.getBorderBottom() == BorderStyle.THIN;
|
b1 = style1.getBorderBottomEnum() == BorderStyle.THIN;
|
||||||
b2 = style2.getBorderBottom() == BorderStyle.THIN;
|
b2 = style2.getBorderBottomEnum() == BorderStyle.THIN;
|
||||||
borderName = "BOTTOM";
|
borderName = "BOTTOM";
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
b1 = style1.getBorderLeft() == BorderStyle.THIN;
|
b1 = style1.getBorderLeftEnum() == BorderStyle.THIN;
|
||||||
b2 = style2.getBorderLeft() == BorderStyle.THIN;
|
b2 = style2.getBorderLeftEnum() == BorderStyle.THIN;
|
||||||
borderName = "LEFT";
|
borderName = "LEFT";
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
b1 = style1.getBorderRight() == BorderStyle.THIN;
|
b1 = style1.getBorderRightEnum() == BorderStyle.THIN;
|
||||||
b2 = style2.getBorderRight() == BorderStyle.THIN;
|
b2 = style2.getBorderRightEnum() == BorderStyle.THIN;
|
||||||
borderName = "RIGHT";
|
borderName = "RIGHT";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -298,10 +298,10 @@ public class ToHtml {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void borderStyles(CellStyle style) {
|
private void borderStyles(CellStyle style) {
|
||||||
styleOut("border-left", style.getBorderLeft(), BORDER);
|
styleOut("border-left", style.getBorderLeftEnum(), BORDER);
|
||||||
styleOut("border-right", style.getBorderRight(), BORDER);
|
styleOut("border-right", style.getBorderRightEnum(), BORDER);
|
||||||
styleOut("border-top", style.getBorderTop(), BORDER);
|
styleOut("border-top", style.getBorderTopEnum(), BORDER);
|
||||||
styleOut("border-bottom", style.getBorderBottom(), BORDER);
|
styleOut("border-bottom", style.getBorderBottomEnum(), BORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fontStyle(CellStyle style) {
|
private void fontStyle(CellStyle style) {
|
||||||
|
@ -331,6 +331,7 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
* @see VerticalAlignment
|
* @see VerticalAlignment
|
||||||
* @deprecated POI 3.15 beta 3. Use {@link #setVerticalAlignment(VerticalAlignment)} instead.
|
* @deprecated POI 3.15 beta 3. Use {@link #setVerticalAlignment(VerticalAlignment)} instead.
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
@Override
|
@Override
|
||||||
public void setVerticalAlignment(short align)
|
public void setVerticalAlignment(short align)
|
||||||
{
|
{
|
||||||
@ -461,6 +462,7 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
* @see #BORDER_SLANTED_DASH_DOT
|
* @see #BORDER_SLANTED_DASH_DOT
|
||||||
* @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderLeft(BorderStyle)} instead.
|
* @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderLeft(BorderStyle)} instead.
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
@Override
|
@Override
|
||||||
public void setBorderLeft(short border)
|
public void setBorderLeft(short border)
|
||||||
{
|
{
|
||||||
@ -471,6 +473,7 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
/**
|
/**
|
||||||
* set the type of border to use for the left border of the cell
|
* set the type of border to use for the left border of the cell
|
||||||
* @param border type
|
* @param border type
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setBorderLeft(BorderStyle border)
|
public void setBorderLeft(BorderStyle border)
|
||||||
@ -481,9 +484,20 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
/**
|
/**
|
||||||
* get the type of border to use for the left border of the cell
|
* get the type of border to use for the left border of the cell
|
||||||
* @return border type
|
* @return border type
|
||||||
|
* @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderLeftEnum()}.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BorderStyle getBorderLeft()
|
public short getBorderLeft()
|
||||||
|
{
|
||||||
|
return _format.getBorderLeft();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* get the type of border to use for the left border of the cell
|
||||||
|
* @return border type
|
||||||
|
* @since POI 3.15
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BorderStyle getBorderLeftEnum()
|
||||||
{
|
{
|
||||||
return BorderStyle.valueOf(_format.getBorderLeft());
|
return BorderStyle.valueOf(_format.getBorderLeft());
|
||||||
}
|
}
|
||||||
@ -507,6 +521,7 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
* @see #BORDER_SLANTED_DASH_DOT
|
* @see #BORDER_SLANTED_DASH_DOT
|
||||||
* @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderRight(BorderStyle)} instead.
|
* @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderRight(BorderStyle)} instead.
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
@Override
|
@Override
|
||||||
public void setBorderRight(short border)
|
public void setBorderRight(short border)
|
||||||
{
|
{
|
||||||
@ -517,6 +532,7 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
/**
|
/**
|
||||||
* set the type of border to use for the right border of the cell
|
* set the type of border to use for the right border of the cell
|
||||||
* @param border type
|
* @param border type
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setBorderRight(BorderStyle border)
|
public void setBorderRight(BorderStyle border)
|
||||||
@ -527,9 +543,20 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
/**
|
/**
|
||||||
* get the type of border to use for the right border of the cell
|
* get the type of border to use for the right border of the cell
|
||||||
* @return border type
|
* @return border type
|
||||||
|
* @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderRightEnum()}.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BorderStyle getBorderRight()
|
public short getBorderRight()
|
||||||
|
{
|
||||||
|
return _format.getBorderRight();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* get the type of border to use for the right border of the cell
|
||||||
|
* @return border type
|
||||||
|
* @since POI 3.15
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BorderStyle getBorderRightEnum()
|
||||||
{
|
{
|
||||||
return BorderStyle.valueOf(_format.getBorderRight());
|
return BorderStyle.valueOf(_format.getBorderRight());
|
||||||
}
|
}
|
||||||
@ -553,6 +580,7 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
* @see #BORDER_SLANTED_DASH_DOT
|
* @see #BORDER_SLANTED_DASH_DOT
|
||||||
* @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderTop(BorderStyle)} instead.
|
* @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderTop(BorderStyle)} instead.
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
@Override
|
@Override
|
||||||
public void setBorderTop(short border)
|
public void setBorderTop(short border)
|
||||||
{
|
{
|
||||||
@ -563,6 +591,7 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
/**
|
/**
|
||||||
* set the type of border to use for the top border of the cell
|
* set the type of border to use for the top border of the cell
|
||||||
* @param border type
|
* @param border type
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setBorderTop(BorderStyle border)
|
public void setBorderTop(BorderStyle border)
|
||||||
@ -573,9 +602,20 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
/**
|
/**
|
||||||
* get the type of border to use for the top border of the cell
|
* get the type of border to use for the top border of the cell
|
||||||
* @return border type
|
* @return border type
|
||||||
|
* @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderTopEnum()}.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BorderStyle getBorderTop()
|
public short getBorderTop()
|
||||||
|
{
|
||||||
|
return _format.getBorderTop();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* get the type of border to use for the top border of the cell
|
||||||
|
* @return border type
|
||||||
|
* @since 3.15
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BorderStyle getBorderTopEnum()
|
||||||
{
|
{
|
||||||
return BorderStyle.valueOf(_format.getBorderTop());
|
return BorderStyle.valueOf(_format.getBorderTop());
|
||||||
}
|
}
|
||||||
@ -599,6 +639,7 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
* @see #BORDER_SLANTED_DASH_DOT
|
* @see #BORDER_SLANTED_DASH_DOT
|
||||||
* @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderBottom(BorderStyle)} instead.
|
* @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderBottom(BorderStyle)} instead.
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
@Override
|
@Override
|
||||||
public void setBorderBottom(short border)
|
public void setBorderBottom(short border)
|
||||||
{
|
{
|
||||||
@ -609,6 +650,7 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
/**
|
/**
|
||||||
* set the type of border to use for the bottom border of the cell
|
* set the type of border to use for the bottom border of the cell
|
||||||
* @param border type
|
* @param border type
|
||||||
|
* @since 3.15 beta 2
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setBorderBottom(BorderStyle border)
|
public void setBorderBottom(BorderStyle border)
|
||||||
@ -619,9 +661,20 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
/**
|
/**
|
||||||
* get the type of border to use for the bottom border of the cell
|
* get the type of border to use for the bottom border of the cell
|
||||||
* @return border type
|
* @return border type
|
||||||
|
* @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderBottomEnum()}.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BorderStyle getBorderBottom()
|
public short getBorderBottom()
|
||||||
|
{
|
||||||
|
return _format.getBorderBottom();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* get the type of border to use for the bottom border of the cell
|
||||||
|
* @return border type
|
||||||
|
* @since 3.15
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BorderStyle getBorderBottomEnum()
|
||||||
{
|
{
|
||||||
return BorderStyle.valueOf(_format.getBorderBottom());
|
return BorderStyle.valueOf(_format.getBorderBottom());
|
||||||
}
|
}
|
||||||
@ -735,6 +788,7 @@ public final class HSSFCellStyle implements CellStyle {
|
|||||||
* @param fp fill pattern (set to 1 to fill w/foreground color)
|
* @param fp fill pattern (set to 1 to fill w/foreground color)
|
||||||
* @deprecated POI 3.15 beta 3. Use {@link #setFillPattern(FillPatternType)} instead.
|
* @deprecated POI 3.15 beta 3. Use {@link #setFillPattern(FillPatternType)} instead.
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
@Override
|
@Override
|
||||||
public void setFillPattern(short fp)
|
public void setFillPattern(short fp)
|
||||||
{
|
{
|
||||||
|
@ -541,19 +541,29 @@ public interface CellStyle {
|
|||||||
* @see #BORDER_SLANTED_DASH_DOT
|
* @see #BORDER_SLANTED_DASH_DOT
|
||||||
* @deprecated 3.15 beta 2. Use {@link #setBorderLeft(BorderStyle)} instead
|
* @deprecated 3.15 beta 2. Use {@link #setBorderLeft(BorderStyle)} instead
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
void setBorderLeft(short border);
|
void setBorderLeft(short border);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the type of border to use for the left border of the cell
|
* set the type of border to use for the left border of the cell
|
||||||
* @param border type
|
* @param border type
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
void setBorderLeft(BorderStyle border);
|
void setBorderLeft(BorderStyle border);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the type of border to use for the left border of the cell
|
* get the type of border to use for the left border of the cell
|
||||||
* @return border type
|
* @return border type
|
||||||
|
* @deprecated POI 3.15. Use {@link #getBorderLeftEnum()} instead.
|
||||||
|
* This will return a BorderStyle enum in the future.
|
||||||
*/
|
*/
|
||||||
BorderStyle getBorderLeft();
|
short getBorderLeft();
|
||||||
|
/**
|
||||||
|
* get the type of border to use for the left border of the cell
|
||||||
|
* @return border type
|
||||||
|
* @since POI 3.15
|
||||||
|
*/
|
||||||
|
BorderStyle getBorderLeftEnum();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the type of border to use for the right border of the cell
|
* set the type of border to use for the right border of the cell
|
||||||
@ -574,19 +584,29 @@ public interface CellStyle {
|
|||||||
* @see #BORDER_SLANTED_DASH_DOT
|
* @see #BORDER_SLANTED_DASH_DOT
|
||||||
* @deprecated 3.15 beta 2. Use {@link #setBorderRight(BorderStyle)} instead
|
* @deprecated 3.15 beta 2. Use {@link #setBorderRight(BorderStyle)} instead
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
void setBorderRight(short border);
|
void setBorderRight(short border);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the type of border to use for the right border of the cell
|
* set the type of border to use for the right border of the cell
|
||||||
* @param border type
|
* @param border type
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
void setBorderRight(BorderStyle border);
|
void setBorderRight(BorderStyle border);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the type of border to use for the right border of the cell
|
* get the type of border to use for the right border of the cell
|
||||||
* @return border type
|
* @return border type
|
||||||
|
* @deprecated POI 3.15. Use {@link #getBorderRightEnum()} instead.
|
||||||
|
* This will return a BorderStyle enum in the future.
|
||||||
*/
|
*/
|
||||||
BorderStyle getBorderRight();
|
short getBorderRight();
|
||||||
|
/**
|
||||||
|
* get the type of border to use for the right border of the cell
|
||||||
|
* @return border type
|
||||||
|
* @since POI 3.15
|
||||||
|
*/
|
||||||
|
BorderStyle getBorderRightEnum();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the type of border to use for the top border of the cell
|
* set the type of border to use for the top border of the cell
|
||||||
@ -607,19 +627,29 @@ public interface CellStyle {
|
|||||||
* @see #BORDER_SLANTED_DASH_DOT
|
* @see #BORDER_SLANTED_DASH_DOT
|
||||||
* @deprecated 3.15 beta 2. Use {@link #setBorderTop(BorderStyle)} instead
|
* @deprecated 3.15 beta 2. Use {@link #setBorderTop(BorderStyle)} instead
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
void setBorderTop(short border);
|
void setBorderTop(short border);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the type of border to use for the top border of the cell
|
* set the type of border to use for the top border of the cell
|
||||||
* @param border type
|
* @param border type
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
void setBorderTop(BorderStyle border);
|
void setBorderTop(BorderStyle border);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the type of border to use for the top border of the cell
|
* get the type of border to use for the top border of the cell
|
||||||
* @return border type
|
* @return border type
|
||||||
|
* @deprecated POI 3.15. Use {@link #getBorderTopEnum()} instead.
|
||||||
|
* This will return a BorderStyle enum in the future.
|
||||||
*/
|
*/
|
||||||
BorderStyle getBorderTop();
|
short getBorderTop();
|
||||||
|
/**
|
||||||
|
* get the type of border to use for the top border of the cell
|
||||||
|
* @return border type
|
||||||
|
* @since POI 3.15
|
||||||
|
*/
|
||||||
|
BorderStyle getBorderTopEnum();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the type of border to use for the bottom border of the cell
|
* set the type of border to use for the bottom border of the cell
|
||||||
@ -640,19 +670,29 @@ public interface CellStyle {
|
|||||||
* @see #BORDER_SLANTED_DASH_DOT
|
* @see #BORDER_SLANTED_DASH_DOT
|
||||||
* @deprecated 3.15 beta 2. Use {@link #setBorderBottom(BorderStyle)} instead.
|
* @deprecated 3.15 beta 2. Use {@link #setBorderBottom(BorderStyle)} instead.
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
void setBorderBottom(short border);
|
void setBorderBottom(short border);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the type of border to use for the bottom border of the cell
|
* set the type of border to use for the bottom border of the cell
|
||||||
* @param border type
|
* @param border type
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
void setBorderBottom(BorderStyle border);
|
void setBorderBottom(BorderStyle border);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the type of border to use for the bottom border of the cell
|
* get the type of border to use for the bottom border of the cell
|
||||||
* @return border type
|
* @return border type
|
||||||
|
* @deprecated POI 3.15. Use {@link #getBorderBottomEnum()} instead.
|
||||||
|
* This will return a BorderStyle enum in the future.
|
||||||
*/
|
*/
|
||||||
BorderStyle getBorderBottom();
|
short getBorderBottom();
|
||||||
|
/**
|
||||||
|
* get the type of border to use for the bottom border of the cell
|
||||||
|
* @return border type
|
||||||
|
* @since POI 3.15
|
||||||
|
*/
|
||||||
|
BorderStyle getBorderBottomEnum();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the color to use for the left border
|
* set the color to use for the left border
|
||||||
|
@ -405,10 +405,10 @@ public final class CellUtil {
|
|||||||
Map<String, Object> properties = new HashMap<String, Object>();
|
Map<String, Object> properties = new HashMap<String, Object>();
|
||||||
put(properties, ALIGNMENT, style.getAlignmentEnum());
|
put(properties, ALIGNMENT, style.getAlignmentEnum());
|
||||||
put(properties, VERTICAL_ALIGNMENT, style.getVerticalAlignmentEnum());
|
put(properties, VERTICAL_ALIGNMENT, style.getVerticalAlignmentEnum());
|
||||||
put(properties, BORDER_BOTTOM, style.getBorderBottom());
|
put(properties, BORDER_BOTTOM, style.getBorderBottomEnum());
|
||||||
put(properties, BORDER_LEFT, style.getBorderLeft());
|
put(properties, BORDER_LEFT, style.getBorderLeftEnum());
|
||||||
put(properties, BORDER_RIGHT, style.getBorderRight());
|
put(properties, BORDER_RIGHT, style.getBorderRightEnum());
|
||||||
put(properties, BORDER_TOP, style.getBorderTop());
|
put(properties, BORDER_TOP, style.getBorderTopEnum());
|
||||||
put(properties, BOTTOM_BORDER_COLOR, style.getBottomBorderColor());
|
put(properties, BOTTOM_BORDER_COLOR, style.getBottomBorderColor());
|
||||||
put(properties, DATA_FORMAT, style.getDataFormat());
|
put(properties, DATA_FORMAT, style.getDataFormat());
|
||||||
put(properties, FILL_PATTERN, style.getFillPatternEnum());
|
put(properties, FILL_PATTERN, style.getFillPatternEnum());
|
||||||
|
@ -252,11 +252,13 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of border to use for the bottom border of the cell
|
* Get the type of border to use for the bottom border of the cell
|
||||||
|
* Will be removed when {@link #getBorderBottom()} returns a BorderStyle enum
|
||||||
*
|
*
|
||||||
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BorderStyle getBorderBottom() {
|
public BorderStyle getBorderBottomEnum() {
|
||||||
if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
|
if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
|
||||||
|
|
||||||
int idx = (int)_cellXf.getBorderId();
|
int idx = (int)_cellXf.getBorderId();
|
||||||
@ -267,24 +269,26 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
}
|
}
|
||||||
return BorderStyle.valueOf((short)(ptrn.intValue() - 1));
|
return BorderStyle.valueOf((short)(ptrn.intValue() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of border to use for the bottom border of the cell
|
* Get the type of border to use for the bottom border of the cell
|
||||||
|
* This will return a BorderStyle enum in the future.
|
||||||
*
|
*
|
||||||
* @return border type as Java enum
|
* @return border type code
|
||||||
* @deprecated 3.15 beta 2. Use {@link #getBorderBottom}
|
* @deprecated 3.15 beta 2. Use {@link #getBorderBottomEnum()}
|
||||||
*/
|
*/
|
||||||
public BorderStyle getBorderBottomEnum() {
|
public short getBorderBottom() {
|
||||||
return getBorderBottom();
|
return getBorderBottomEnum().getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of border to use for the left border of the cell
|
* Get the type of border to use for the left border of the cell
|
||||||
|
* Will be removed when {@link #getBorderLeft()} returns a BorderStyle enum
|
||||||
*
|
*
|
||||||
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BorderStyle getBorderLeft() {
|
public BorderStyle getBorderLeftEnum() {
|
||||||
if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
|
if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
|
||||||
|
|
||||||
int idx = (int)_cellXf.getBorderId();
|
int idx = (int)_cellXf.getBorderId();
|
||||||
@ -298,21 +302,24 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of border to use for the left border of the cell
|
* Get the type of border to use for the left border of the cell
|
||||||
|
* This will return a BorderStyle enum in the future.
|
||||||
*
|
*
|
||||||
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
* @return border type code
|
||||||
* @deprecated 3.15 beta 2. Use {@link #getBorderLeft}
|
* @deprecated 3.15 beta 2. Use {@link #getBorderLeftEnum()}
|
||||||
*/
|
*/
|
||||||
public BorderStyle getBorderLeftEnum() {
|
public short getBorderLeft() {
|
||||||
return getBorderLeft();
|
return getBorderLeftEnum().getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of border to use for the right border of the cell
|
* Get the type of border to use for the right border of the cell
|
||||||
|
* Will be removed when {@link #getBorderRight()} returns a BorderStyle enum
|
||||||
*
|
*
|
||||||
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BorderStyle getBorderRight() {
|
public BorderStyle getBorderRightEnum() {
|
||||||
if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
|
if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
|
||||||
|
|
||||||
int idx = (int)_cellXf.getBorderId();
|
int idx = (int)_cellXf.getBorderId();
|
||||||
@ -323,24 +330,26 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
}
|
}
|
||||||
return BorderStyle.valueOf((short)(ptrn.intValue() - 1));
|
return BorderStyle.valueOf((short)(ptrn.intValue() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of border to use for the right border of the cell
|
* Get the type of border to use for the right border of the cell
|
||||||
|
* This will return a BorderStyle enum in the future.
|
||||||
*
|
*
|
||||||
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
||||||
* @deprecated 3.15 beta 2. Use {@link #getBorderRight}
|
* @deprecated 3.15 beta 2. Use {@link #getBorderRightEnum()} instead
|
||||||
*/
|
*/
|
||||||
public BorderStyle getBorderRightEnum() {
|
public short getBorderRight() {
|
||||||
return getBorderRight();
|
return getBorderRightEnum().getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of border to use for the top border of the cell
|
* Get the type of border to use for the top border of the cell
|
||||||
|
* Will be removed when {@link #getBorderTop()} returns a BorderStyle enum
|
||||||
*
|
*
|
||||||
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BorderStyle getBorderTop() {
|
public BorderStyle getBorderTopEnum() {
|
||||||
if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
|
if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
|
||||||
|
|
||||||
int idx = (int)_cellXf.getBorderId();
|
int idx = (int)_cellXf.getBorderId();
|
||||||
@ -351,15 +360,15 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
}
|
}
|
||||||
return BorderStyle.valueOf((short) (ptrn.intValue() - 1));
|
return BorderStyle.valueOf((short) (ptrn.intValue() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of border to use for the top border of the cell
|
* Get the type of border to use for the top border of the cell
|
||||||
|
* This will return a BorderStyle enum in the future.
|
||||||
*
|
*
|
||||||
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
|
||||||
* @deprecated 3.15 beta 2. Use {@link #getBorderTop}
|
* @deprecated 3.15 beta 2. Use {@link #getBorderTopEnum()} instead.
|
||||||
*/
|
*/
|
||||||
public BorderStyle getBorderTopEnum() {
|
public short getBorderTop() {
|
||||||
return getBorderTop();
|
return getBorderTopEnum().getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -776,6 +785,7 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
* @see org.apache.poi.ss.usermodel.CellStyle#ALIGN_CENTER_SELECTION
|
* @see org.apache.poi.ss.usermodel.CellStyle#ALIGN_CENTER_SELECTION
|
||||||
* @deprecated POI 3.15 beta 3. Use {@link #setAlignment(HorizontalAlignment)} instead.
|
* @deprecated POI 3.15 beta 3. Use {@link #setAlignment(HorizontalAlignment)} instead.
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
@Override
|
@Override
|
||||||
public void setAlignment(short align) {
|
public void setAlignment(short align) {
|
||||||
setAlignment(HorizontalAlignment.forInt(align));
|
setAlignment(HorizontalAlignment.forInt(align));
|
||||||
@ -797,6 +807,7 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
* @param border the type of border to use
|
* @param border the type of border to use
|
||||||
* @deprecated 3.15 beta 2. Use {@link #setBorderBottom(BorderStyle)}
|
* @deprecated 3.15 beta 2. Use {@link #setBorderBottom(BorderStyle)}
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
@Override
|
@Override
|
||||||
public void setBorderBottom(short border) {
|
public void setBorderBottom(short border) {
|
||||||
setBorderBottom(BorderStyle.valueOf(border));
|
setBorderBottom(BorderStyle.valueOf(border));
|
||||||
@ -807,6 +818,7 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
*
|
*
|
||||||
* @param border - type of border to use
|
* @param border - type of border to use
|
||||||
* @see org.apache.poi.ss.usermodel.BorderStyle
|
* @see org.apache.poi.ss.usermodel.BorderStyle
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setBorderBottom(BorderStyle border) {
|
public void setBorderBottom(BorderStyle border) {
|
||||||
@ -826,6 +838,7 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
* @param border the type of border to use
|
* @param border the type of border to use
|
||||||
* @deprecated 3.15 beta 2. Use {@link #setBorderLeft(BorderStyle)}
|
* @deprecated 3.15 beta 2. Use {@link #setBorderLeft(BorderStyle)}
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
@Override
|
@Override
|
||||||
public void setBorderLeft(short border) {
|
public void setBorderLeft(short border) {
|
||||||
setBorderLeft(BorderStyle.valueOf(border));
|
setBorderLeft(BorderStyle.valueOf(border));
|
||||||
@ -835,6 +848,7 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
* Set the type of border to use for the left border of the cell
|
* Set the type of border to use for the left border of the cell
|
||||||
*
|
*
|
||||||
* @param border the type of border to use
|
* @param border the type of border to use
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setBorderLeft(BorderStyle border) {
|
public void setBorderLeft(BorderStyle border) {
|
||||||
@ -855,6 +869,7 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
* @param border the type of border to use
|
* @param border the type of border to use
|
||||||
* @deprecated 3.15 beta 2. Use {@link #setBorderRight(BorderStyle)}
|
* @deprecated 3.15 beta 2. Use {@link #setBorderRight(BorderStyle)}
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
@Override
|
@Override
|
||||||
public void setBorderRight(short border) {
|
public void setBorderRight(short border) {
|
||||||
setBorderRight(BorderStyle.valueOf(border));
|
setBorderRight(BorderStyle.valueOf(border));
|
||||||
@ -864,6 +879,7 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
* Set the type of border to use for the right border of the cell
|
* Set the type of border to use for the right border of the cell
|
||||||
*
|
*
|
||||||
* @param border the type of border to use
|
* @param border the type of border to use
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setBorderRight(BorderStyle border) {
|
public void setBorderRight(BorderStyle border) {
|
||||||
@ -884,6 +900,7 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
* @param border the type of border to use
|
* @param border the type of border to use
|
||||||
* @deprecated 3.15 beta 2. Use {@link #setBorderTop(BorderStyle)}
|
* @deprecated 3.15 beta 2. Use {@link #setBorderTop(BorderStyle)}
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
@Override
|
@Override
|
||||||
public void setBorderTop(short border) {
|
public void setBorderTop(short border) {
|
||||||
setBorderTop(BorderStyle.valueOf(border));
|
setBorderTop(BorderStyle.valueOf(border));
|
||||||
@ -893,6 +910,7 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
* Set the type of border to use for the top border of the cell
|
* Set the type of border to use for the top border of the cell
|
||||||
*
|
*
|
||||||
* @param border the type of border to use
|
* @param border the type of border to use
|
||||||
|
* @since POI 3.15
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setBorderTop(BorderStyle border) {
|
public void setBorderTop(BorderStyle border) {
|
||||||
@ -1338,6 +1356,7 @@ public class XSSFCellStyle implements CellStyle {
|
|||||||
* @see org.apache.poi.ss.usermodel.VerticalAlignment
|
* @see org.apache.poi.ss.usermodel.VerticalAlignment
|
||||||
* @deprecated POI 3.15 beta 3. Use {@link #setVerticalAlignment(VerticalAlignment)} instead.
|
* @deprecated POI 3.15 beta 3. Use {@link #setVerticalAlignment(VerticalAlignment)} instead.
|
||||||
*/
|
*/
|
||||||
|
@Removal(version="3.17")
|
||||||
@Override
|
@Override
|
||||||
public void setVerticalAlignment(short align) {
|
public void setVerticalAlignment(short align) {
|
||||||
setVerticalAlignment(VerticalAlignment.forInt(align));
|
setVerticalAlignment(VerticalAlignment.forInt(align));
|
||||||
|
@ -104,11 +104,11 @@ public class TestXSSFCellStyle {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetSetBorderBottom() {
|
public void testGetSetBorderBottom() {
|
||||||
//default values
|
//default values
|
||||||
assertEquals(BorderStyle.NONE, cellStyle.getBorderBottom());
|
assertEquals(BorderStyle.NONE, cellStyle.getBorderBottomEnum());
|
||||||
|
|
||||||
int num = stylesTable.getBorders().size();
|
int num = stylesTable.getBorders().size();
|
||||||
cellStyle.setBorderBottom(BorderStyle.MEDIUM);
|
cellStyle.setBorderBottom(BorderStyle.MEDIUM);
|
||||||
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottom());
|
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottomEnum());
|
||||||
//a new border has been added
|
//a new border has been added
|
||||||
assertEquals(num + 1, stylesTable.getBorders().size());
|
assertEquals(num + 1, stylesTable.getBorders().size());
|
||||||
//id of the created border
|
//id of the created border
|
||||||
@ -122,7 +122,7 @@ public class TestXSSFCellStyle {
|
|||||||
//setting the same border multiple times should not change borderId
|
//setting the same border multiple times should not change borderId
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
cellStyle.setBorderBottom(BorderStyle.MEDIUM);
|
cellStyle.setBorderBottom(BorderStyle.MEDIUM);
|
||||||
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottom());
|
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottomEnum());
|
||||||
}
|
}
|
||||||
assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
|
assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
|
||||||
assertEquals(num, stylesTable.getBorders().size());
|
assertEquals(num, stylesTable.getBorders().size());
|
||||||
@ -139,11 +139,11 @@ public class TestXSSFCellStyle {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetSetBorderRight() {
|
public void testGetSetBorderRight() {
|
||||||
//default values
|
//default values
|
||||||
assertEquals(BorderStyle.NONE, cellStyle.getBorderRight());
|
assertEquals(BorderStyle.NONE, cellStyle.getBorderRightEnum());
|
||||||
|
|
||||||
int num = stylesTable.getBorders().size();
|
int num = stylesTable.getBorders().size();
|
||||||
cellStyle.setBorderRight(BorderStyle.MEDIUM);
|
cellStyle.setBorderRight(BorderStyle.MEDIUM);
|
||||||
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRight());
|
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRightEnum());
|
||||||
//a new border has been added
|
//a new border has been added
|
||||||
assertEquals(num + 1, stylesTable.getBorders().size());
|
assertEquals(num + 1, stylesTable.getBorders().size());
|
||||||
//id of the created border
|
//id of the created border
|
||||||
@ -157,7 +157,7 @@ public class TestXSSFCellStyle {
|
|||||||
//setting the same border multiple times should not change borderId
|
//setting the same border multiple times should not change borderId
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
cellStyle.setBorderRight(BorderStyle.MEDIUM);
|
cellStyle.setBorderRight(BorderStyle.MEDIUM);
|
||||||
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRight());
|
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRightEnum());
|
||||||
}
|
}
|
||||||
assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
|
assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
|
||||||
assertEquals(num, stylesTable.getBorders().size());
|
assertEquals(num, stylesTable.getBorders().size());
|
||||||
@ -174,11 +174,11 @@ public class TestXSSFCellStyle {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetSetBorderLeft() {
|
public void testGetSetBorderLeft() {
|
||||||
//default values
|
//default values
|
||||||
assertEquals(BorderStyle.NONE, cellStyle.getBorderLeft());
|
assertEquals(BorderStyle.NONE, cellStyle.getBorderLeftEnum());
|
||||||
|
|
||||||
int num = stylesTable.getBorders().size();
|
int num = stylesTable.getBorders().size();
|
||||||
cellStyle.setBorderLeft(BorderStyle.MEDIUM);
|
cellStyle.setBorderLeft(BorderStyle.MEDIUM);
|
||||||
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeft());
|
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeftEnum());
|
||||||
//a new border has been added
|
//a new border has been added
|
||||||
assertEquals(num + 1, stylesTable.getBorders().size());
|
assertEquals(num + 1, stylesTable.getBorders().size());
|
||||||
//id of the created border
|
//id of the created border
|
||||||
@ -192,7 +192,7 @@ public class TestXSSFCellStyle {
|
|||||||
//setting the same border multiple times should not change borderId
|
//setting the same border multiple times should not change borderId
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
cellStyle.setBorderLeft(BorderStyle.MEDIUM);
|
cellStyle.setBorderLeft(BorderStyle.MEDIUM);
|
||||||
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeft());
|
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeftEnum());
|
||||||
}
|
}
|
||||||
assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
|
assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
|
||||||
assertEquals(num, stylesTable.getBorders().size());
|
assertEquals(num, stylesTable.getBorders().size());
|
||||||
@ -209,11 +209,11 @@ public class TestXSSFCellStyle {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetSetBorderTop() {
|
public void testGetSetBorderTop() {
|
||||||
//default values
|
//default values
|
||||||
assertEquals(BorderStyle.NONE, cellStyle.getBorderTop());
|
assertEquals(BorderStyle.NONE, cellStyle.getBorderTopEnum());
|
||||||
|
|
||||||
int num = stylesTable.getBorders().size();
|
int num = stylesTable.getBorders().size();
|
||||||
cellStyle.setBorderTop(BorderStyle.MEDIUM);
|
cellStyle.setBorderTop(BorderStyle.MEDIUM);
|
||||||
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTop());
|
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTopEnum());
|
||||||
//a new border has been added
|
//a new border has been added
|
||||||
assertEquals(num + 1, stylesTable.getBorders().size());
|
assertEquals(num + 1, stylesTable.getBorders().size());
|
||||||
//id of the created border
|
//id of the created border
|
||||||
@ -227,7 +227,7 @@ public class TestXSSFCellStyle {
|
|||||||
//setting the same border multiple times should not change borderId
|
//setting the same border multiple times should not change borderId
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
cellStyle.setBorderTop(BorderStyle.MEDIUM);
|
cellStyle.setBorderTop(BorderStyle.MEDIUM);
|
||||||
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTop());
|
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTopEnum());
|
||||||
}
|
}
|
||||||
assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
|
assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
|
||||||
assertEquals(num, stylesTable.getBorders().size());
|
assertEquals(num, stylesTable.getBorders().size());
|
||||||
@ -243,7 +243,7 @@ public class TestXSSFCellStyle {
|
|||||||
|
|
||||||
private void testGetSetBorderXMLBean(BorderStyle border, STBorderStyle.Enum expected) {
|
private void testGetSetBorderXMLBean(BorderStyle border, STBorderStyle.Enum expected) {
|
||||||
cellStyle.setBorderTop(border);
|
cellStyle.setBorderTop(border);
|
||||||
assertEquals(border, cellStyle.getBorderTop());
|
assertEquals(border, cellStyle.getBorderTopEnum());
|
||||||
int borderId = (int)cellStyle.getCoreXf().getBorderId();
|
int borderId = (int)cellStyle.getCoreXf().getBorderId();
|
||||||
assertTrue(borderId > 0);
|
assertTrue(borderId > 0);
|
||||||
//check changes in the underlying xml bean
|
//check changes in the underlying xml bean
|
||||||
@ -256,7 +256,7 @@ public class TestXSSFCellStyle {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetSetBorderNone() {
|
public void testGetSetBorderNone() {
|
||||||
cellStyle.setBorderTop(BorderStyle.NONE);
|
cellStyle.setBorderTop(BorderStyle.NONE);
|
||||||
assertEquals(BorderStyle.NONE, cellStyle.getBorderTop());
|
assertEquals(BorderStyle.NONE, cellStyle.getBorderTopEnum());
|
||||||
int borderId = (int)cellStyle.getCoreXf().getBorderId();
|
int borderId = (int)cellStyle.getCoreXf().getBorderId();
|
||||||
assertTrue(borderId > 0);
|
assertTrue(borderId > 0);
|
||||||
//check changes in the underlying xml bean
|
//check changes in the underlying xml bean
|
||||||
@ -562,10 +562,10 @@ public class TestXSSFCellStyle {
|
|||||||
assertEquals(style2.getRightBorderColor(), style1.getRightBorderColor());
|
assertEquals(style2.getRightBorderColor(), style1.getRightBorderColor());
|
||||||
assertEquals(style2.getBottomBorderColor(), style1.getBottomBorderColor());
|
assertEquals(style2.getBottomBorderColor(), style1.getBottomBorderColor());
|
||||||
|
|
||||||
assertEquals(style2.getBorderBottom(), style1.getBorderBottom());
|
assertEquals(style2.getBorderBottomEnum(), style1.getBorderBottomEnum());
|
||||||
assertEquals(style2.getBorderLeft(), style1.getBorderLeft());
|
assertEquals(style2.getBorderLeftEnum(), style1.getBorderLeftEnum());
|
||||||
assertEquals(style2.getBorderRight(), style1.getBorderRight());
|
assertEquals(style2.getBorderRightEnum(), style1.getBorderRightEnum());
|
||||||
assertEquals(style2.getBorderTop(), style1.getBorderTop());
|
assertEquals(style2.getBorderTopEnum(), style1.getBorderTopEnum());
|
||||||
wb2.close();
|
wb2.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -999,7 +999,7 @@ public class TestXSSFCellStyle {
|
|||||||
Workbook copy = XSSFTestDataSamples.writeOutAndReadBack(target);
|
Workbook copy = XSSFTestDataSamples.writeOutAndReadBack(target);
|
||||||
|
|
||||||
// previously this failed because the border-element was not copied over
|
// previously this failed because the border-element was not copied over
|
||||||
copy.getCellStyleAt((short)1).getBorderBottom();
|
copy.getCellStyleAt((short)1).getBorderBottomEnum();
|
||||||
|
|
||||||
copy.close();
|
copy.close();
|
||||||
|
|
||||||
|
@ -193,10 +193,10 @@ public class ExcelToFoConverter extends AbstractExcelConverter
|
|||||||
protected boolean isEmptyStyle( CellStyle cellStyle ) {
|
protected boolean isEmptyStyle( CellStyle cellStyle ) {
|
||||||
return cellStyle == null || (
|
return cellStyle == null || (
|
||||||
cellStyle.getFillPattern() == 0
|
cellStyle.getFillPattern() == 0
|
||||||
&& cellStyle.getBorderTop() == BorderStyle.NONE
|
&& cellStyle.getBorderTopEnum() == BorderStyle.NONE
|
||||||
&& cellStyle.getBorderRight() == BorderStyle.NONE
|
&& cellStyle.getBorderRightEnum() == BorderStyle.NONE
|
||||||
&& cellStyle.getBorderBottom() == BorderStyle.NONE
|
&& cellStyle.getBorderBottomEnum() == BorderStyle.NONE
|
||||||
&& cellStyle.getBorderLeft() == BorderStyle.NONE
|
&& cellStyle.getBorderLeftEnum() == BorderStyle.NONE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,13 +361,13 @@ public class ExcelToFoConverter extends AbstractExcelConverter
|
|||||||
}
|
}
|
||||||
|
|
||||||
processCellStyleBorder( workbook, cellTarget, "top",
|
processCellStyleBorder( workbook, cellTarget, "top",
|
||||||
cellStyle.getBorderTop(), cellStyle.getTopBorderColor() );
|
cellStyle.getBorderTopEnum(), cellStyle.getTopBorderColor() );
|
||||||
processCellStyleBorder( workbook, cellTarget, "right",
|
processCellStyleBorder( workbook, cellTarget, "right",
|
||||||
cellStyle.getBorderRight(), cellStyle.getRightBorderColor() );
|
cellStyle.getBorderRightEnum(), cellStyle.getRightBorderColor() );
|
||||||
processCellStyleBorder( workbook, cellTarget, "bottom",
|
processCellStyleBorder( workbook, cellTarget, "bottom",
|
||||||
cellStyle.getBorderBottom(), cellStyle.getBottomBorderColor() );
|
cellStyle.getBorderBottomEnum(), cellStyle.getBottomBorderColor() );
|
||||||
processCellStyleBorder( workbook, cellTarget, "left",
|
processCellStyleBorder( workbook, cellTarget, "left",
|
||||||
cellStyle.getBorderLeft(), cellStyle.getLeftBorderColor() );
|
cellStyle.getBorderLeftEnum(), cellStyle.getLeftBorderColor() );
|
||||||
|
|
||||||
HSSFFont font = cellStyle.getFont( workbook );
|
HSSFFont font = cellStyle.getFont( workbook );
|
||||||
processCellStyleFont( workbook, blockTarget, font );
|
processCellStyleFont( workbook, blockTarget, font );
|
||||||
|
@ -175,13 +175,13 @@ public class ExcelToHtmlConverter extends AbstractExcelConverter
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
buildStyle_border( workbook, style, "top", cellStyle.getBorderTop(),
|
buildStyle_border( workbook, style, "top", cellStyle.getBorderTopEnum(),
|
||||||
cellStyle.getTopBorderColor() );
|
cellStyle.getTopBorderColor() );
|
||||||
buildStyle_border( workbook, style, "right",
|
buildStyle_border( workbook, style, "right",
|
||||||
cellStyle.getBorderRight(), cellStyle.getRightBorderColor() );
|
cellStyle.getBorderRightEnum(), cellStyle.getRightBorderColor() );
|
||||||
buildStyle_border( workbook, style, "bottom",
|
buildStyle_border( workbook, style, "bottom",
|
||||||
cellStyle.getBorderBottom(), cellStyle.getBottomBorderColor() );
|
cellStyle.getBorderBottomEnum(), cellStyle.getBottomBorderColor() );
|
||||||
buildStyle_border( workbook, style, "left", cellStyle.getBorderLeft(),
|
buildStyle_border( workbook, style, "left", cellStyle.getBorderLeftEnum(),
|
||||||
cellStyle.getLeftBorderColor() );
|
cellStyle.getLeftBorderColor() );
|
||||||
|
|
||||||
HSSFFont font = cellStyle.getFont( workbook );
|
HSSFFont font = cellStyle.getFont( workbook );
|
||||||
|
@ -2567,7 +2567,7 @@ public final class TestBugs extends BaseTestBugzillaIssues {
|
|||||||
HSSFSheet sheet = wb.getSheetAt(0);
|
HSSFSheet sheet = wb.getSheetAt(0);
|
||||||
HSSFRow row = sheet.getRow(0);
|
HSSFRow row = sheet.getRow(0);
|
||||||
HSSFCellStyle rstyle = row.getRowStyle();
|
HSSFCellStyle rstyle = row.getRowStyle();
|
||||||
assertEquals(BorderStyle.DOUBLE, rstyle.getBorderBottom());
|
assertEquals(BorderStyle.DOUBLE, rstyle.getBorderBottomEnum());
|
||||||
wb.close();
|
wb.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,40 +348,40 @@ public final class TestCellStyle extends TestCase {
|
|||||||
HSSFCellStyle cs;
|
HSSFCellStyle cs;
|
||||||
|
|
||||||
cs = s.getRow(0).getCell(0).getCellStyle();
|
cs = s.getRow(0).getCell(0).getCellStyle();
|
||||||
assertEquals(BorderStyle.HAIR, cs.getBorderRight());
|
assertEquals(BorderStyle.HAIR, cs.getBorderRightEnum());
|
||||||
|
|
||||||
cs = s.getRow(1).getCell(1).getCellStyle();
|
cs = s.getRow(1).getCell(1).getCellStyle();
|
||||||
assertEquals(BorderStyle.DOTTED, cs.getBorderRight());
|
assertEquals(BorderStyle.DOTTED, cs.getBorderRightEnum());
|
||||||
|
|
||||||
cs = s.getRow(2).getCell(2).getCellStyle();
|
cs = s.getRow(2).getCell(2).getCellStyle();
|
||||||
assertEquals(BorderStyle.DASH_DOT_DOT, cs.getBorderRight());
|
assertEquals(BorderStyle.DASH_DOT_DOT, cs.getBorderRightEnum());
|
||||||
|
|
||||||
cs = s.getRow(3).getCell(3).getCellStyle();
|
cs = s.getRow(3).getCell(3).getCellStyle();
|
||||||
assertEquals(BorderStyle.DASHED, cs.getBorderRight());
|
assertEquals(BorderStyle.DASHED, cs.getBorderRightEnum());
|
||||||
|
|
||||||
cs = s.getRow(4).getCell(4).getCellStyle();
|
cs = s.getRow(4).getCell(4).getCellStyle();
|
||||||
assertEquals(BorderStyle.THIN, cs.getBorderRight());
|
assertEquals(BorderStyle.THIN, cs.getBorderRightEnum());
|
||||||
|
|
||||||
cs = s.getRow(5).getCell(5).getCellStyle();
|
cs = s.getRow(5).getCell(5).getCellStyle();
|
||||||
assertEquals(BorderStyle.MEDIUM_DASH_DOT_DOT, cs.getBorderRight());
|
assertEquals(BorderStyle.MEDIUM_DASH_DOT_DOT, cs.getBorderRightEnum());
|
||||||
|
|
||||||
cs = s.getRow(6).getCell(6).getCellStyle();
|
cs = s.getRow(6).getCell(6).getCellStyle();
|
||||||
assertEquals(BorderStyle.SLANTED_DASH_DOT, cs.getBorderRight());
|
assertEquals(BorderStyle.SLANTED_DASH_DOT, cs.getBorderRightEnum());
|
||||||
|
|
||||||
cs = s.getRow(7).getCell(7).getCellStyle();
|
cs = s.getRow(7).getCell(7).getCellStyle();
|
||||||
assertEquals(BorderStyle.MEDIUM_DASH_DOT, cs.getBorderRight());
|
assertEquals(BorderStyle.MEDIUM_DASH_DOT, cs.getBorderRightEnum());
|
||||||
|
|
||||||
cs = s.getRow(8).getCell(8).getCellStyle();
|
cs = s.getRow(8).getCell(8).getCellStyle();
|
||||||
assertEquals(BorderStyle.MEDIUM_DASHED, cs.getBorderRight());
|
assertEquals(BorderStyle.MEDIUM_DASHED, cs.getBorderRightEnum());
|
||||||
|
|
||||||
cs = s.getRow(9).getCell(9).getCellStyle();
|
cs = s.getRow(9).getCell(9).getCellStyle();
|
||||||
assertEquals(BorderStyle.MEDIUM, cs.getBorderRight());
|
assertEquals(BorderStyle.MEDIUM, cs.getBorderRightEnum());
|
||||||
|
|
||||||
cs = s.getRow(10).getCell(10).getCellStyle();
|
cs = s.getRow(10).getCell(10).getCellStyle();
|
||||||
assertEquals(BorderStyle.THICK, cs.getBorderRight());
|
assertEquals(BorderStyle.THICK, cs.getBorderRightEnum());
|
||||||
|
|
||||||
cs = s.getRow(11).getCell(11).getCellStyle();
|
cs = s.getRow(11).getCell(11).getCellStyle();
|
||||||
assertEquals(BorderStyle.DOUBLE, cs.getBorderRight());
|
assertEquals(BorderStyle.DOUBLE, cs.getBorderRightEnum());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testShrinkToFit() {
|
public void testShrinkToFit() {
|
||||||
@ -500,7 +500,7 @@ public final class TestCellStyle extends TestCase {
|
|||||||
newCell.setCellValue("2testtext2");
|
newCell.setCellValue("2testtext2");
|
||||||
|
|
||||||
CellStyle newStyle = newCell.getCellStyle();
|
CellStyle newStyle = newCell.getCellStyle();
|
||||||
assertEquals(BorderStyle.DOTTED, newStyle.getBorderBottom());
|
assertEquals(BorderStyle.DOTTED, newStyle.getBorderBottomEnum());
|
||||||
assertEquals(Font.COLOR_RED, ((HSSFCellStyle)newStyle).getFont(wb).getColor());
|
assertEquals(Font.COLOR_RED, ((HSSFCellStyle)newStyle).getFont(wb).getColor());
|
||||||
|
|
||||||
// OutputStream out = new FileOutputStream("/tmp/56959.xls");
|
// OutputStream out = new FileOutputStream("/tmp/56959.xls");
|
||||||
|
@ -308,8 +308,8 @@ public final class TestHSSFOptimiser extends TestCase {
|
|||||||
// Check
|
// Check
|
||||||
assertEquals(23, wb.getNumCellStyles());
|
assertEquals(23, wb.getNumCellStyles());
|
||||||
|
|
||||||
assertEquals(BorderStyle.THICK, r.getCell(0).getCellStyle().getBorderBottom());
|
assertEquals(BorderStyle.THICK, r.getCell(0).getCellStyle().getBorderBottomEnum());
|
||||||
assertEquals(BorderStyle.DASH_DOT, r.getCell(1).getCellStyle().getBorderBottom());
|
assertEquals(BorderStyle.DASH_DOT, r.getCell(1).getCellStyle().getBorderBottomEnum());
|
||||||
assertEquals(BorderStyle.THICK, r.getCell(2).getCellStyle().getBorderBottom());
|
assertEquals(BorderStyle.THICK, r.getCell(2).getCellStyle().getBorderBottomEnum());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,10 +151,10 @@ public final class TestRowStyle extends TestCase {
|
|||||||
assertNotNull("Row is not null", r);
|
assertNotNull("Row is not null", r);
|
||||||
|
|
||||||
cs = r.getRowStyle();
|
cs = r.getRowStyle();
|
||||||
assertEquals("Bottom Border Style for row:", BorderStyle.THIN, cs.getBorderBottom());
|
assertEquals("Bottom Border Style for row:", BorderStyle.THIN, cs.getBorderBottomEnum());
|
||||||
assertEquals("Left Border Style for row:", BorderStyle.THIN, cs.getBorderLeft());
|
assertEquals("Left Border Style for row:", BorderStyle.THIN, cs.getBorderLeftEnum());
|
||||||
assertEquals("Right Border Style for row:", BorderStyle.THIN, cs.getBorderRight());
|
assertEquals("Right Border Style for row:", BorderStyle.THIN, cs.getBorderRightEnum());
|
||||||
assertEquals("Top Border Style for row:", BorderStyle.THIN, cs.getBorderTop());
|
assertEquals("Top Border Style for row:", BorderStyle.THIN, cs.getBorderTopEnum());
|
||||||
assertEquals("FillForegroundColor for row:", 0xA, cs.getFillForegroundColor());
|
assertEquals("FillForegroundColor for row:", 0xA, cs.getFillForegroundColor());
|
||||||
assertEquals("FillPattern for row:", 0x1, cs.getFillPattern());
|
assertEquals("FillPattern for row:", 0x1, cs.getFillPattern());
|
||||||
|
|
||||||
|
@ -73,10 +73,10 @@ public class BaseTestBorderStyle {
|
|||||||
|
|
||||||
protected void assertBorderStyleEquals(BorderStyle expected, Cell cell) {
|
protected void assertBorderStyleEquals(BorderStyle expected, Cell cell) {
|
||||||
CellStyle style = cell.getCellStyle();
|
CellStyle style = cell.getCellStyle();
|
||||||
assertEquals(expected, style.getBorderTop());
|
assertEquals(expected, style.getBorderTopEnum());
|
||||||
assertEquals(expected, style.getBorderBottom());
|
assertEquals(expected, style.getBorderBottomEnum());
|
||||||
assertEquals(expected, style.getBorderLeft());
|
assertEquals(expected, style.getBorderLeftEnum());
|
||||||
assertEquals(expected, style.getBorderRight());
|
assertEquals(expected, style.getBorderRightEnum());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -278,10 +278,10 @@ public abstract class BaseTestCell {
|
|||||||
|
|
||||||
assertNotNull("Formula Cell Style", cs);
|
assertNotNull("Formula Cell Style", cs);
|
||||||
assertEquals("Font Index Matches", f.getIndex(), cs.getFontIndex());
|
assertEquals("Font Index Matches", f.getIndex(), cs.getFontIndex());
|
||||||
assertEquals("Top Border", BorderStyle.THIN, cs.getBorderTop());
|
assertEquals("Top Border", BorderStyle.THIN, cs.getBorderTopEnum());
|
||||||
assertEquals("Left Border", BorderStyle.THIN, cs.getBorderLeft());
|
assertEquals("Left Border", BorderStyle.THIN, cs.getBorderLeftEnum());
|
||||||
assertEquals("Right Border", BorderStyle.THIN, cs.getBorderRight());
|
assertEquals("Right Border", BorderStyle.THIN, cs.getBorderRightEnum());
|
||||||
assertEquals("Bottom Border", BorderStyle.THIN, cs.getBorderBottom());
|
assertEquals("Bottom Border", BorderStyle.THIN, cs.getBorderBottomEnum());
|
||||||
wb2.close();
|
wb2.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,11 +99,11 @@ public class BaseTestCellUtil {
|
|||||||
|
|
||||||
// A valid BorderStyle constant, as a Short
|
// A valid BorderStyle constant, as a Short
|
||||||
CellUtil.setCellStyleProperty(c, CellUtil.BORDER_BOTTOM, BorderStyle.DASH_DOT.getCode());
|
CellUtil.setCellStyleProperty(c, CellUtil.BORDER_BOTTOM, BorderStyle.DASH_DOT.getCode());
|
||||||
assertEquals(BorderStyle.DASH_DOT, c.getCellStyle().getBorderBottom());
|
assertEquals(BorderStyle.DASH_DOT, c.getCellStyle().getBorderBottomEnum());
|
||||||
|
|
||||||
// A valid BorderStyle constant, as an Enum
|
// A valid BorderStyle constant, as an Enum
|
||||||
CellUtil.setCellStyleProperty(c, CellUtil.BORDER_TOP, BorderStyle.MEDIUM_DASH_DOT);
|
CellUtil.setCellStyleProperty(c, CellUtil.BORDER_TOP, BorderStyle.MEDIUM_DASH_DOT);
|
||||||
assertEquals(BorderStyle.MEDIUM_DASH_DOT, c.getCellStyle().getBorderTop());
|
assertEquals(BorderStyle.MEDIUM_DASH_DOT, c.getCellStyle().getBorderTopEnum());
|
||||||
|
|
||||||
wb.close();
|
wb.close();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user