add LINK_TYPE_SECONDARY_CATEGORIES, which appears to be a valid type (0x03) based on HSSFChart.insertData

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1738762 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2016-04-12 11:03:58 +00:00
parent 6e22add129
commit 4ae65e6253
2 changed files with 34 additions and 24 deletions

View File

@ -40,6 +40,7 @@ public final class LinkedDataRecord extends StandardRecord implements Cloneable
public final static byte LINK_TYPE_TITLE_OR_TEXT = 0; public final static byte LINK_TYPE_TITLE_OR_TEXT = 0;
public final static byte LINK_TYPE_VALUES = 1; public final static byte LINK_TYPE_VALUES = 1;
public final static byte LINK_TYPE_CATEGORIES = 2; public final static byte LINK_TYPE_CATEGORIES = 2;
public final static byte LINK_TYPE_SECONDARY_CATEGORIES = 3;
private byte field_2_referenceType; private byte field_2_referenceType;
public final static byte REFERENCE_TYPE_DEFAULT_CATEGORIES = 0; public final static byte REFERENCE_TYPE_DEFAULT_CATEGORIES = 0;
public final static byte REFERENCE_TYPE_DIRECT = 1; public final static byte REFERENCE_TYPE_DIRECT = 1;
@ -121,9 +122,10 @@ public final class LinkedDataRecord extends StandardRecord implements Cloneable
* Get the link type field for the LinkedData record. * Get the link type field for the LinkedData record.
* *
* @return One of * @return One of
* LINK_TYPE_TITLE_OR_TEXT * {@link #LINK_TYPE_TITLE_OR_TEXT},
* LINK_TYPE_VALUES * {@link #LINK_TYPE_VALUES},
* LINK_TYPE_CATEGORIES * {@link #LINK_TYPE_CATEGORIES}, or
* {@link #LINK_TYPE_SECONDARY_CATEGORIES}
*/ */
public byte getLinkType() public byte getLinkType()
{ {
@ -135,9 +137,10 @@ public final class LinkedDataRecord extends StandardRecord implements Cloneable
* *
* @param field_1_linkType * @param field_1_linkType
* One of * One of
* LINK_TYPE_TITLE_OR_TEXT * {@link #LINK_TYPE_TITLE_OR_TEXT},
* LINK_TYPE_VALUES * {@link #LINK_TYPE_VALUES},
* LINK_TYPE_CATEGORIES * {@link #LINK_TYPE_CATEGORIES}, or
* {@link #LINK_TYPE_SECONDARY_CATEGORIES}
*/ */
public void setLinkType(byte field_1_linkType) public void setLinkType(byte field_1_linkType)
{ {
@ -148,11 +151,11 @@ public final class LinkedDataRecord extends StandardRecord implements Cloneable
* Get the reference type field for the LinkedData record. * Get the reference type field for the LinkedData record.
* *
* @return One of * @return One of
* REFERENCE_TYPE_DEFAULT_CATEGORIES * {@link #REFERENCE_TYPE_DEFAULT_CATEGORIES}
* REFERENCE_TYPE_DIRECT * {@link #REFERENCE_TYPE_DIRECT}
* REFERENCE_TYPE_WORKSHEET * {@link #REFERENCE_TYPE_WORKSHEET}
* REFERENCE_TYPE_NOT_USED * {@link #REFERENCE_TYPE_NOT_USED}
* REFERENCE_TYPE_ERROR_REPORTED * {@link #REFERENCE_TYPE_ERROR_REPORTED}
*/ */
public byte getReferenceType() public byte getReferenceType()
{ {
@ -164,11 +167,11 @@ public final class LinkedDataRecord extends StandardRecord implements Cloneable
* *
* @param field_2_referenceType * @param field_2_referenceType
* One of * One of
* REFERENCE_TYPE_DEFAULT_CATEGORIES * {@link #REFERENCE_TYPE_DEFAULT_CATEGORIES}
* REFERENCE_TYPE_DIRECT * {@link #REFERENCE_TYPE_DIRECT}
* REFERENCE_TYPE_WORKSHEET * {@link #REFERENCE_TYPE_WORKSHEET}
* REFERENCE_TYPE_NOT_USED * {@link #REFERENCE_TYPE_NOT_USED}
* REFERENCE_TYPE_ERROR_REPORTED * {@link #REFERENCE_TYPE_ERROR_REPORTED}
*/ */
public void setReferenceType(byte field_2_referenceType) public void setReferenceType(byte field_2_referenceType)
{ {

View File

@ -1005,14 +1005,21 @@ public final class HSSFChart {
/* package */ void insertData(LinkedDataRecord data){ /* package */ void insertData(LinkedDataRecord data){
switch(data.getLinkType()){ switch(data.getLinkType()){
case 0: dataName = data;
break; case LinkedDataRecord.LINK_TYPE_TITLE_OR_TEXT:
case 1: dataValues = data; dataName = data;
break; break;
case 2: dataCategoryLabels = data; case LinkedDataRecord.LINK_TYPE_VALUES:
break; dataValues = data;
case 3: dataSecondaryCategoryLabels = data; break;
break; case LinkedDataRecord.LINK_TYPE_CATEGORIES:
dataCategoryLabels = data;
break;
case LinkedDataRecord.LINK_TYPE_SECONDARY_CATEGORIES:
dataSecondaryCategoryLabels = data;
break;
default:
throw new IllegalStateException("Invalid link type: " + data.getLinkType());
} }
} }