poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r950611 - in /poi/trunk: src/documentation/content/xdocs/ src/java/org/apache/poi/hssf/record/chart/ src/testcases/org/apache/poi/hssf/usermodel/ test-data/spreadsheet/
Date Wed, 02 Jun 2010 16:01:26 GMT
Author: nick
Date: Wed Jun  2 16:01:26 2010
New Revision: 950611

URL: http://svn.apache.org/viewvc?rev=950611&view=rev
Log:
Fix bug #49096 - add clone support to Chart begin and end records, to allow cloning of more
Chart containing sheets

Added:
    poi/trunk/test-data/spreadsheet/49096.xls   (with props)
Modified:
    poi/trunk/src/documentation/content/xdocs/status.xml
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/BeginRecord.java
    poi/trunk/src/java/org/apache/poi/hssf/record/chart/EndRecord.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

Modified: poi/trunk/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/trunk/src/documentation/content/xdocs/status.xml?rev=950611&r1=950610&r2=950611&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Wed Jun  2 16:01:26 2010
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.7-SNAPSHOT" date="2010-??-??">
+           <action dev="POI-DEVELOPERS" type="fix">49096 - add clone support to Chart
begin and end records, to allow cloning of more Chart containing sheets</action>
            <action dev="POI-DEVELOPERS" type="add">List attachment names in the output
of OutlookTextExtractor (to get attachment contents, use ExtractorFactory as normal)</action>
            <action dev="POI-DEVELOPERS" type="fix">48872 - allow DateFormatter.formatRawCellContents
to handle 1904 as well as 1900 dates</action>
            <action dev="POI-DEVELOPERS" type="fix">48872 - handle MMMMM and elapsed
time formatting rules in DataFormatter</action>

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/chart/BeginRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/chart/BeginRecord.java?rev=950611&r1=950610&r2=950611&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/chart/BeginRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/chart/BeginRecord.java Wed Jun  2 16:01:26
2010
@@ -63,4 +63,10 @@ public final class BeginRecord extends S
     {
         return sid;
     }
+    
+    public Object clone() {
+       BeginRecord br = new BeginRecord();
+       // No data so nothing to copy
+       return br;
+    }
 }

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/chart/EndRecord.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/chart/EndRecord.java?rev=950611&r1=950610&r2=950611&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/chart/EndRecord.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/chart/EndRecord.java Wed Jun  2 16:01:26
2010
@@ -64,4 +64,10 @@ public final class EndRecord extends Sta
     {
         return sid;
     }
+    
+    public Object clone() {
+       EndRecord er = new EndRecord();
+       // No data so nothing to copy
+       return er;
+    }
 }

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java?rev=950611&r1=950610&r2=950611&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java Wed Jun  2 16:01:26
2010
@@ -1572,4 +1572,20 @@ public final class TestBugs extends Base
        assertEquals("RT", withoutExt.getString());
        assertTrue((withoutExt.getOptionFlags() & 0x0004) == 0x0000);
     }
+    
+    /**
+     * Problem with cloning a sheet with a chart
+     *  contained in it.
+     */
+    public void test49096() throws Exception {
+       HSSFWorkbook wb = openSample("49096.xls");
+       assertEquals(1, wb.getNumberOfSheets());
+       
+       assertNotNull(wb.getSheetAt(0));
+       wb.cloneSheet(0);
+       assertEquals(2, wb.getNumberOfSheets());
+       
+       wb = writeOutAndReadBack(wb);
+       assertEquals(2, wb.getNumberOfSheets());
+    }
 }

Added: poi/trunk/test-data/spreadsheet/49096.xls
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/49096.xls?rev=950611&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/spreadsheet/49096.xls
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message