Browse Source

Fix bug #49096 - add clone support to Chart begin and end records, to allow cloning of more Chart containing sheets

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@950611 13f79535-47bb-0310-9956-ffa450edef68
tags/REL_3_7_BETA1
Nick Burch 14 years ago
parent
commit
8c85c8c3cf

+ 1
- 0
src/documentation/content/xdocs/status.xml View File

@@ -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>

+ 6
- 0
src/java/org/apache/poi/hssf/record/chart/BeginRecord.java View File

@@ -63,4 +63,10 @@ public final class BeginRecord extends StandardRecord {
{
return sid;
}
public Object clone() {
BeginRecord br = new BeginRecord();
// No data so nothing to copy
return br;
}
}

+ 6
- 0
src/java/org/apache/poi/hssf/record/chart/EndRecord.java View File

@@ -64,4 +64,10 @@ public final class EndRecord extends StandardRecord {
{
return sid;
}
public Object clone() {
EndRecord er = new EndRecord();
// No data so nothing to copy
return er;
}
}

+ 16
- 0
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java View File

@@ -1572,4 +1572,20 @@ public final class TestBugs extends BaseTestBugzillaIssues {
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());
}
}

BIN
test-data/spreadsheet/49096.xls View File


Loading…
Cancel
Save