From: Javen O'Neal Date: Tue, 12 Apr 2016 11:03:58 +0000 (+0000) Subject: add LINK_TYPE_SECONDARY_CATEGORIES, which appears to be a valid type (0x03) based... X-Git-Tag: REL_3_15_BETA2~313 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4ae65e6253d7df97b6ae6553263622c4bc46b765;p=poi.git 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 --- diff --git a/src/java/org/apache/poi/hssf/record/chart/LinkedDataRecord.java b/src/java/org/apache/poi/hssf/record/chart/LinkedDataRecord.java index 58c758e4c4..1fc87350f8 100644 --- a/src/java/org/apache/poi/hssf/record/chart/LinkedDataRecord.java +++ b/src/java/org/apache/poi/hssf/record/chart/LinkedDataRecord.java @@ -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_VALUES = 1; public final static byte LINK_TYPE_CATEGORIES = 2; + public final static byte LINK_TYPE_SECONDARY_CATEGORIES = 3; private byte field_2_referenceType; public final static byte REFERENCE_TYPE_DEFAULT_CATEGORIES = 0; 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. * * @return One of - * LINK_TYPE_TITLE_OR_TEXT - * LINK_TYPE_VALUES - * LINK_TYPE_CATEGORIES + * {@link #LINK_TYPE_TITLE_OR_TEXT}, + * {@link #LINK_TYPE_VALUES}, + * {@link #LINK_TYPE_CATEGORIES}, or + * {@link #LINK_TYPE_SECONDARY_CATEGORIES} */ public byte getLinkType() { @@ -135,9 +137,10 @@ public final class LinkedDataRecord extends StandardRecord implements Cloneable * * @param field_1_linkType * One of - * LINK_TYPE_TITLE_OR_TEXT - * LINK_TYPE_VALUES - * LINK_TYPE_CATEGORIES + * {@link #LINK_TYPE_TITLE_OR_TEXT}, + * {@link #LINK_TYPE_VALUES}, + * {@link #LINK_TYPE_CATEGORIES}, or + * {@link #LINK_TYPE_SECONDARY_CATEGORIES} */ 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. * * @return One of - * REFERENCE_TYPE_DEFAULT_CATEGORIES - * REFERENCE_TYPE_DIRECT - * REFERENCE_TYPE_WORKSHEET - * REFERENCE_TYPE_NOT_USED - * REFERENCE_TYPE_ERROR_REPORTED + * {@link #REFERENCE_TYPE_DEFAULT_CATEGORIES} + * {@link #REFERENCE_TYPE_DIRECT} + * {@link #REFERENCE_TYPE_WORKSHEET} + * {@link #REFERENCE_TYPE_NOT_USED} + * {@link #REFERENCE_TYPE_ERROR_REPORTED} */ public byte getReferenceType() { @@ -164,11 +167,11 @@ public final class LinkedDataRecord extends StandardRecord implements Cloneable * * @param field_2_referenceType * One of - * REFERENCE_TYPE_DEFAULT_CATEGORIES - * REFERENCE_TYPE_DIRECT - * REFERENCE_TYPE_WORKSHEET - * REFERENCE_TYPE_NOT_USED - * REFERENCE_TYPE_ERROR_REPORTED + * {@link #REFERENCE_TYPE_DEFAULT_CATEGORIES} + * {@link #REFERENCE_TYPE_DIRECT} + * {@link #REFERENCE_TYPE_WORKSHEET} + * {@link #REFERENCE_TYPE_NOT_USED} + * {@link #REFERENCE_TYPE_ERROR_REPORTED} */ public void setReferenceType(byte field_2_referenceType) { diff --git a/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java b/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java index e08fb2d74b..a919b047f2 100644 --- a/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java +++ b/src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java @@ -1005,14 +1005,21 @@ public final class HSSFChart { /* package */ void insertData(LinkedDataRecord data){ switch(data.getLinkType()){ - case 0: dataName = data; - break; - case 1: dataValues = data; - break; - case 2: dataCategoryLabels = data; - break; - case 3: dataSecondaryCategoryLabels = data; - break; + + case LinkedDataRecord.LINK_TYPE_TITLE_OR_TEXT: + dataName = data; + break; + case LinkedDataRecord.LINK_TYPE_VALUES: + dataValues = data; + 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()); } }