]> source.dussan.org Git - poi.git/commitdiff
add LINK_TYPE_SECONDARY_CATEGORIES, which appears to be a valid type (0x03) based...
authorJaven O'Neal <onealj@apache.org>
Tue, 12 Apr 2016 11:03:58 +0000 (11:03 +0000)
committerJaven O'Neal <onealj@apache.org>
Tue, 12 Apr 2016 11:03:58 +0000 (11:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1738762 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/record/chart/LinkedDataRecord.java
src/scratchpad/src/org/apache/poi/hssf/usermodel/HSSFChart.java

index 58c758e4c42b814ac5877a8794042ceaf1a79e0c..1fc87350f8e898608de3e76e2d6fd48a82300360 100644 (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_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)
     {
index e08fb2d74b635592dd0e215439eef44ffc6a4f31..a919b047f26d4ee98fb9c42558b2b7426db27b72 100644 (file)
@@ -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());
                        }
                }