poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r995429 - in /poi/trunk/src/java/org/apache/poi/hssf/usermodel: HSSFPictureData.java HSSFWorkbook.java
Date Thu, 09 Sep 2010 13:57:05 GMT
Author: nick
Date: Thu Sep  9 13:57:05 2010
New Revision: 995429

URL: http://svn.apache.org/viewvc?rev=995429&view=rev
Log:
Tweak constructor to be more open, and fix some generics warnings

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java?rev=995429&r1=995428&r2=995429&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java Thu Sep  9 13:57:05
2010
@@ -50,7 +50,7 @@ public class HSSFPictureData implements 
      *
      * @param blip the underlying blip record containing the bitmap data.
      */
-    HSSFPictureData( EscherBlipRecord blip )
+    public HSSFPictureData( EscherBlipRecord blip )
     {
         this.blip = blip;
     }

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java?rev=995429&r1=995428&r2=995429&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java Thu Sep  9 13:57:05
2010
@@ -1581,29 +1581,21 @@ public final class HSSFWorkbook extends 
      * @param escherRecords the escher records.
      * @param pictures the list to populate with the pictures.
      */
-    private void searchForPictures(List escherRecords, List<HSSFPictureData> pictures)
+    private void searchForPictures(List<EscherRecord> escherRecords, List<HSSFPictureData>
pictures)
     {
-        Iterator recordIter = escherRecords.iterator();
-        while (recordIter.hasNext())
-        {
-            Object obj = recordIter.next();
-            if (obj instanceof EscherRecord)
-            {
-                EscherRecord escherRecord = (EscherRecord) obj;
-
-                if (escherRecord instanceof EscherBSERecord)
-                {
-                    EscherBlipRecord blip = ((EscherBSERecord) escherRecord).getBlipRecord();
-                    if (blip != null)
-                    {
-                        // TODO: Some kind of structure.
-                        pictures.add(new HSSFPictureData(blip));
-                    }
-                }
+        for(EscherRecord escherRecord : escherRecords) {
+           if (escherRecord instanceof EscherBSERecord)
+           {
+              EscherBlipRecord blip = ((EscherBSERecord) escherRecord).getBlipRecord();
+              if (blip != null)
+              {
+                  // TODO: Some kind of structure.
+                  pictures.add(new HSSFPictureData(blip));
+              }
+           }
 
-                // Recursive call.
-                searchForPictures(escherRecord.getChildRecords(), pictures);
-            }
+           // Recursive call.
+           searchForPictures(escherRecord.getChildRecords(), pictures);
         }
     }
 



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


Mime
View raw message