]> source.dussan.org Git - poi.git/commitdiff
fixed a silly typo in the method signature. It should be HFFSPicture.getPreferredSize...
authorYegor Kozlov <yegor@apache.org>
Sat, 3 Nov 2007 19:50:40 +0000 (19:50 +0000)
committerYegor Kozlov <yegor@apache.org>
Sat, 3 Nov 2007 19:50:40 +0000 (19:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@591667 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/hssf/quick-guide.xml
src/java/org/apache/poi/hssf/usermodel/HSSFPicture.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFPicture.java

index ebc6753b008f29842223dbe0652f62b4132990de..e40dc0dcb3b2d977d092483a58b9bdccf79a381a 100644 (file)
     HSSFPatriarch patriarch = sheet5.createDrawingPatriarch();
 
     HSSFPicture picture = patriarch.createPicture(new HSSFClientAnchor(), loadPicture( "src/resources/logos/logoKarmokar4.png", wb ));
-    HSSFClientAnchor prefferedSize = picture.getPrefferedSize();
-    picture.setAnchor(prefferedSize);
+    HSSFClientAnchor preferredSize = picture.getPreferredSize();
+    picture.setAnchor(preferredSize);
       </source>
         <warning>
           HSSFPicture.resize() works only for JPEG and PNG. Other formats are not yet supported.
index 79649b06a8aff295656810c12dd9d88ae3483b30..9aa0e966d1e5d58120d18efd00b9d5d988e8aee8 100644 (file)
@@ -79,7 +79,7 @@ public class HSSFPicture
         HSSFClientAnchor anchor = (HSSFClientAnchor)getAnchor();
         anchor.setAnchorType(2);
 
-        HSSFClientAnchor pref = getPrefferedSize();
+        HSSFClientAnchor pref = getPreferredSize();
 
         int row2 = anchor.getRow1() + (pref.getRow2() - pref.getRow1());
         int col2 = anchor.getCol1() + (pref.getCol2() - pref.getCol1());
@@ -94,19 +94,19 @@ public class HSSFPicture
     }
 
     /**
-     * Calculate the preffered size for this picture.
+     * Calculate the preferred size for this picture.
      *
-     * @return HSSFClientAnchor with the preffered size for this image
+     * @return HSSFClientAnchor with the preferred size for this image
      * @since POI 3.0.2
      */
-    public HSSFClientAnchor getPrefferedSize(){
+    public HSSFClientAnchor getPreferredSize(){
         HSSFClientAnchor anchor = new HSSFClientAnchor();
 
         EscherBSERecord bse = (EscherBSERecord)patriarch.sheet.book.getBSERecord(pictureIndex);
         byte[] data = bse.getBlipRecord().getPicturedata();
         int type = bse.getBlipTypeWin32();
         switch (type){
-            //we can calculate the preffered size only for JPEG and PNG
+            //we can calculate the preferred size only for JPEG and PNG
             //other formats like WMF, EMF and PICT are not supported in Java
             case HSSFWorkbook.PICTURE_TYPE_JPEG:
             case HSSFWorkbook.PICTURE_TYPE_PNG:
index 45f92647b9fd02eccf5b58c746225ad27a1217e0..25d6684c4714c8f36c96e56a2df35185348f1420 100644 (file)
@@ -36,7 +36,7 @@ public class TestHSSFPicture extends TestCase{
 \r
         int idx1 = loadPicture( "src/resources/logos/logoKarmokar4.png", wb);\r
         HSSFPicture picture1 = p1.createPicture(new HSSFClientAnchor(), idx1);\r
-        HSSFClientAnchor anchor1 = picture1.getPrefferedSize();\r
+        HSSFClientAnchor anchor1 = picture1.getPreferredSize();\r
 \r
         //assert against what would BiffViewer print if we insert the image in xls and dump the file\r
         assertEquals(0, anchor1.getCol1());\r