]> source.dussan.org Git - poi.git/commitdiff
keep rat-check quiet, also started writing xslf docs
authorYegor Kozlov <yegor@apache.org>
Mon, 7 Nov 2011 13:22:04 +0000 (13:22 +0000)
committerYegor Kozlov <yegor@apache.org>
Mon, 7 Nov 2011 13:22:04 +0000 (13:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1198722 13f79535-47bb-0310-9956-ffa450edef68

13 files changed:
src/documentation/content/xdocs/slideshow/book.xml
src/documentation/content/xdocs/slideshow/index.xml
src/documentation/content/xdocs/slideshow/xslf-cookbook.xml [new file with mode: 0644]
src/examples/src/org/apache/poi/xslf/usermodel/PPTX2SVG.txt [new file with mode: 0644]
src/java/org/apache/poi/hpsf/TypedPropertyValue.java
src/java/org/apache/poi/hpsf/VersionedStream.java
src/java/org/apache/poi/ss/util/DataMarker.java [deleted file]
src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java
src/ooxml/testcases/org/apache/poi/xslf/geom/TestFormulaParser.java
src/ooxml/testcases/org/apache/poi/xslf/geom/TestPresetGeometries.java
src/scratchpad/src/org/apache/poi/hwpf/model/LFOData.java
src/scratchpad/src/org/apache/poi/hwpf/model/types/PICFAbstractType.java
src/scratchpad/testcases/org/apache/poi/hwpf/sprm/TableSprmUncompressorTest.java

index 8ccf5c1bc43102cf565f10f984831a61ade2a217..741b7bc6b9b43d815489fc8732a1470a484df701 100644 (file)
@@ -30,7 +30,8 @@
     <menu label="HSLF">
         <menu-item label="Overview" href="index.html"/>
         <menu-item label="Quick Guide" href="quick-guide.html"/>
-        <menu-item label="Shapes HowTo" href="how-to-shapes.html"/>
+        <menu-item label="HSLF Cookbok" href="how-to-shapes.html"/>
+        <menu-item label="XSLF Cookbok" href="xslf-cookbook.html"/>
         <menu-item label="PPT File Format" href="ppt-file-format.html"/>
        </menu>
        
index f364f33820f9ae37fcc58d91056677308faec82c..939ccb9961ddd19c6b196116f37d5289e7561efe 100644 (file)
@@ -63,8 +63,7 @@
             Please note that XSLF is still in early development and is a subject to incompatible changes in future. 
             </p>
             <p>
-              A quick guide is available in 
-                <link href="http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/">XSLF Examples</link> 
+              A quick guide is available in the <link href="./xslf-cookbook.html">XSLF Cookbook</link> 
             </p>
         </section>
     </body>
diff --git a/src/documentation/content/xdocs/slideshow/xslf-cookbook.xml b/src/documentation/content/xdocs/slideshow/xslf-cookbook.xml
new file mode 100644 (file)
index 0000000..7b81569
--- /dev/null
@@ -0,0 +1,278 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+   ====================================================================
+-->
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN" "../dtd/document-v11.dtd">
+
+<document>
+    <header>
+        <title>XSLF Cookbook</title>
+        <authors>
+            <person email="yegor@dinom.ru" name="Yegor Kozlov" id="CO"/>
+        </authors>
+    </header>
+    <body>
+        <section><title>XSLF Cookbook</title>
+            <note>
+            Please note that XSLF is still in early development and is a subject to incompatible changes in a future release. 
+            </note>
+             <section><title>Index of Features</title>
+                <ul>
+                    <li><link href="#NewPresentation">Create a new presentation</link></li>
+                    <li><link href="#ReadPresentation">Read an existing presentation</link></li>
+                    <li><link href="#SlideLayout">Create a slide with a predefined layout</link></li>
+                    <li><link href="#DeleteSlide">Delete slide</link></li>
+                    <li><link href="#MoveSlide">Re-order slides</link></li>
+                    <li><link href="#SlideSize">Change slide size</link></li>
+                    <li><link href="#GetShapes">Read shapes</link></li>
+                    <li><link href="#AddImage">Add image</link></li>
+                    <li><link href="#ReadImages">Read images contained in a presentation</link></li>
+                    <li><link href="#Text">Format text</link></li>
+                    <li><link href="#Hyperlinks">Hyperlinks</link></li>
+                    <li><link href="#PPTX2PNG">Convert .pptx slides into images</link></li>
+                </ul>
+            </section>
+            <section><title>Cookbok</title>
+                <anchor id="NewPresentation"/>
+                <section><title>New Presentation</title>
+                <p>
+                The following code creates a new .pptx slide show and adds a blank slide to it:
+                </p>
+                  <source>
+    //create a new empty slide show
+    XMLSlideShow ppt = new XMLSlideShow();
+
+    //add first slide
+    XSLFSlide blankSlide = ppt.createSlide();
+                 </source>
+                </section>
+                <anchor id="ReadPresentation"/>
+                <section><title>Read an existing presentation and append a slide to it</title>
+                  <source>
+    XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("slideshow.pptx"));
+
+    //append a new slide to the end
+    XSLFSlide blankSlide = ppt.createSlide();
+                 </source>
+                </section>
+
+                <anchor id="SlideLayout"/>
+                <section><title>Create a new slide from a predefined slide layout</title>
+                  <source>
+    XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("slideshow.pptx"));
+
+    // first see what slide layouts are available :
+    System.out.println("Available slide layouts:");
+    for(XSLFSlideMaster master : ppt.getSlideMasters()){
+        for(XSLFSlideLayout layout : master.getSlideLayouts()){
+            System.out.println(layout.getType());
+        }
+    }
+
+    // blank slide
+    XSLFSlide blankSlide = ppt.createSlide();
+
+    // there can be multiple masters each referencing a number of layouts
+    // for demonstration purposes we use the first (default) slide master
+    XSLFSlideMaster defaultMaster = ppt.getSlideMasters()[0];
+
+    // title slide
+    XSLFSlideLayout titleLayout = defaultMaster.getLayout(SlideLayout.TITLE);
+    // fill the placeholders
+    XSLFSlide slide1 = ppt.createSlide(titleLayout);
+    XSLFTextShape title1 = slide1.getPlaceholder(0);
+    title1.setText("First Title");
+
+    // title and content
+    XSLFSlideLayout titleBodyLayout = defaultMaster.getLayout(SlideLayout.TITLE_AND_CONTENT);
+    XSLFSlide slide2 = ppt.createSlide(titleBodyLayout);
+
+    XSLFTextShape title2 = slide2.getPlaceholder(0);
+    title2.setText("Second Title");
+
+    XSLFTextShape body2 = slide2.getPlaceholder(1);
+    body2.clearText(); // unset any existing text
+    body2.addNewTextParagraph().addNewTextRun().setText("First paragraph");
+    body2.addNewTextParagraph().addNewTextRun().setText("Second paragraph");
+    body2.addNewTextParagraph().addNewTextRun().setText("Third paragraph");
+                </source>
+                </section>
+
+                <anchor id="DeleteSlide"/>
+                <section><title>Delete slide</title>
+                  <source>
+    XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("slideshow.pptx"));
+
+    ppt.removeSlide(0); // 0-based index of a slide to be removed
+                </source>
+                </section>
+
+                <anchor id="MoveSlide"/>
+                <section><title>Re-order slides</title>
+                  <source>
+    XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("slideshow.pptx"));
+    XSLFSlide[] slides = ppt.getSlides();
+
+    XSLFSlide thirdSlide = slides[2];
+    ppt.setSlideOrder(thirdSlide, 0); // move the third slide to the beginning
+                </source>
+                </section>
+
+                <anchor id="SlideSize"/>
+                <section><title>How to retrieve or change slide size</title>
+                    <source>
+    XMLSlideShow ppt = new XMLSlideShow();
+    //retrieve page size. Coordinates are expressed in points (72 dpi)
+    java.awt.Dimension pgsize = ppt.getPageSize();
+    int pgx = pgsize.width; //slide width in points
+    int pgy = pgsize.height; //slide height in points
+
+    //set new page size
+    ppt.setPageSize(new java.awt.Dimension(1024, 768));
+                  </source>
+                </section>
+                <anchor id="GetShapes"/>
+                <section><title>How to read shapes contained in a particular slide</title>
+                  <p>
+                    The following code demonstrates how to iterate over shapes for each slide.
+                  </p>
+                    <source>
+  XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("slideshow.pptx"));
+  //get slides 
+  XSLFSlide[] slide = ppt.getSlides();
+  for (int i = 0; i &lt; slide.length; i++){
+    XSLFShape[] sh = slide[i].getShapes();
+    for (int j = 0; j &lt; sh.length; j++){
+      //name of the shape
+      String name = sh[j].getShapeName();
+
+      //shapes's anchor which defines the position of this shape in the slide
+      java.awt.geom.Rectangle2D anchor = sh[j].getAnchor();
+
+      if (sh[j] instanceof XSLFConnectorShape){
+        XSLFConnectorShape line = (XSLFConnectorShape)sh[j];
+        //work with Line
+      } else if (sh[j] instanceof XSLFTextShape){
+        XSLFTextShape shape = (XSLFTextShape)sh[j];
+        //work with a shape that can hold text
+      } else if (sh[j] instanceof XSLFPictureShape){
+        XSLFPictureShape shape = (XSLFPictureShape)sh[j];
+        //work with Picture
+      }
+    }
+  }
+                  </source>
+                </section>
+                <anchor id="AddImage"/>
+                <section><title>Add Image to Slide</title>
+                    <source>
+        XMLSlideShow ppt = new XMLSlideShow();
+        XSLFSlide slide = ppt.createSlide();
+        
+        byte[] pictureData = IOUtils.toByteArray(new FileInputStream("image.png"));
+
+        int idx = ppt.addPicture(pictureData, XSLFPictureData.PICTURE_TYPE_PNG);
+        XSLFPictureShape pic = slide.createPicture(idx);
+                    </source>
+                </section>
+
+                <anchor id="ReadImages"/>
+                <section><title>Read Images contained within a presentation</title>
+                    <source>
+        XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("slideshow.pptx"));
+        for(XSLFPictureData data : ppt.getAllPictures()){
+            byte[] bytes = data.getData();
+            String fileName = data.getFileName();
+            
+        }
+                    </source>
+                </section>
+
+         <anchor id="Text"/>
+                <section><title>Basic text formatting</title>
+                    <source>
+    XMLSlideShow ppt = new XMLSlideShow();
+    XSLFSlide slide = ppt.createSlide();
+
+    XSLFTextBox shape = slide.createTextBox();
+    XSLFTextParagraph p = shape.addNewTextParagraph();
+
+    XSLFTextRun r1 = p.addNewTextRun();
+    r1.setText("The");
+    r1.setFontColor(Color.blue);
+    r1.setFontSize(24);
+
+    XSLFTextRun r2 = p.addNewTextRun();
+    r2.setText(" quick");
+    r2.setFontColor(Color.red);
+    r2.setBold(true);
+
+    XSLFTextRun r3 = p.addNewTextRun();
+    r3.setText(" brown");
+    r3.setFontSize(12);
+    r3.setItalic(true);
+    r3.setStrikethrough(true);
+    
+    XSLFTextRun r4 = p.addNewTextRun();
+    r4.setText(" fox");
+    r4.setUnderline(true);
+            </source>
+                </section>
+                <anchor id="Hyperlinks"/>
+                <section><title>How to read hyperlinks from a slide show</title>
+                    <source>
+    XMLSlideShow ppt = new XMLSlideShow();
+    XSLFSlide slide = ppt.createSlide();
+
+    // assign a hyperlink to a text run
+    XSLFTextBox shape = slide.createTextBox();
+    XSLFTextRun r = shape.addNewTextParagraph().addNewTextRun();
+    r.setText("Apache POI");
+    XSLFHyperlink link = r.createHyperlink();
+    link.setAddress("http://poi.apache.org");
+                </source>
+                </section>
+                <anchor id="PPTX2PNG"/>
+                <section><title>PPTX2PNG is an application that converts each slide of a .pptx slideshow into a PNG image</title>
+                <source>
+Usage: PPTX2PNG [options] &lt;pptx file&gt;
+Options:
+    -scale &lt;float&gt;   scale factor (default is 1.0)
+    -slide &lt;integer&gt; 1-based index of a slide to render. Default is to render all slides.
+                </source>
+                <p>How it works:</p>
+                <p>
+                    The XSLFSlide object implements a draw(Graphics2D graphics) method that recursively paints all shapes
+                    in the slide into the supplied graphics canvas:
+                </p>
+                <source>
+            slide.draw(graphics);
+                </source>
+                <p>
+                where graphics is a class implementing java.awt.Graphics2D. In PPTX2PNG the graphic canvas is derived from
+                java.awt.image.BufferedImage, i.e. the destination is an image in memory, but in general case you can pass
+                any compliant implementation of  java.awt.Graphics2D. The 
+                <link href="http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PPTX2SVG.txt">PPTX2SVG</link>
+                example demonstrates how to use Apache Batik to convert .pptx slides into SVG format. 
+                </p>
+                </section>
+                  
+            </section>
+        </section>
+    </body>
+</document>
diff --git a/src/examples/src/org/apache/poi/xslf/usermodel/PPTX2SVG.txt b/src/examples/src/org/apache/poi/xslf/usermodel/PPTX2SVG.txt
new file mode 100644 (file)
index 0000000..dbe089a
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ *  ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one or more
+ *    contributor license agreements.  See the NOTICE file distributed with
+ *    this work for additional information regarding copyright ownership.
+ *    The ASF licenses this file to You under the Apache License, Version 2.0
+ *    (the "License"); you may not use this file except in compliance with
+ *    the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ * ====================================================================
+ */
+
+package org.apache.poi.xslf.usermodel;
+
+import org.apache.batik.dom.svg.SVGDOMImplementation;
+import org.apache.batik.svggen.SVGGraphics2D;
+import org.apache.batik.transcoder.wmf.tosvg.WMFPainter;
+import org.apache.batik.transcoder.wmf.tosvg.WMFRecordStore;
+import org.apache.poi.openxml4j.opc.OPCPackage;
+import org.apache.poi.openxml4j.opc.PackagePart;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+
+import javax.imageio.ImageIO;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.io.DataInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+
+/**
+ * Convert each slide of a .pptx presentation into SVG
+ *
+ * @author Yegor Kozlov
+ */
+public class PPTX2SVG {
+
+    static void usage() {
+        System.out.println("Usage: PPTX2SVG  <pptx file>");
+    }
+
+    public static void main(String[] args) throws Exception {
+        if (args.length == 0) {
+            usage();
+            return;
+        }
+
+        String file = args[0];
+
+        System.out.println("Processing " + file);
+
+        // read the .pptx file
+        XMLSlideShow ppt = new XMLSlideShow(OPCPackage.open(file));
+
+        Dimension pgsize = ppt.getPageSize();
+
+        // convert each slide into a .svg file
+        XSLFSlide[] slide = ppt.getSlides();
+        for (int i = 0; i < slide.length; i++) {
+            // Create initial SVG DOM
+            DOMImplementation domImpl = SVGDOMImplementation.getDOMImplementation();
+            Document doc = domImpl.createDocument("http://www.w3.org/2000/svg", "svg", null);
+            //Use Batik SVG Graphics2D driver
+            SVGGraphics2D graphics = new SVGGraphics2D(doc);
+            graphics.setRenderingHint(XSLFRenderingHint.IMAGE_RENDERER, new WMFImageRender());
+            graphics.setSVGCanvasSize(pgsize);
+
+            String title = slide[i].getTitle();
+            System.out.println("Rendering slide " + (i + 1) + (title == null ? "" : ": " + title));
+
+            // draw stuff. All the heavy-lifting happens here
+            slide[i].draw(graphics);
+
+            // save the result.
+            int sep = file.lastIndexOf(".");
+            String fname = file.substring(0, sep == -1 ? file.length() : sep) + "-" + (i + 1) + ".svg";
+            OutputStreamWriter out =
+                    new OutputStreamWriter(new FileOutputStream(fname), "UTF-8");
+            DOMSource domSource = new DOMSource(graphics.getRoot());
+            StreamResult streamResult = new StreamResult(out);
+            TransformerFactory tf = TransformerFactory.newInstance();
+            Transformer serializer = tf.newTransformer();
+            serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+            serializer.setOutputProperty(OutputKeys.INDENT, "yes");
+            serializer.transform(domSource, streamResult);
+            out.flush();
+            out.close();
+        }
+        System.out.println("Done");
+    }
+
+    /**
+     * Image renderer with support for .wmf images
+     */
+    static class WMFImageRender extends XSLFImageRendener {
+
+        /**
+         * Use Apache Batik to render WMF,
+         * delegate all other types of images to the javax.imageio framework
+       */
+        @Override
+        public boolean drawImage(Graphics2D graphics, XSLFPictureData data,
+                                 Rectangle2D anchor) {
+            try {
+                // see what type of image we are
+                PackagePart part = data.getPackagePart();
+                String contentType = part.getContentType();
+                if (contentType.equals("image/x-wmf")) {
+                    WMFRecordStore currentStore = new WMFRecordStore();
+                    currentStore.read(new DataInputStream(part.getInputStream()));
+                    int wmfwidth = currentStore.getWidthPixels();
+                    float conv = (float) anchor.getWidth() / wmfwidth;
+
+                    // Build a painter for the RecordStore
+                    WMFPainter painter = new WMFPainter(currentStore,
+                            (int) anchor.getX(), (int) anchor.getY(), conv);
+                    painter.paint(graphics);
+                } else {
+                    BufferedImage img = ImageIO.read(data.getPackagePart().getInputStream());
+                    graphics.drawImage(img,
+                            (int) anchor.getX(), (int) anchor.getY(),
+                            (int) anchor.getWidth(), (int) anchor.getHeight(), null);
+                }
+            } catch (Exception e) {
+                return false;
+            }
+            return true;
+        }
+
+        /**
+         * Convert data form the supplied package part into a BufferedImage.
+         * This method is used to create texture paint.
+         */
+        @Override
+        public BufferedImage readImage(PackagePart packagePart) throws IOException {
+            String contentType = packagePart.getContentType();
+            if (contentType.equals("image/x-wmf")) {
+                try {
+                    WMFRecordStore currentStore = new WMFRecordStore();
+                    currentStore.read(new DataInputStream(packagePart.getInputStream()));
+                    int wmfwidth = currentStore.getWidthPixels();
+                    int wmfheight = currentStore.getHeightPixels();
+
+                    BufferedImage img = new BufferedImage(wmfwidth, wmfheight, BufferedImage.TYPE_INT_RGB);
+                    Graphics2D graphics = img.createGraphics();
+
+                    // Build a painter for the RecordStore
+                    WMFPainter painter = new WMFPainter(currentStore, 0, 0, 1.0f);
+                    painter.paint(graphics);
+
+                    return img;
+                } catch (IOException e) {
+                    return null;
+                }
+            } else {
+                return ImageIO.read(packagePart.getInputStream());
+            }
+        }
+
+    }
+}
index 455aef6bd4ac7fb0d92214f7122aaf5a8770d52f..982139ba8af18e7c431991de0c0581d94fc7c848 100644 (file)
@@ -1,3 +1,21 @@
+/*
+ *  ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one or more
+ *    contributor license agreements.  See the NOTICE file distributed with
+ *    this work for additional information regarding copyright ownership.
+ *    The ASF licenses this file to You under the Apache License, Version 2.0
+ *    (the "License"); you may not use this file except in compliance with
+ *    the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ * ====================================================================
+ */
 package org.apache.poi.hpsf;
 
 import org.apache.poi.util.Internal;
