]> source.dussan.org Git - poi.git/commitdiff
Added clone support for UserSView* and Feat* families of records, see bug #49649
authorYegor Kozlov <yegor@apache.org>
Wed, 28 Jul 2010 15:51:57 +0000 (15:51 +0000)
committerYegor Kozlov <yegor@apache.org>
Wed, 28 Jul 2010 15:51:57 +0000 (15:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@980102 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/java/org/apache/poi/hssf/record/FeatHdrRecord.java
src/java/org/apache/poi/hssf/record/FeatRecord.java
src/java/org/apache/poi/hssf/record/HeaderFooterRecord.java
src/java/org/apache/poi/hssf/record/UserSViewBegin.java
src/java/org/apache/poi/hssf/record/UserSViewEnd.java
src/testcases/org/apache/poi/hssf/record/TestFeatRecord.java

index 4e21fa3a06bd074d1544763cc3e39e90bc16788d..6f2623971ddcc5e4ba51a7a4121f905e1e4436f9 100644 (file)
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.7-beta2" date="2010-??-??">
+           <action dev="POI-DEVELOPERS" type="fix">49649 - Added clone support for UserSView* and Feat* families of records</action>
            <action dev="POI-DEVELOPERS" type="fix">49653 - Support for escaped unicode characters in Shared String Table</action>
            <action dev="POI-DEVELOPERS" type="fix">49579 - prevent ArrayIndexOutOfBoundException in UnknowEscherRecord</action>
            <action dev="POI-DEVELOPERS" type="fix">49593 - preserve leading and trailing white spaces in  XWPFRun</action>
index fe7a137eb6cdfefe73ab51739fd4d42eb3259bf9..5382bef34b277dbfb5a2ef6f4701e25655c552a1 100644 (file)
@@ -105,4 +105,11 @@ public final class FeatHdrRecord extends StandardRecord  {
        protected int getDataSize() {
                return 12 + 2+1+4+rgbHdrData.length;
        }
+    
+    //HACK: do a "cheat" clone, see Record.java for more information
+    public Object clone() {
+        return cloneViaReserialise();
+    }
+
+    
 }
index c9fed7d40d6534954b4c703994d42b599fc8c756..267eced88e848cdc5c4845c08d83551f92340952 100644 (file)
@@ -167,4 +167,12 @@ public final class FeatRecord extends StandardRecord  {
                        cbFeatData = 0;
                }
        }
+
+    
+    //HACK: do a "cheat" clone, see Record.java for more information
+    public Object clone() {
+        return cloneViaReserialise();
+    }
+
+    
 }
index 23d266fa67311a020d3e29349542ee5f0faed559..96457b99cd6f6626230acbbb3ba3b823ff153031 100755 (executable)
@@ -94,5 +94,11 @@ public final class HeaderFooterRecord extends StandardRecord {
         sb.append("[/").append("HEADERFOOTER").append("]\n");
         return sb.toString();
     }
+
+    //HACK: do a "cheat" clone, see Record.java for more information
+    public Object clone() {
+                return cloneViaReserialise();
+    }
     
 }
\ No newline at end of file
index ad59a5868e8314bf3610a7e4fa8deb26082e0abb..7b632a02e56f03abd4ff7e51b87ef03a4104ac8e 100644 (file)
@@ -83,5 +83,10 @@ public final class UserSViewBegin extends StandardRecord {
         sb.append("[/").append("USERSVIEWBEGIN").append("]\n");
         return sb.toString();
     }
-    
+
+    //HACK: do a "cheat" clone, see Record.java for more information
+    public Object clone() {
+        return cloneViaReserialise();
+    }
 }
\ No newline at end of file
index 271dd7758375680ece7822b8c538026f35d8b114..02f72acf18b871d50903a658f0f17628d93b11e6 100644 (file)
@@ -72,4 +72,10 @@ public final class UserSViewEnd extends StandardRecord {
         return sb.toString();
     }
 
+    //HACK: do a "cheat" clone, see Record.java for more information
+    public Object clone() {
+        return cloneViaReserialise();
+    }
+
+    
 }
\ No newline at end of file
index 288c7ea94432089ef941858eba952a22ddc7c5ef..dc884000b0aaf47cd5d9ab9916704ed5de5f9f12 100644 (file)
@@ -170,4 +170,13 @@ public final class TestFeatRecord extends TestCase {
                assertFalse(fferr2.getCheckUnprotectedFormulas());
                assertFalse(fferr2.getPerformDataValidation());
        }
+
+    /**
+     *  cloning sheets with feat records 
+     */
+    public void testCloneSheetWithFeatRecord() throws Exception {
+        HSSFWorkbook wb =
+            HSSFTestDataSamples.openSampleWorkbook("46136-WithWarnings.xls");
+        wb.cloneSheet(0);
+    }
 }