poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1742423 - in /poi/trunk/src/ooxml/java/org/apache/poi: poifs/crypt/dsig/KeyInfoKeySelector.java poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java xslf/util/PPTX2PNG.java
Date Thu, 05 May 2016 12:22:31 GMT
Author: centic
Date: Thu May  5 12:22:31 2016
New Revision: 1742423

URL: http://svn.apache.org/viewvc?rev=1742423&view=rev
Log:
Some general code-fixes found while trying out Java 9

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/KeyInfoKeySelector.java
    poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/KeyInfoKeySelector.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/KeyInfoKeySelector.java?rev=1742423&r1=1742422&r2=1742423&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/KeyInfoKeySelector.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/KeyInfoKeySelector.java Thu May
 5 12:22:31 2016
@@ -65,7 +65,7 @@ public class KeyInfoKeySelector extends
                 continue;
             }
             X509Data x509Data = (X509Data) keyInfoStructure;
-            List<Object> x509DataList = x509Data.getContent();
+            List<?> x509DataList = x509Data.getContent();
             for (Object x509DataObject : x509DataList) {
                 if (!(x509DataObject instanceof X509Certificate)) {
                     continue;

Modified: poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java?rev=1742423&r1=1742422&r2=1742423&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java
(original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/facets/KeyInfoSignatureFacet.java
Thu May  5 12:22:31 2016
@@ -32,6 +32,7 @@ import java.util.List;
 import java.util.Map;
 
 import javax.xml.crypto.MarshalException;
+import javax.xml.crypto.XMLStructure;
 import javax.xml.crypto.dom.DOMStructure;
 import javax.xml.crypto.dsig.dom.DOMSignContext;
 import javax.xml.crypto.dsig.keyinfo.KeyInfo;
@@ -77,7 +78,7 @@ public class KeyInfoSignatureFacet exten
         List<Object> x509DataObjects = new ArrayList<Object>();
         X509Certificate signingCertificate = signatureConfig.getSigningCertificateChain().get(0);
 
-        List<Object> keyInfoContent = new ArrayList<Object>();
+        List<XMLStructure> keyInfoContent = new ArrayList<XMLStructure>();
 
         if (signatureConfig.isIncludeKeyValue()) {
             KeyValue keyValue;

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java?rev=1742423&r1=1742422&r2=1742423&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java Thu May  5 12:22:31 2016
@@ -117,56 +117,57 @@ public class PPTX2PNG {
             System.out.println("Processing " + file);
         }
         SlideShow<?,?> ss = SlideShowFactory.create(file, null, true);
-        List<? extends Slide<?,?>> slides = ss.getSlides();
+        try {
+            List<? extends Slide<?, ?>> slides = ss.getSlides();
 
-        Set<Integer> slidenum = slideIndexes(slides.size(), slidenumStr);
-        
-        if (slidenum.isEmpty()) {
-            usage("slidenum must be either -1 (for all) or within range: [1.."+slides.size()+"]
for "+file);
-            ss.close();
-            return;
-        }
-        
-        Dimension pgsize = ss.getPageSize();
-        int width = (int) (pgsize.width * scale);
-        int height = (int) (pgsize.height * scale);
-
-        for(Integer slideNo : slidenum) {
-            Slide<?,?> slide = slides.get(slideNo);
-            String title = slide.getTitle();
-            if (!quiet) {
-                System.out.println("Rendering slide " + slideNo + (title == null ? "" : ":
" + title));
+            Set<Integer> slidenum = slideIndexes(slides.size(), slidenumStr);
+
+            if (slidenum.isEmpty()) {
+                usage("slidenum must be either -1 (for all) or within range: [1.." + slides.size()
+ "] for " + file);
+                return;
             }
 
-            BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
-            Graphics2D graphics = img.createGraphics();
-            DrawFactory.getInstance(graphics).fixFonts(graphics);
-        
-            // default rendering options
-            graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-            graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
-            graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
-            graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
-
-            graphics.scale(scale, scale);
-
-            // draw stuff
-            slide.draw(graphics);
-
-            // save the result
-            if (!"null".equals(format)) {
-                String outname = file.getName().replaceFirst(".pptx?", "");
-                outname = String.format(Locale.ROOT, "%1$s-%2$04d.%3$s", outname, slideNo,
format);
-                File outfile = new File(outdir, outname);
-                ImageIO.write(img, format, outfile);
+            Dimension pgsize = ss.getPageSize();
+            int width = (int) (pgsize.width * scale);
+            int height = (int) (pgsize.height * scale);
+
+            for (Integer slideNo : slidenum) {
+                Slide<?, ?> slide = slides.get(slideNo);
+                String title = slide.getTitle();
+                if (!quiet) {
+                    System.out.println("Rendering slide " + slideNo + (title == null ? ""
: ": " + title));
+                }
+
+                BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
+                Graphics2D graphics = img.createGraphics();
+                DrawFactory.getInstance(graphics).fixFonts(graphics);
+
+                // default rendering options
+                graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+                graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+                graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+                graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
+
+                graphics.scale(scale, scale);
+
+                // draw stuff
+                slide.draw(graphics);
+
+                // save the result
+                if (!"null".equals(format)) {
+                    String outname = file.getName().replaceFirst(".pptx?", "");
+                    outname = String.format(Locale.ROOT, "%1$s-%2$04d.%3$s", outname, slideNo,
format);
+                    File outfile = new File(outdir, outname);
+                    ImageIO.write(img, format, outfile);
+                }
             }
-        }                
-        
+        } finally {
+            ss.close();
+        }
+
         if (!quiet) {
             System.out.println("Done");
         }
-        
-        ss.close();
     }
     
     private static Set<Integer> slideIndexes(final int slideCount, String range) {



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


Mime
View raw message