bug 55385: deprecate Font.getBoldweight and Font.setBoldweight

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1748658 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2016-06-16 06:51:53 +00:00
parent 5028639443
commit 0472d9d861
4 changed files with 18 additions and 5 deletions

View File

@ -205,6 +205,7 @@ public final class HSSFFont implements Font {
* @param boldweight
* @see #BOLDWEIGHT_NORMAL
* @see #BOLDWEIGHT_BOLD
* @deprecated 3.15 beta 2. Scheduled for removal in 3.17. Use {@link #setBold(boolean)} instead.
*/
public void setBoldweight(short boldweight)
{
@ -227,6 +228,7 @@ public final class HSSFFont implements Font {
* @return boldweight
* @see #BOLDWEIGHT_NORMAL
* @see #BOLDWEIGHT_BOLD
* @deprecated 3.15 beta 2. Scheduled for removal in 3.17. Use {@link #getBold} instead.
*/
public short getBoldweight()
{

View File

@ -21,14 +21,16 @@ package org.apache.poi.ss.usermodel;
public interface Font {
/**
* Normal boldness (not bold)
* @deprecated 3.15 beta 2. Scheduled for removal in 3.17.
* Boldweight constants no longer needed due to {@link #getBold} and {@link #setBold(boolean)}
*/
public final static short BOLDWEIGHT_NORMAL = 0x190;
/**
* Bold boldness (bold)
* @deprecated 3.15 beta 2. Scheduled for removal in 3.17.
* Boldweight constants no longer needed due to {@link #getBold} and {@link #setBold(boolean)}
*/
public final static short BOLDWEIGHT_BOLD = 0x2bc;
/**
@ -281,9 +283,15 @@ public interface Font {
*/
public short getIndex();
/**
* @deprecated 3.15 beta 2. Scheduled for removal in 3.17. Use {@link #setBold(boolean)}.
*/
public void setBoldweight(short boldweight);
public void setBold(boolean bold);
/**
* @deprecated 3.15 beta 2. Scheduled for removal in 3.17. Use {@link #getBold()}.
*/
public short getBoldweight();
public boolean getBold();
}
}

View File

@ -297,6 +297,9 @@ public class XSSFFont implements Font {
}
}
/**
* @deprecated 3.15 beta 2. Scheduled for removal in 3.17. Use {@link #setBold(boolean)} instead.
*/
public void setBoldweight(short boldweight)
{
setBold(boldweight == BOLDWEIGHT_BOLD);
@ -307,8 +310,8 @@ public class XSSFFont implements Font {
* @return boldweight
* @see #BOLDWEIGHT_NORMAL
* @see #BOLDWEIGHT_BOLD
* @deprecated 3.15 beta 2. Scheduled for removal in 3.17. Use {@link #getBold} instead.
*/
public short getBoldweight()
{
return getBold() ? BOLDWEIGHT_BOLD : BOLDWEIGHT_NORMAL;

View File

@ -69,7 +69,7 @@ public final class TestXSSFFont extends BaseTestFont{
}
@Test
public void testBoldweight() {
public void testBold() {
CTFont ctFont=CTFont.Factory.newInstance();
CTBooleanProperty bool=ctFont.addNewB();
bool.setVal(false);