]> source.dussan.org Git - poi.git/commitdiff
Tweak constructor to be more open, and fix some generics warnings
authorNick Burch <nick@apache.org>
Thu, 9 Sep 2010 13:57:05 +0000 (13:57 +0000)
committerNick Burch <nick@apache.org>
Thu, 9 Sep 2010 13:57:05 +0000 (13:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@995429 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/hssf/usermodel/HSSFPictureData.java
src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java

index 158d98c36d8b925de7635e4d8838d2b589ec639a..d8467b8c323bbde519bb6617c849ee79689480a4 100644 (file)
@@ -50,7 +50,7 @@ public class HSSFPictureData implements PictureData
      *
      * @param blip the underlying blip record containing the bitmap data.
      */
-    HSSFPictureData( EscherBlipRecord blip )
+    public HSSFPictureData( EscherBlipRecord blip )
     {
         this.blip = blip;
     }
index 54c9d36e04488f8c4e485dfa9c56a9260e3628ae..812ffd0ac4f25783cb5264b7098a8011fce39ed3 100644 (file)
@@ -1581,29 +1581,21 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
      * @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));
-                    }
-                }
-
-                // Recursive call.
-                searchForPictures(escherRecord.getChildRecords(), pictures);
-            }
+        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);
         }
     }