]> source.dussan.org Git - poi.git/commitdiff
fixed misc bugs in the hslf how-to doc
authorYegor Kozlov <yegor@apache.org>
Wed, 18 Apr 2007 14:21:40 +0000 (14:21 +0000)
committerYegor Kozlov <yegor@apache.org>
Wed, 18 Apr 2007 14:21:40 +0000 (14:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@530029 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/hslf/how-to-shapes.xml

index 2376938d9c58c8a75d513dd2cc89694f73e90bb5..243935b5368d1bc9ab7600d449f259f23ba6c815 100644 (file)
@@ -54,7 +54,7 @@
     
     //save changes in a file
     FileOutputStream out = new FileOutputStream("slideshow.ppt");
-    wb.write(out);
+    ppt.write(out);
     out.close();
                  </source>
                 </section>
@@ -71,7 +71,7 @@
     ppt.setPageSize(new java.awt.Dimension(1024, 768));
     //save changes 
     FileOutputStream out = new FileOutputStream("slideshow.ppt");
-    wb.write(out);
+    ppt.write(out);
     out.close();
                   </source>
                 </section>
                      of the upper left corner of the bounding box for the shape relative to the upper left
                      corner of the slide. Distances in the drawing layer are measured in points (72 points = 1 inch).
                    </p>
-                    <source>
-        SlideShow ppt = new SlideShow();
+                   <source>
+  SlideShow ppt = new SlideShow();
 
   Slide slide = ppt.createSlide();
 
   Line line = new Line();
   line.setAnchor(new java.awt.Rectangle(50, 50, 100, 20));
   line.setLineColor(new Color(0, 128, 0));
-  line.setLineStyle(Line.LineDashDotSys);
+  line.setLineStyle(Line.LINE_DOUBLE);
   slide.addShape(line);
 
   //TextBox
   txt.setAnchor(new java.awt.Rectangle(300, 100, 300, 50));
 
   //use RichTextRun to work with the text format
-  RichTextRun rt = txt.getRichTextRuns()[0];
+  RichTextRun rt = txt.getTextRun().getRichTextRuns()[0];
   rt.setFontSize(32);
   rt.setFontName("Arial");
   rt.setBold(true);
   slide.addShape(sh2);
 
   FileOutputStream out = new FileOutputStream("slideshow.ppt");
-        ppt.write(out);
+  ppt.write(out);
   out.close();
+                    
                   </source>
                 </section>
                 <anchor id="Pictures"/>
   for (int i = 0; i &lt; sh.length; i++){
     if (sh[i] instanceof Picture){
       Picture pict = (Picture)sh[i];
-      PictureData data = pict.getPictureData();
-      byte[] data = pict.getData();
-      int type = pict.getType();
+      PictureData pictData = pict.getPictureData();
+      byte[] data = pictData.getData();
+      int type = pictData.getType();
       if (type == Picture.JPEG){
         FileOutputStream out = new FileOutputStream("slide0_"+i+".jpg");
         out.write(data);
   }
 
   FileOutputStream out = new FileOutputStream("slideshow.ppt");
-  wb.write(out);
+  ppt.write(out);
   out.close();
 
                     </source>
     
     //save changes 
     FileOutputStream out = new FileOutputStream("slideshow.ppt");
-    wb.write(out);
+    ppt.write(out);
     out.close();
                   </source>
                   <p>