index 89a269ea7a819952c32710c1ea002c6013af6d77..c3c066e4fabbd361f047b29627faf9d0e551cf00 100644 (file)
@@ -1,3 +1,21 @@
+/*
+ *  ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one or more
+ *    contributor license agreements.  See the NOTICE file distributed with
+ *    this work for additional information regarding copyright ownership.
+ *    The ASF licenses this file to You under the Apache License, Version 2.0
+ *    (the "License"); you may not use this file except in compliance with
+ *    the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ * ====================================================================
+ */
 package org.apache.poi.hpsf;
 
 import org.apache.poi.util.Internal;
diff --git a/src/java/org/apache/poi/ss/util/DataMarker.java b/src/java/org/apache/poi/ss/util/DataMarker.java
deleted file mode 100644 (file)
index e69de29..0000000
index 7134246bbb1647267d0a6f5626a70fd2d0f6c44c..669fa366193cb3abc1111bc8c7af17acdbc8b5d9 100644 (file)
@@ -510,6 +510,22 @@ public class XSLFTextParagraph implements Iterable<XSLFTextRun>{
         return fetcher.getValue() == null ? false : fetcher.getValue();\r
     }\r
 \r
+    /**\r
+     *\r
+     * @param isBullet whether text in this paragraph has bullets\r
+     */\r
+    public void setBullet(boolean flag) {\r
+        if(isBullet() == flag) return;\r
+\r
+        CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr();\r
+        if(!flag) {\r
+            pr.addNewBuNone();\r
+        } else {\r
+            pr.addNewBuFont().setTypeface("Arial");\r
+            pr.addNewBuChar().setChar("\u2022");\r
+        }\r
+    }\r
+\r
     @Override\r
     public String toString(){\r
         return "[" + getClass() + "]" + getText();\r
index df3e2ec29d9764319086fc558cb069a0fc8c742d..1168003c947b51cea0f2037eb1d76ade6010ab1b 100644 (file)
@@ -1,3 +1,21 @@
+/*
+ *  ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one or more
+ *    contributor license agreements.  See the NOTICE file distributed with
+ *    this work for additional information regarding copyright ownership.
+ *    The ASF licenses this file to You under the Apache License, Version 2.0
+ *    (the "License"); you may not use this file except in compliance with
+ *    the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ * ====================================================================
+ */
 package org.apache.poi.xslf.geom;
 
 import junit.framework.TestCase;
index c71a065bb7aa3f5911f33d97aa16ee0571213bd3..eefdd91b4182779a97972af1b923bd8fc4c8132e 100644 (file)
@@ -1,3 +1,21 @@
+/*
+ *  ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one or more
+ *    contributor license agreements.  See the NOTICE file distributed with
+ *    this work for additional information regarding copyright ownership.
+ *    The ASF licenses this file to You under the Apache License, Version 2.0
+ *    (the "License"); you may not use this file except in compliance with
+ *    the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ * ====================================================================
+ */
 package org.apache.poi.xslf.geom;
 
 import junit.framework.TestCase;
index 3c6cdb0b1931437fcf9b519573ee52e5f0f64152..9910dcaef8b3d17e53f1bd0bb5e92d3ec6c7d83e 100644 (file)
@@ -1,3 +1,21 @@
+/*
+ *  ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one or more
+ *    contributor license agreements.  See the NOTICE file distributed with
+ *    this work for additional information regarding copyright ownership.
+ *    The ASF licenses this file to You under the Apache License, Version 2.0
+ *    (the "License"); you may not use this file except in compliance with
+ *    the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ * ====================================================================
+ */
 package org.apache.poi.hwpf.model;
 
 import java.io.IOException;
index ed0174318290ddf8f1ab5622d0bd3401a4e979b9..2df2e0474eea9db2333cb494c397a76e84e9d409 100644 (file)
@@ -1,4 +1,21 @@
-
+/*
+ *  ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one or more
+ *    contributor license agreements.  See the NOTICE file distributed with
+ *    this work for additional information regarding copyright ownership.
+ *    The ASF licenses this file to You under the Apache License, Version 2.0
+ *    (the "License"); you may not use this file except in compliance with
+ *    the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ * ====================================================================
+ */
 package org.apache.poi.hwpf.model.types;
 
 
index ebd3a9583add0ee543d565459f015f32c9003f3f..77c6e86c811ff64b65369b220758fd61ca23e2b8 100644 (file)
@@ -1,3 +1,21 @@
+/*
+ *  ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one or more
+ *    contributor license agreements.  See the NOTICE file distributed with
+ *    this work for additional information regarding copyright ownership.
+ *    The ASF licenses this file to You under the Apache License, Version 2.0
+ *    (the "License"); you may not use this file except in compliance with
+ *    the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ * ====================================================================
+ */
 package org.apache.poi.hwpf.sprm;
 
 import org.apache.poi.hwpf.usermodel.TableProperties;