You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2010/05/27 18:27:09 UTC

svn commit: r948880 - in /poi/trunk/src: documentation/content/xdocs/status.xml java/org/apache/poi/hssf/usermodel/HSSFSheet.java testcases/org/apache/poi/hssf/usermodel/TestHSSFPatriarch.java

Author: nick
Date: Thu May 27 16:27:09 2010
New Revision: 948880

URL: http://svn.apache.org/viewvc?rev=948880&view=rev
Log:
Fix bug #44916 - Allow access to the HSSFPatriarch from HSSFSheet once created

Modified:
    poi/trunk/src/documentation/content/xdocs/status.xml
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPatriarch.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=948880&r1=948879&r2=948880&view=diff
==============================================================================
--- poi/trunk/src/documentation/content/xdocs/status.xml (original)
+++ poi/trunk/src/documentation/content/xdocs/status.xml Thu May 27 16:27:09 2010
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.7-SNAPSHOT" date="2010-??-??">
+           <action dev="POI-DEVELOPERS" type="fix">44916 - Allow access to the HSSFPatriarch from HSSFSheet once created</action>
            <action dev="POI-DEVELOPERS" type="add">48779 - Allow you to get straight from a CellStyle to a Color, irrespective of if the Color is indexed or inline-defined</action>
            <action dev="POI-DEVELOPERS" type="add">48924 - Allow access of the HWPF DateAndTime underlying date values</action>
            <action dev="POI-DEVELOPERS" type="add">48926 - Initial support for the HWPF revision marks authors list</action>

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java?rev=948880&r1=948879&r2=948880&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java Thu May 27 16:27:09 2010
@@ -95,6 +95,7 @@ public final class HSSFSheet implements 
     private final TreeMap<Integer, HSSFRow> _rows;
     protected final InternalWorkbook _book;
     protected final HSSFWorkbook _workbook;
+    private HSSFPatriarch _patriarch;
     private int _firstrow;
     private int _lastrow;
 
@@ -1577,11 +1578,11 @@ public final class HSSFSheet implements 
 
         _sheet.aggregateDrawingRecords(_book.getDrawingManager(), true);
         EscherAggregate agg = (EscherAggregate) _sheet.findFirstRecordBySid(EscherAggregate.sid);
-        HSSFPatriarch patriarch = new HSSFPatriarch(this, agg);
+        _patriarch = new HSSFPatriarch(this, agg);
         agg.clear();     // Initially the behaviour will be to clear out any existing shapes in the sheet when
                          // creating a new patriarch.
-        agg.setPatriarch(patriarch);
-        return patriarch;
+        agg.setPatriarch(_patriarch);
+        return _patriarch;
     }
 
     /**
@@ -1627,11 +1628,13 @@ public final class HSSFSheet implements 
      *  start from scratch!
      */
     public HSSFPatriarch getDrawingPatriarch() {
+        if(_patriarch != null) return _patriarch;
+        
         EscherAggregate agg = getDrawingEscherAggregate();
         if(agg == null) return null;
 
-        HSSFPatriarch patriarch = new HSSFPatriarch(this, agg);
-        agg.setPatriarch(patriarch);
+        _patriarch = new HSSFPatriarch(this, agg);
+        agg.setPatriarch(_patriarch);
 
         // Have it process the records into high level objects
         //  as best it can do (this step may eat anything
@@ -1639,7 +1642,7 @@ public final class HSSFSheet implements 
         agg.convertRecordsToUserModel();
 
         // Return what we could cope with
-        return patriarch;
+        return _patriarch;
     }
 
     /**

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPatriarch.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPatriarch.java?rev=948880&r1=948879&r2=948880&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPatriarch.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPatriarch.java Thu May 27 16:27:09 2010
@@ -38,8 +38,7 @@ public final class TestHSSFPatriarch ext
 		// assert something more interesting
 	}
 
-	// TODO - fix bug 44916 (1-May-2008)
-	public void DISABLED_test44916() {
+	public void test44916() {
 
 		HSSFWorkbook wb = new HSSFWorkbook();
 		HSSFSheet sheet = wb.createSheet();



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