poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1849040 [1/4] - in /poi: site/src/documentation/content/xdocs/ trunk/ trunk/sonar/ trunk/sonar/examples/ trunk/sonar/excelant/ trunk/sonar/main/ trunk/sonar/ooxml-schema-encryption/ trunk/sonar/ooxml-schema-security/ trunk/sonar/ooxml-sche...
Date Sun, 16 Dec 2018 18:17:22 GMT
Author: kiwiwings
Date: Sun Dec 16 18:17:21 2018
New Revision: 1849040

URL: http://svn.apache.org/viewvc?rev=1849040&view=rev
Log:
#60656 -  EMF image support in slideshows

Added:
    poi/trunk/src/java/org/apache/poi/util/Dimension2DDouble.java
      - copied, changed from r1849038, poi/branches/hemf/src/java/org/apache/poi/util/Dimension2DDouble.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/draw/
      - copied from r1849038, poi/branches/hemf/src/scratchpad/src/org/apache/poi/hemf/draw/
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/emf/
      - copied from r1849038, poi/branches/hemf/src/scratchpad/src/org/apache/poi/hemf/record/emf/
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/emfplus/
      - copied from r1849038, poi/branches/hemf/src/scratchpad/src/org/apache/poi/hemf/record/emfplus/
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/usermodel/
      - copied from r1849038, poi/branches/hemf/src/scratchpad/src/org/apache/poi/hemf/usermodel/
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfImageRenderer.java
      - copied unchanged from r1849038, poi/branches/hemf/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfImageRenderer.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfRegionMode.java
      - copied unchanged from r1849038, poi/branches/hemf/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfRegionMode.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hemf/usermodel/
      - copied from r1849038, poi/branches/hemf/src/scratchpad/testcases/org/apache/poi/hemf/usermodel/
Removed:
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/extractor/
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/hemfplus/
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/AbstractHemfComment.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/HemfComment.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/HemfCommentEMFPlus.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/HemfCommentEMFSpool.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/HemfCommentPublic.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/HemfCommentRecord.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/HemfHeader.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/HemfRecord.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/HemfRecordType.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/HemfText.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hemf/record/UnimplementedHemfRecord.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfSLImageRenderer.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hemf/extractor/
Modified:
    poi/site/src/documentation/content/xdocs/changes.xml
    poi/trunk/   (props changed)
    poi/trunk/build.gradle
    poi/trunk/build.xml
    poi/trunk/sonar/examples/pom.xml
    poi/trunk/sonar/excelant/pom.xml
    poi/trunk/sonar/main/pom.xml
    poi/trunk/sonar/ooxml-schema-encryption/pom.xml
    poi/trunk/sonar/ooxml-schema-security/pom.xml
    poi/trunk/sonar/ooxml-schema/pom.xml
    poi/trunk/sonar/ooxml/pom.xml
    poi/trunk/sonar/pom.xml
    poi/trunk/sonar/scratchpad/pom.xml
    poi/trunk/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java
    poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java
    poi/trunk/src/java/org/apache/poi/hssf/record/RecordInputStream.java
    poi/trunk/src/java/org/apache/poi/sl/draw/BitmapImageRenderer.java
    poi/trunk/src/java/org/apache/poi/sl/draw/DrawFactory.java
    poi/trunk/src/java/org/apache/poi/sl/draw/DrawFontManagerDefault.java
    poi/trunk/src/java/org/apache/poi/sl/draw/DrawPictureShape.java
    poi/trunk/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java
    poi/trunk/src/java/org/apache/poi/sl/draw/DrawTextShape.java
    poi/trunk/src/java/org/apache/poi/sl/draw/ImageRenderer.java
    poi/trunk/src/java/org/apache/poi/util/IOUtils.java
    poi/trunk/src/java/org/apache/poi/util/LittleEndianInputStream.java
    poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java
    poi/trunk/src/ooxml/java/org/apache/poi/xdgf/geom/Dimension2dDouble.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/draw/SVGImageRenderer.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFChart.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFDrawing.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java
    poi/trunk/src/ooxml/java/org/apache/poi/xslf/util/PPTX2PNG.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/sl/TestFonts.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfDrawProperties.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfGraphics.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfBitmapDib.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfBrushStyle.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfColorRef.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfDraw.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfEscape.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfFill.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfFont.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfHatchStyle.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfMapMode.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfMisc.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfPalette.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfPenStyle.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfRecord.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfRecordType.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfText.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/record/HwmfWindowing.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/usermodel/HwmfPicture.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hemf/hemfplus/extractor/HemfPlusExtractorTest.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestPicture.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwmf/TestHwmfParsing.java

Modified: poi/site/src/documentation/content/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/changes.xml?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/changes.xml (original)
+++ poi/site/src/documentation/content/xdocs/changes.xml Sun Dec 16 18:17:21 2018
@@ -85,8 +85,9 @@
           when referring to both H??F and X??F formats.
     -->
 
-    <release version="4.0.2" date="2019-02-??">
+    <release version="4.1.0" date="2019-02-??">
       <actions>
+        <action dev="PD" type="add" fixes-bug="60656" context="SL_Common XSLF HSLF">EMF image support in slideshows</action>
         <action dev="PD" type="add" fixes-bug="62365" context="XSLF">SVG image support in XSLF</action>
         <action dev="PD" type="fix" fixes-bug="63011" context="OPC">Multiple digital signature in excel file broke first signature</action>
         <action dev="PD" type="fix" fixes-bug="62999" context="SL_Common">IBM JDK JIT causes AIOOBE in TexturePaintContext</action>

Propchange: poi/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Dec 16 18:17:21 2018
@@ -1,7 +1,7 @@
 /poi/branches/common_sl:1661320-1691849
 /poi/branches/excelant:1069732-1073692
 /poi/branches/gsoc2012:1341450-1371650
-/poi/branches/hemf:1843341
+/poi/branches/hemf:1839876-1849038
 /poi/branches/hssf_cryptoapi:1753906-1762715
 /poi/branches/ss_border_property_template:1747847-1748074
 /poi/branches/xml_signature:1617139-1628347

Modified: poi/trunk/build.gradle
URL: http://svn.apache.org/viewvc/poi/trunk/build.gradle?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/build.gradle (original)
+++ poi/trunk/build.gradle Sun Dec 16 18:17:21 2018
@@ -91,7 +91,7 @@ subprojects {
     // See https://github.com/melix/japicmp-gradle-plugin 
     apply plugin: 'me.champeau.gradle.japicmp'
         
-    version = '4.0.2-SNAPSHOT'
+    version = '4.1.0-SNAPSHOT'
     ext {
         japicmpversion = '4.0.0'
     }

Modified: poi/trunk/build.xml
URL: http://svn.apache.org/viewvc/poi/trunk/build.xml?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/build.xml (original)
+++ poi/trunk/build.xml Sun Dec 16 18:17:21 2018
@@ -42,7 +42,7 @@ under the License.
 
     <description>The Apache POI project Ant build.</description>
 
-    <property name="version.id" value="4.0.2"/>
+    <property name="version.id" value="4.1.0"/>
     <property name="release.rc" value="RC1"/>
 
     <property environment="env"/>

Modified: poi/trunk/sonar/examples/pom.xml
URL: http://svn.apache.org/viewvc/poi/trunk/sonar/examples/pom.xml?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/sonar/examples/pom.xml (original)
+++ poi/trunk/sonar/examples/pom.xml Sun Dec 16 18:17:21 2018
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.apache.poi</groupId>
         <artifactId>poi-parent</artifactId>
-        <version>4.0.2-SNAPSHOT</version>
+        <version>4.1.0-SNAPSHOT</version>
     </parent>
     <artifactId>poi-examples</artifactId>
     <packaging>jar</packaging>

Modified: poi/trunk/sonar/excelant/pom.xml
URL: http://svn.apache.org/viewvc/poi/trunk/sonar/excelant/pom.xml?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/sonar/excelant/pom.xml (original)
+++ poi/trunk/sonar/excelant/pom.xml Sun Dec 16 18:17:21 2018
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.apache.poi</groupId>
         <artifactId>poi-parent</artifactId>
-        <version>4.0.2-SNAPSHOT</version>
+        <version>4.1.0-SNAPSHOT</version>
     </parent>
     <artifactId>poi-excelant</artifactId>
     <packaging>jar</packaging>

Modified: poi/trunk/sonar/main/pom.xml
URL: http://svn.apache.org/viewvc/poi/trunk/sonar/main/pom.xml?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/sonar/main/pom.xml (original)
+++ poi/trunk/sonar/main/pom.xml Sun Dec 16 18:17:21 2018
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.apache.poi</groupId>
         <artifactId>poi-parent</artifactId>
-        <version>4.0.2-SNAPSHOT</version>
+        <version>4.1.0-SNAPSHOT</version>
     </parent>
     <artifactId>poi-main</artifactId>
     <packaging>jar</packaging>

Modified: poi/trunk/sonar/ooxml-schema-encryption/pom.xml
URL: http://svn.apache.org/viewvc/poi/trunk/sonar/ooxml-schema-encryption/pom.xml?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/sonar/ooxml-schema-encryption/pom.xml (original)
+++ poi/trunk/sonar/ooxml-schema-encryption/pom.xml Sun Dec 16 18:17:21 2018
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.apache.poi</groupId>
         <artifactId>poi-parent</artifactId>
-        <version>4.0.2-SNAPSHOT</version>
+        <version>4.1.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
     <artifactId>poi-ooxml-schema-encryption</artifactId>

Modified: poi/trunk/sonar/ooxml-schema-security/pom.xml
URL: http://svn.apache.org/viewvc/poi/trunk/sonar/ooxml-schema-security/pom.xml?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/sonar/ooxml-schema-security/pom.xml (original)
+++ poi/trunk/sonar/ooxml-schema-security/pom.xml Sun Dec 16 18:17:21 2018
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.apache.poi</groupId>
         <artifactId>poi-parent</artifactId>
-        <version>4.0.2-SNAPSHOT</version>
+        <version>4.1.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
     <artifactId>poi-ooxml-schema-security</artifactId>

Modified: poi/trunk/sonar/ooxml-schema/pom.xml
URL: http://svn.apache.org/viewvc/poi/trunk/sonar/ooxml-schema/pom.xml?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/sonar/ooxml-schema/pom.xml (original)
+++ poi/trunk/sonar/ooxml-schema/pom.xml Sun Dec 16 18:17:21 2018
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.apache.poi</groupId>
         <artifactId>poi-parent</artifactId>
-        <version>4.0.2-SNAPSHOT</version>
+        <version>4.1.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
     <artifactId>poi-ooxml-schema</artifactId>

Modified: poi/trunk/sonar/ooxml/pom.xml
URL: http://svn.apache.org/viewvc/poi/trunk/sonar/ooxml/pom.xml?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/sonar/ooxml/pom.xml (original)
+++ poi/trunk/sonar/ooxml/pom.xml Sun Dec 16 18:17:21 2018
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.apache.poi</groupId>
         <artifactId>poi-parent</artifactId>
-        <version>4.0.2-SNAPSHOT</version>
+        <version>4.1.0-SNAPSHOT</version>
     </parent>
     <artifactId>poi-ooxml</artifactId>
     <packaging>jar</packaging>

Modified: poi/trunk/sonar/pom.xml
URL: http://svn.apache.org/viewvc/poi/trunk/sonar/pom.xml?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/sonar/pom.xml (original)
+++ poi/trunk/sonar/pom.xml Sun Dec 16 18:17:21 2018
@@ -4,7 +4,7 @@
     <groupId>org.apache.poi</groupId>
     <artifactId>poi-parent</artifactId>
     <packaging>pom</packaging>
-    <version>4.0.2-SNAPSHOT</version>
+    <version>4.1.0-SNAPSHOT</version>
     <name>Apache POI - the Java API for Microsoft Documents</name>
     <description>Maven build of Apache POI for Sonar checks</description>
     <url>http://poi.apache.org/</url>

Modified: poi/trunk/sonar/scratchpad/pom.xml
URL: http://svn.apache.org/viewvc/poi/trunk/sonar/scratchpad/pom.xml?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/sonar/scratchpad/pom.xml (original)
+++ poi/trunk/sonar/scratchpad/pom.xml Sun Dec 16 18:17:21 2018
@@ -6,7 +6,7 @@
     <parent>
         <groupId>org.apache.poi</groupId>
         <artifactId>poi-parent</artifactId>
-        <version>4.0.2-SNAPSHOT</version>
+        <version>4.1.0-SNAPSHOT</version>
     </parent>
     <artifactId>poi-scratchpad</artifactId>
     <packaging>jar</packaging>

Modified: poi/trunk/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/stress/SlideShowHandler.java Sun Dec 16 18:17:21 2018
@@ -105,7 +105,6 @@ public abstract class SlideShowHandler e
         for (Slide<?,?> s : ss.getSlides()) {
             BufferedImage img = new BufferedImage(pgsize.width, pgsize.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);

Modified: poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/dev/BiffViewer.java Sun Dec 16 18:17:21 2018
@@ -527,20 +527,16 @@ public final class BiffViewer {
 		}
 		@Override
 		public int read(byte[] b, int off, int len) throws IOException {
+            if (b == null || off < 0 || len < 0  || b.length < off+len) {
+                throw new IllegalArgumentException();
+            }
 			if (_currentPos >= _currentSize) {
 				fillNextBuffer();
 			}
 			if (_currentPos >= _currentSize) {
 				return -1;
 			}
-			int availSize = _currentSize - _currentPos;
-			int result;
-			if (len > availSize) {
-				System.err.println("Unexpected request to read past end of current biff record");
-				result = availSize;
-			} else {
-				result = len;
-			}
+			final int result = Math.min(len, _currentSize - _currentPos);
 			System.arraycopy(_data, _currentPos, b, off, result);
 			_currentPos += result;
 			_overallStreamPos += result;

Modified: poi/trunk/src/java/org/apache/poi/hssf/record/RecordInputStream.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/record/RecordInputStream.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/record/RecordInputStream.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/record/RecordInputStream.java Sun Dec 16 18:17:21 2018
@@ -106,8 +106,8 @@ public final class RecordInputStream imp
 
 		private final LittleEndianInput _lei;
 
-		public SimpleHeaderInput(InputStream in) {
-			_lei = getLEI(in);
+		private SimpleHeaderInput(LittleEndianInput lei) {
+			_lei = lei;
 		}
 		@Override
         public int available() {
@@ -129,8 +129,12 @@ public final class RecordInputStream imp
 
 	public RecordInputStream(InputStream in, EncryptionInfo key, int initialOffset) throws RecordFormatException {
 		if (key == null) {
-			_dataInput = getLEI(in);
-			_bhi = new SimpleHeaderInput(in);
+			_dataInput = (in instanceof LittleEndianInput)
+				// accessing directly is an optimisation
+				? (LittleEndianInput)in
+				// less optimal, but should work OK just the same. Often occurs in junit tests.
+				: new LittleEndianInputStream(in);
+			_bhi = new SimpleHeaderInput(_dataInput);
 		} else {
 			Biff8DecryptingStream bds = new Biff8DecryptingStream(in, initialOffset, key);
             _dataInput = bds;
@@ -195,11 +199,9 @@ public final class RecordInputStream imp
 	private int readNextSid() {
 		int nAvailable  = _bhi.available();
 		if (nAvailable < EOFRecord.ENCODED_SIZE) {
-			/*if (nAvailable > 0) {
-				// some scrap left over?
-				// ex45582-22397.xls has one extra byte after the last record
-				// Excel reads that file OK
-			}*/
+			// some scrap left over, if nAvailable > 0?
+			// ex45582-22397.xls has one extra byte after the last record
+			// Excel reads that file OK
 			return INVALID_SID_VALUE;
 		}
 		int result = _bhi.readRecordSID();
@@ -305,14 +307,8 @@ public final class RecordInputStream imp
 
 	@Override
     public double readDouble() {
-		long valueLongBits = readLong();
-		/*if (Double.isNaN(result)) {
-            // YK: Excel doesn't write NaN but instead converts the cell type into {@link CellType#ERROR}.
-            // HSSF prior to version 3.7 had a bug: it could write Double.NaN but could not read such a file back.
-            // This behavior was fixed in POI-3.7.
-            //throw new RuntimeException("Did not expect to read NaN"); // (Because Excel typically doesn't write NaN)
-		}*/
-		return Double.longBitsToDouble(valueLongBits);
+        // YK: Excel doesn't write NaN but instead converts the cell type into {@link CellType#ERROR}.
+		return Double.longBitsToDouble(readLong());
 	}
 	
 	public void readPlain(byte[] buf, int off, int len) {
@@ -329,7 +325,7 @@ public final class RecordInputStream imp
         readFully(buf, off, len, false);
     }
 	
-    protected void readFully(byte[] buf, int off, int len, boolean isPlain) {
+    private void readFully(byte[] buf, int off, int len, boolean isPlain) {
 	    int origLen = len;
 	    if (buf == null) {
 	        throw new NullPointerException();

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/BitmapImageRenderer.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/BitmapImageRenderer.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/BitmapImageRenderer.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/BitmapImageRenderer.java Sun Dec 16 18:17:21 2018
@@ -40,6 +40,7 @@ import javax.imageio.ImageTypeSpecifier;
 import javax.imageio.stream.ImageInputStream;
 import javax.imageio.stream.MemoryCacheImageInputStream;
 
+import org.apache.poi.sl.usermodel.PictureData.PictureType;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
@@ -48,11 +49,24 @@ import org.apache.poi.util.POILogger;
  * For now this class renders only images supported by the javax.imageio.ImageIO framework.
  **/
 public class BitmapImageRenderer implements ImageRenderer {
-    private final static POILogger LOG = POILogFactory.getLogger(ImageRenderer.class);
+    private final static POILogger LOG = POILogFactory.getLogger(BitmapImageRenderer.class);
 
     protected BufferedImage img;
 
     @Override
+    public boolean canRender(String contentType) {
+        PictureType[] pts = {
+            PictureType.JPEG, PictureType.PNG, PictureType.BMP, PictureType.GIF
+        };
+        for (PictureType pt : pts) {
+            if (pt.contentType.equalsIgnoreCase(contentType)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
     public void loadImage(InputStream data, String contentType) throws IOException {
         img = readImage(data, contentType);
     }

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawFactory.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/DrawFactory.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawFactory.java Sun Dec 16 18:17:21 2018
@@ -22,8 +22,6 @@ import java.awt.font.TextLayout;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Rectangle2D;
 import java.text.AttributedString;
-import java.util.HashMap;
-import java.util.Map;
 
 import org.apache.poi.sl.usermodel.Background;
 import org.apache.poi.sl.usermodel.ConnectorShape;
@@ -40,18 +38,18 @@ import org.apache.poi.sl.usermodel.Table
 import org.apache.poi.sl.usermodel.TextBox;
 import org.apache.poi.sl.usermodel.TextParagraph;
 import org.apache.poi.sl.usermodel.TextShape;
-import org.apache.poi.util.JvmBugs;
 
 public class DrawFactory {
-    protected static final ThreadLocal<DrawFactory> defaultFactory = new ThreadLocal<>();
+    private static final ThreadLocal<DrawFactory> defaultFactory = new ThreadLocal<>();
 
     /**
      * Set a custom draw factory for the current thread.
      * This is a fallback, for operations where usercode can't set a graphics context.
      * Preferably use the rendering hint {@link Drawable#DRAW_FACTORY} to set the factory.
      *
-     * @param factory
+     * @param factory the custom factory
      */
+    @SuppressWarnings("unused")
     public static void setDefaultFactory(DrawFactory factory) {
         defaultFactory.set(factory);
     }
@@ -170,6 +168,7 @@ public class DrawFactory {
         return new DrawBackground(shape);
     }
     
+    @SuppressWarnings("WeakerAccess")
     public DrawTextFragment getTextFragment(TextLayout layout, AttributedString str) {
         return new DrawTextFragment(layout, str);
     }
@@ -214,35 +213,6 @@ public class DrawFactory {
     
     
     /**
-     * Replace font families for Windows JVM 6, which contains a font rendering error.
-     * This is likely to be removed, when POI upgrades to JDK 7
-     *
-     * @param graphics the graphics context which will contain the font mapping
-     */
-    public void fixFonts(Graphics2D graphics) {
-        if (!JvmBugs.hasLineBreakMeasurerBug()) return;
-        @SuppressWarnings("unchecked")
-        Map<String,String> fontMap = (Map<String,String>)graphics.getRenderingHint(Drawable.FONT_MAP);
-        if (fontMap == null) {
-            fontMap = new HashMap<>();
-            graphics.setRenderingHint(Drawable.FONT_MAP, fontMap);
-        }
-        
-        String fonts[][] = {
-            { "Calibri", "Lucida Sans" },
-            { "Cambria", "Lucida Bright" },
-            { "Times New Roman", "Lucida Bright" },
-            { "serif", "Lucida Bright" }
-        };
-
-        for (String f[] : fonts) {
-            if (!fontMap.containsKey(f[0])) {
-                fontMap.put(f[0], f[1]);
-            }
-        }
-    }
-    
-    /**
      * Return a FontManager, either registered beforehand or a default implementation
      *
      * @param graphics the graphics context holding potentially a font manager

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawFontManagerDefault.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawFontManagerDefault.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/DrawFontManagerDefault.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawFontManagerDefault.java Sun Dec 16 18:17:21 2018
@@ -22,6 +22,8 @@ package org.apache.poi.sl.draw;
 import java.awt.Font;
 import java.awt.Graphics2D;
 import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
 
 import org.apache.poi.common.usermodel.fonts.FontInfo;
 import org.apache.poi.sl.draw.Drawable.DrawableHint;
@@ -33,6 +35,13 @@ import org.apache.poi.sl.draw.Drawable.D
  */
 public class DrawFontManagerDefault implements DrawFontManager {
 
+    protected final Set<String> knownSymbolFonts = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
+
+    public DrawFontManagerDefault() {
+        knownSymbolFonts.add("Wingdings");
+        knownSymbolFonts.add("Symbol");
+    }
+
     @Override
     public FontInfo getMappedFont(Graphics2D graphics, FontInfo fontInfo) {
         return getFontWithFallback(graphics, Drawable.FONT_MAP, fontInfo);
@@ -49,25 +58,35 @@ public class DrawFontManagerDefault impl
 
     public String mapFontCharset(Graphics2D graphics, FontInfo fontInfo, String text) {
         // TODO: find a real charset mapping solution instead of hard coding for Wingdings
-        String attStr = text;
-        if (fontInfo != null && "Wingdings".equalsIgnoreCase(fontInfo.getTypeface())) {
-            // wingdings doesn't contain high-surrogates, so chars are ok
-            boolean changed = false;
-            char chrs[] = attStr.toCharArray();
-            for (int i=0; i<chrs.length; i++) {
-                // only change valid chars
-                if ((0x20 <= chrs[i] && chrs[i] <= 0x7f) ||
-                    (0xa0 <= chrs[i] && chrs[i] <= 0xff)) {
-                    chrs[i] |= 0xf000;
-                    changed = true;
-                }
-            }
+        return (fontInfo != null && knownSymbolFonts.contains(fontInfo.getTypeface()))
+            ? mapSymbolChars(text)
+            : text;
+    }
 
-            if (changed) {
-                attStr = new String(chrs);
+    /**
+     * Symbol fonts like "Wingdings" or "Symbol" have glyphs mapped to a Unicode private use range via the Java font loader,
+     * although a system font viewer might show you the glyphs in the ASCII range.
+     * This helper function maps the chars of the text string to the corresponding private use range chars.
+     *
+     * @param text the input string, typically consists of ASCII chars
+     * @return the mapped string, typically consists of chars in the range of 0xf000 to 0xf0ff
+     *
+     * @since POI 4.0.0
+     */
+    public static String mapSymbolChars(String text) {
+        // wingdings doesn't contain high-surrogates, so chars are ok
+        boolean changed = false;
+        char chrs[] = text.toCharArray();
+        for (int i=0; i<chrs.length; i++) {
+            // only change valid chars
+            if ((0x20 <= chrs[i] && chrs[i] <= 0x7f) ||
+                    (0xa0 <= chrs[i] && chrs[i] <= 0xff)) {
+                chrs[i] |= 0xf000;
+                changed = true;
             }
         }
-        return attStr;
+
+        return changed ? new String(chrs) : text;
     }
 
     @Override

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawPictureShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawPictureShape.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/DrawPictureShape.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawPictureShape.java Sun Dec 16 18:17:21 2018
@@ -24,17 +24,20 @@ import java.awt.geom.Rectangle2D;
 import java.io.IOException;
 
 import org.apache.poi.sl.usermodel.PictureData;
-import org.apache.poi.sl.usermodel.PictureData.PictureType;
-import org.apache.poi.util.POILogFactory;
-import org.apache.poi.util.POILogger;
 import org.apache.poi.sl.usermodel.PictureShape;
 import org.apache.poi.sl.usermodel.RectAlign;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
 
 
 public class DrawPictureShape extends DrawSimpleShape {
     private static final POILogger LOG = POILogFactory.getLogger(DrawPictureShape.class);
-    private static final String WMF_IMAGE_RENDERER = "org.apache.poi.hwmf.draw.HwmfSLImageRenderer";
-    
+    private static final String[] KNOWN_RENDERER = {
+        "org.apache.poi.hwmf.draw.HwmfImageRenderer",
+        "org.apache.poi.hemf.draw.HemfImageRenderer",
+        "org.apache.poi.xslf.draw.SVGImageRenderer"
+    };
+
     public DrawPictureShape(PictureShape<?,?> shape) {
         super(shape);
     }
@@ -59,29 +62,47 @@ public class DrawPictureShape extends Dr
     /**
      * Returns an ImageRenderer for the PictureData
      *
-     * @param graphics
+     * @param graphics the graphics context
      * @return the image renderer
      */
+    @SuppressWarnings({"WeakerAccess", "unchecked"})
     public static ImageRenderer getImageRenderer(Graphics2D graphics, String contentType) {
-        ImageRenderer renderer = (ImageRenderer)graphics.getRenderingHint(Drawable.IMAGE_RENDERER);
-        if (renderer != null) {
+        final ImageRenderer renderer = (ImageRenderer)graphics.getRenderingHint(Drawable.IMAGE_RENDERER);
+        if (renderer != null && renderer.canRender(contentType)) {
             return renderer;
         }
-        
-        if (PictureType.WMF.contentType.equals(contentType)) {
+
+        // first try with our default image renderer
+        final BitmapImageRenderer bir = new BitmapImageRenderer();
+        if (bir.canRender(contentType)) {
+            return bir;
+        }
+
+        // then iterate through the scratchpad renderers
+        //
+        // this could be nicely implemented via a j.u.ServiceLoader, but OSGi makes things complicated ...
+        // https://blog.osgi.org/2013/02/javautilserviceloader-in-osgi.html
+        // ... therefore falling back to classloading attempts
+        ClassLoader cl = ImageRenderer.class.getClassLoader();
+        for (String kr : KNOWN_RENDERER) {
+            final ImageRenderer ir;
             try {
-                @SuppressWarnings("unchecked")
-                Class<? extends ImageRenderer> irc = (Class<? extends ImageRenderer>)
-                        DrawPictureShape.class.getClassLoader().loadClass(WMF_IMAGE_RENDERER);
-                return irc.newInstance();
-            } catch (Exception e) {
-                // WMF image renderer is not on the classpath, continuing with BitmapRenderer
-                // although this doesn't make much sense ...
-                LOG.log(POILogger.ERROR, "WMF image renderer is not on the classpath - include poi-scratchpad jar!", e);
+                ir = ((Class<? extends ImageRenderer>)cl.loadClass(kr)).newInstance();
+            } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
+                // scratchpad was not on the path, ignore and continue
+                LOG.log(POILogger.INFO, "Known image renderer '"+kr+" not found/loaded - include poi-scratchpad jar!", e);
+                continue;
+            }
+            if (ir.canRender(contentType)) {
+                return ir;
             }
         }
-        
-        return new BitmapImageRenderer();
+
+        LOG.log(POILogger.WARN, "No suiteable image renderer found for content-type '"+
+                contentType+"' - include poi-scratchpad jar!");
+
+        // falling back to BitmapImageRenderer, at least it gracefully handles invalid images
+        return bir;
     }
     
     @Override

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java Sun Dec 16 18:17:21 2018
@@ -254,7 +254,6 @@ public class DrawTextParagraph implement
         lines.clear();
 
         DrawFactory fact = DrawFactory.getInstance(graphics);
-        fact.fixFonts(graphics);
         StringBuilder text = new StringBuilder();
         AttributedString at = getAttributedString(graphics, text);
         boolean emptyParagraph = text.toString().trim().isEmpty();
@@ -635,13 +634,6 @@ public class DrawTextParagraph implement
      * <li>determine the font group - a text run can have different font groups. Depending on the chars,
      * the correct font group needs to be used
      *
-     * @param graphics
-     * @param dfm
-     * @param attList
-     * @param beginIndex
-     * @param run
-     * @param runText
-     *
      * @see <a href="https://blogs.msdn.microsoft.com/officeinteroperability/2013/04/22/office-open-xml-themes-schemes-and-fonts/">Office Open XML Themes, Schemes, and Fonts</a>
      */
     private void processGlyphs(Graphics2D graphics, DrawFontManager dfm, List<AttributedStringData> attList, final int beginIndex, TextRun run, String runText) {

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawTextShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawTextShape.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/DrawTextShape.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawTextShape.java Sun Dec 16 18:17:21 2018
@@ -40,8 +40,6 @@ public class DrawTextShape extends DrawS
 
     @Override
     public void drawContent(Graphics2D graphics) {
-        DrawFactory.getInstance(graphics).fixFonts(graphics);
-        
         TextShape<?,?> s = getShape();
         
         Rectangle2D anchor = DrawShape.getAnchor(graphics, s);
@@ -219,10 +217,9 @@ public class DrawTextShape extends DrawS
             graphics.addRenderingHints(oldGraphics.getRenderingHints());
             graphics.setTransform(oldGraphics.getTransform());
         }
-        DrawFactory.getInstance(graphics).fixFonts(graphics);
         return drawParagraphs(graphics, 0, 0);
     }
-    
+
     @Override
     protected TextShape<?,? extends TextParagraph<?,?,? extends TextRun>> getShape() {
         return (TextShape<?,? extends TextParagraph<?,?,? extends TextRun>>)shape;

Modified: poi/trunk/src/java/org/apache/poi/sl/draw/ImageRenderer.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/ImageRenderer.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/draw/ImageRenderer.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/draw/ImageRenderer.java Sun Dec 16 18:17:21 2018
@@ -76,6 +76,13 @@ import java.io.InputStream;
  */
 public interface ImageRenderer {
     /**
+     * Determines if this image renderer implementation supports the given contentType
+     * @param contentType the image content type
+     * @return if the content type is supported
+     */
+    boolean canRender(String contentType);
+
+    /**
      * Load and buffer the image
      *
      * @param data the raw image stream

Copied: poi/trunk/src/java/org/apache/poi/util/Dimension2DDouble.java (from r1849038, poi/branches/hemf/src/java/org/apache/poi/util/Dimension2DDouble.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/util/Dimension2DDouble.java?p2=poi/trunk/src/java/org/apache/poi/util/Dimension2DDouble.java&p1=poi/branches/hemf/src/java/org/apache/poi/util/Dimension2DDouble.java&r1=1849038&r2=1849040&rev=1849040&view=diff
==============================================================================
--- poi/branches/hemf/src/java/org/apache/poi/util/Dimension2DDouble.java (original)
+++ poi/trunk/src/java/org/apache/poi/util/Dimension2DDouble.java Sun Dec 16 18:17:21 2018
@@ -19,6 +19,9 @@ package org.apache.poi.util;
 
 import java.awt.geom.Dimension2D;
 
+/**
+ * @since 4.1.0
+ */
 public class Dimension2DDouble extends Dimension2D {
 
     double width;

Modified: poi/trunk/src/java/org/apache/poi/util/IOUtils.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/util/IOUtils.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/util/IOUtils.java (original)
+++ poi/trunk/src/java/org/apache/poi/util/IOUtils.java Sun Dec 16 18:17:21 2018
@@ -50,6 +50,7 @@ public final class IOUtils {
      * @param maxOverride The number of bytes that should be possible to be allocated in one step.
      * @since 4.0.0
      */
+    @SuppressWarnings("unused")
     public static void setByteArrayMaxOverride(int maxOverride) {
         BYTE_ARRAY_MAX_OVERRIDE = maxOverride;
     }
@@ -395,13 +396,35 @@ public final class IOUtils {
      * @throws IOException If copying the data fails.
      */
     public static long copy(InputStream inp, OutputStream out) throws IOException {
+        return copy(inp, out, -1);
+    }
+
+    /**
+     * Copies all the data from the given InputStream to the OutputStream. It
+     * leaves both streams open, so you will still need to close them once done.
+     *
+     * @param inp The {@link InputStream} which provides the data
+     * @param out The {@link OutputStream} to write the data to
+     * @param limit limit the copied bytes - use {@code -1} for no limit
+     * @return the amount of bytes copied
+     *
+     * @throws IOException If copying the data fails.
+     */
+    public static long copy(InputStream inp, OutputStream out, long limit) throws IOException {
         final byte[] buff = new byte[4096];
         long totalCount = 0;
-        for (int count; (count = inp.read(buff)) != -1; totalCount += count) {
-            if (count > 0) {
-                out.write(buff, 0, count);
+        int readBytes = -1;
+        do {
+            int todoBytes = (int)((limit < 0) ? buff.length : Math.min(limit-totalCount, buff.length));
+            if (todoBytes > 0) {
+                readBytes = inp.read(buff, 0, todoBytes);
+                if (readBytes > 0) {
+                    out.write(buff, 0, readBytes);
+                    totalCount += readBytes;
+                }
             }
-        }
+        } while (readBytes >= 0 && (limit == -1 || totalCount < limit));
+
         return totalCount;
     }
 

Modified: poi/trunk/src/java/org/apache/poi/util/LittleEndianInputStream.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/util/LittleEndianInputStream.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/util/LittleEndianInputStream.java (original)
+++ poi/trunk/src/java/org/apache/poi/util/LittleEndianInputStream.java Sun Dec 16 18:17:21 2018
@@ -17,6 +17,7 @@
 
 package org.apache.poi.util;
 
+import java.io.BufferedInputStream;
 import java.io.FilterInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -29,12 +30,16 @@ import java.io.InputStream;
  */
 public class LittleEndianInputStream extends FilterInputStream implements LittleEndianInput {
 
+	private static final int BUFFERED_SIZE = 8096;
+
 	private static final int EOF = -1;
+	private int readIndex = 0;
+	private int markIndex = -1;
 
 	public LittleEndianInputStream(InputStream is) {
-		super(is);
+		super(is.markSupported() ? is : new BufferedInputStream(is, BUFFERED_SIZE));
 	}
-	
+
 	@Override
 	@SuppressForbidden("just delegating")
 	public int available() {
@@ -60,7 +65,18 @@ public class LittleEndianInputStream ext
 		}
 		return LittleEndian.getUByte(buf);
 	}
-	
+
+	/**
+	 * get a float value, reads it in little endian format
+	 * then converts the resulting revolting IEEE 754 (curse them) floating
+	 * point number to a happy java float
+	 *
+	 * @return the float (32-bit) value
+	 */
+	public float readFloat() {
+		return Float.intBitsToFloat( readInt() );
+	}
+
 	@Override
 	public double readDouble() {
 		return Double.longBitsToDouble(readLong());
@@ -137,14 +153,42 @@ public class LittleEndianInputStream ext
         }
     }
 
-    //Makes repeated calls to super.read() until length is read or EOF is reached
+	@Override
+	public int read(byte[] b, int off, int len) throws IOException {
+    	int readBytes = super.read(b, off, len);
+		readIndex += readBytes;
+		return readBytes;
+	}
+
+	@Override
+	public synchronized void mark(int readlimit) {
+		super.mark(readlimit);
+		markIndex = readIndex;
+	}
+
+	@Override
+	public synchronized void reset() throws IOException {
+		super.reset();
+		if (markIndex > -1) {
+			readIndex = markIndex;
+			markIndex = -1;
+		}
+	}
+
+	public int getReadIndex() {
+		return readIndex;
+	}
+
+
+
+	//Makes repeated calls to super.read() until length is read or EOF is reached
 	private int _read(byte[] buffer, int offset, int length) throws IOException {
     	//lifted directly from org.apache.commons.io.IOUtils 2.4
 		int remaining = length;
 		while (remaining > 0) {
 			int location = length - remaining;
 			int count = read(buffer, offset + location, remaining);
-			if (EOF == count) { // EOF
+			if (EOF == count) {
 				break;
 			}
 			remaining -= count;
@@ -157,4 +201,9 @@ public class LittleEndianInputStream ext
     public void readPlain(byte[] buf, int off, int len) {
         readFully(buf, off, len);
     }
+
+
+	public void skipFully(int len) throws IOException {
+		IOUtils.skipFully(this, len);
+	}
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureConfig.java Sun Dec 16 18:17:21 2018
@@ -177,7 +177,7 @@ public class SignatureConfig {
     /**
      * if true, the signature is added to the existing signatures
      *
-     * @since POI 4.0.2
+     * @since POI 4.1.0
      */
     private boolean allowMultipleSignatures = false;
 
@@ -1019,7 +1019,7 @@ public class SignatureConfig {
     /**
      * @return true, if multiple signatures can be attached
      *
-     * @since POI 4.0.2
+     * @since POI 4.1.0
      */
     public boolean isAllowMultipleSignatures() {
         return allowMultipleSignatures;
@@ -1031,7 +1031,7 @@ public class SignatureConfig {
      * @param allowMultipleSignatures if true, the signature will be added,
      *          otherwise all existing signatures will be replaced by the current
      *
-     * @since POI 4.0.2
+     * @since POI 4.1.0
      */
     public void setAllowMultipleSignatures(boolean allowMultipleSignatures) {
         this.allowMultipleSignatures = allowMultipleSignatures;

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xdgf/geom/Dimension2dDouble.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xdgf/geom/Dimension2dDouble.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xdgf/geom/Dimension2dDouble.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xdgf/geom/Dimension2dDouble.java Sun Dec 16 18:17:21 2018
@@ -17,57 +17,12 @@
 
 package org.apache.poi.xdgf.geom;
 
-import java.awt.geom.Dimension2D;
+import org.apache.poi.util.Removal;
 
-public class Dimension2dDouble extends Dimension2D {
-
-    double width;
-    double height;
-
-    public Dimension2dDouble() {
-        width = 0d;
-        height = 0d;
-    }
-
-    public Dimension2dDouble(double width, double height) {
-        this.width = width;
-        this.height = height;
-    }
-
-    @Override
-    public double getWidth() {
-        return width;
-    }
-
-    @Override
-    public double getHeight() {
-        return height;
-    }
-
-    @Override
-    public void setSize(double width, double height) {
-        this.width = width;
-        this.height = height;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof Dimension2dDouble) {
-            Dimension2dDouble other = (Dimension2dDouble) obj;
-            return width == other.width && height == other.height;
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        double sum = width + height;
-        return (int) Math.ceil(sum * (sum + 1) / 2 + width);
-    }
-
-    @Override
-    public String toString() {
-        return "Dimension2dDouble[" + width + ", " + height + "]";
-    }
+/**
+ * @deprecated in 4.1.0 - use org.apache.poi.util.Dimension2DDouble
+ */
+@Deprecated
+@Removal(version = "5.0.0")
+public class Dimension2dDouble extends org.apache.poi.util.Dimension2DDouble {
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/draw/SVGImageRenderer.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/draw/SVGImageRenderer.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/draw/SVGImageRenderer.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/draw/SVGImageRenderer.java Sun Dec 16 18:17:21 2018
@@ -39,6 +39,7 @@ import org.apache.batik.ext.awt.image.re
 import org.apache.batik.gvt.GraphicsNode;
 import org.apache.batik.util.XMLResourceDescriptor;
 import org.apache.poi.sl.draw.ImageRenderer;
+import org.apache.poi.sl.usermodel.PictureData;
 import org.w3c.dom.Document;
 
 public class SVGImageRenderer implements ImageRenderer {
@@ -133,4 +134,9 @@ public class SVGImageRenderer implements
 
         return true;
     }
+
+    @Override
+    public boolean canRender(String contentType) {
+        return PictureData.PictureType.SVG.contentType.equalsIgnoreCase(contentType);
+    }
 }

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XMLSlideShow.java Sun Dec 16 18:17:21 2018
@@ -310,7 +310,7 @@ public class XMLSlideShow extends POIXML
     /**
      * This method is used to create template for chart XML.
      * @return Xslf chart object 
-     * @since POI 4.0.2 
+     * @since POI 4.1.0
      */
     public XSLFChart createChart() {
         int chartIdx = findNextAvailableFileNameIndex(XSLFRelation.CHART, _charts.size() + 1);

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFChart.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFChart.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFChart.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFChart.java Sun Dec 16 18:17:21 2018
@@ -112,7 +112,7 @@ public final class XSLFChart extends XDD
      * @param rID relation id
      * @param anchor size and location of chart
      * @return graphic frame object
-     * @since POI 4.0.2
+     * @since POI 4.1.0
      */
     static CTGraphicalObjectFrame prototype(int shapeId, String rID, Rectangle2D anchor) {
         CTGraphicalObjectFrame frame = CTGraphicalObjectFrame.Factory.newInstance();

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFDrawing.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFDrawing.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFDrawing.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFDrawing.java Sun Dec 16 18:17:21 2018
@@ -112,7 +112,7 @@ public class XSLFDrawing {
      *
      * @param rID relation id of chart
      * @param rect2D Chart Bounding values
-     * @since POI 4.0.2
+     * @since POI 4.1.0
      */
     public void addChart(String rID, Rectangle2D rect2D) {
         CTGraphicalObjectFrame sp = _spTree.addNewGraphicFrame();

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFSheet.java Sun Dec 16 18:17:21 2018
@@ -724,7 +724,7 @@ implements XSLFShapeContainer, Sheet<XSL
      * this method will add chart into slide
      * with default height, width, x and y
      * @param chart xslf chart object
-     * @since POI 4.0.2
+     * @since POI 4.1.0
      */
     public void addChart(XSLFChart chart) {
         Rectangle2D rect2D = new java.awt.Rectangle(XDDFChart.DEFAULT_X, XDDFChart.DEFAULT_Y,
@@ -737,7 +737,7 @@ implements XSLFShapeContainer, Sheet<XSL
      * this method will add chart into slide
      * with given height, width, x and y
      * @param chart xslf chart object
-     * @since POI 4.0.2
+     * @since POI 4.1.0
      */
     public void addChart(XSLFChart chart, Rectangle2D rect2D) {
         RelationPart rp = addRelation(null, XSLFRelation.CHART, chart);

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=1849040&r1=1849039&r2=1849040&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 Sun Dec 16 18:17:21 2018
@@ -139,7 +139,6 @@ public class PPTX2PNG {
 
                 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);

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/sl/TestFonts.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/sl/TestFonts.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/sl/TestFonts.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/sl/TestFonts.java Sun Dec 16 18:17:21 2018
@@ -130,8 +130,6 @@ public class TestFonts {
         graphics.setRenderingHint(Drawable.FONT_FALLBACK, fallbackMap);
         graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
 
-        DrawFactory.getInstance(graphics).fixFonts(graphics);
-
         tb.resizeToFitText(graphics);
         graphics.dispose();
 

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFSimpleShape.java Sun Dec 16 18:17:21 2018
@@ -361,7 +361,6 @@ public class TestXSLFSimpleShape {
 
             BufferedImage img = new BufferedImage(pgsize.width, pgsize.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);

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfDrawProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfDrawProperties.java?rev=1849040&r1=1849039&r2=1849040&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfDrawProperties.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwmf/draw/HwmfDrawProperties.java Sun Dec 16 18:17:21 2018
@@ -19,7 +19,9 @@ package org.apache.poi.hwmf.draw;
 
 import java.awt.Color;
 import java.awt.Shape;
+import java.awt.geom.AffineTransform;
 import java.awt.geom.Area;
+import java.awt.geom.Path2D;
 import java.awt.geom.Point2D;
 import java.awt.geom.Rectangle2D;
 import java.awt.image.BufferedImage;
@@ -36,6 +38,7 @@ import org.apache.poi.hwmf.record.HwmfMa
 import org.apache.poi.hwmf.record.HwmfMisc.WmfSetBkMode.HwmfBkMode;
 import org.apache.poi.hwmf.record.HwmfPalette.PaletteEntry;
 import org.apache.poi.hwmf.record.HwmfPenStyle;
+import org.apache.poi.hwmf.record.HwmfTernaryRasterOp;
 import org.apache.poi.hwmf.record.HwmfText.HwmfTextAlignment;
 import org.apache.poi.hwmf.record.HwmfText.HwmfTextVerticalAlignment;
 
@@ -43,36 +46,59 @@ public class HwmfDrawProperties {
     private final Rectangle2D window;
     private Rectangle2D viewport;
     private final Point2D location;
-    private HwmfMapMode mapMode = HwmfMapMode.MM_ANISOTROPIC;
-    private HwmfColorRef backgroundColor = new HwmfColorRef(Color.BLACK);
-    private HwmfBrushStyle brushStyle = HwmfBrushStyle.BS_SOLID;
-    private HwmfColorRef brushColor = new HwmfColorRef(Color.BLACK);
-    private HwmfHatchStyle brushHatch = HwmfHatchStyle.HS_HORIZONTAL;
+    private HwmfMapMode mapMode;
+    private HwmfColorRef backgroundColor;
+    private HwmfBrushStyle brushStyle;
+    private HwmfColorRef brushColor;
+    private HwmfHatchStyle brushHatch;
     private BufferedImage brushBitmap;
-    private double penWidth = 1;
-    private HwmfPenStyle penStyle = HwmfPenStyle.valueOf(0);
-    private HwmfColorRef penColor = new HwmfColorRef(Color.BLACK);
-    private double penMiterLimit = 10;
-    private HwmfBkMode bkMode = HwmfBkMode.OPAQUE;
-    private HwmfPolyfillMode polyfillMode = HwmfPolyfillMode.WINDING;
+    private double penWidth;
+    private HwmfPenStyle penStyle;
+    private HwmfColorRef penColor;
+    private double penMiterLimit;
+    private HwmfBkMode bkMode;
+    private HwmfPolyfillMode polyfillMode;
     private Shape region;
     private List<PaletteEntry> palette;
     private int paletteOffset;
     private HwmfFont font;
-    private HwmfColorRef textColor = new HwmfColorRef(Color.BLACK);
-    private HwmfTextAlignment textAlignLatin = HwmfTextAlignment.LEFT;
-    private HwmfTextVerticalAlignment textVAlignLatin = HwmfTextVerticalAlignment.TOP;
-    private HwmfTextAlignment textAlignAsian = HwmfTextAlignment.RIGHT;
-    private HwmfTextVerticalAlignment textVAlignAsian = HwmfTextVerticalAlignment.TOP;
+    private HwmfColorRef textColor;
+    private HwmfTextAlignment textAlignLatin;
+    private HwmfTextVerticalAlignment textVAlignLatin;
+    private HwmfTextAlignment textAlignAsian;
+    private HwmfTextVerticalAlignment textVAlignAsian;
+    private HwmfTernaryRasterOp rasterOp;
+    protected Shape clip;
+    protected final AffineTransform transform = new AffineTransform();
 
     public HwmfDrawProperties() {
         window = new Rectangle2D.Double(0, 0, 1, 1);
         viewport = null;
         location = new Point2D.Double(0,0);
+        mapMode = HwmfMapMode.MM_ANISOTROPIC;
+        backgroundColor = new HwmfColorRef(Color.BLACK);
+        brushStyle = HwmfBrushStyle.BS_SOLID;
+        brushColor = new HwmfColorRef(Color.BLACK);
+        brushHatch = HwmfHatchStyle.HS_HORIZONTAL;
+        penWidth = 1;
+        penStyle = HwmfPenStyle.valueOf(0);
+        penColor = new HwmfColorRef(Color.BLACK);
+        penMiterLimit = 10;
+        bkMode = HwmfBkMode.OPAQUE;
+        polyfillMode = HwmfPolyfillMode.WINDING;
+        textColor = new HwmfColorRef(Color.BLACK);
+        textAlignLatin = HwmfTextAlignment.LEFT;
+        textVAlignLatin = HwmfTextVerticalAlignment.TOP;
+        textAlignAsian = HwmfTextAlignment.RIGHT;
+        textVAlignAsian = HwmfTextVerticalAlignment.TOP;
+        rasterOp = HwmfTernaryRasterOp.PATCOPY;
+        clip = null;
+        font = new HwmfFont();
+        font.initDefaults();
     }
     
     public HwmfDrawProperties(HwmfDrawProperties other) {
-        this.window = (Rectangle2D)other.window.clone();
+        this.window = (other.window == null) ? null : (Rectangle2D)other.window.clone();
         this.viewport = (other.viewport == null) ? null : (Rectangle2D)other.viewport.clone();
         this.location = (Point2D)other.location.clone();
         this.mapMode = other.mapMode;
@@ -86,7 +112,7 @@ public class HwmfDrawProperties {
             WritableRaster raster = other.brushBitmap.copyData(null);
             this.brushBitmap = new BufferedImage(cm, raster, isAlphaPremultiplied, null);            
         }
-        this.penWidth = 1;
+        this.penWidth = other.penWidth;
         this.penStyle = (other.penStyle == null) ? null : other.penStyle.clone();
         this.penColor = (other.penColor == null) ? null : other.penColor.clone();
         this.penMiterLimit = other.penMiterLimit;
@@ -101,6 +127,13 @@ public class HwmfDrawProperties {
         this.paletteOffset = other.paletteOffset;
         this.font = other.font;
         this.textColor = (other.textColor == null) ? null : other.textColor.clone();
+        this.textAlignLatin = other.textAlignLatin;
+        this.textVAlignLatin = other.textVAlignLatin;
+        this.textAlignAsian = other.textAlignAsian;
+        this.textVAlignAsian = other.textVAlignAsian;
+        this.rasterOp = other.rasterOp;
+        this.transform.setTransform(other.transform);
+        this.clip = other.clip;
     }
     
     public void setViewportExt(double width, double height) {
@@ -149,6 +182,10 @@ public class HwmfDrawProperties {
         location.setLocation(x, y);
     }
 
+    public void setLocation(Point2D point) {
+        location.setLocation(point);
+    }
+
     public Point2D getLocation() {
         return (Point2D)location.clone();
     }
@@ -343,4 +380,35 @@ public class HwmfDrawProperties {
     public void setTextVAlignAsian(HwmfTextVerticalAlignment textVAlignAsian) {
         this.textVAlignAsian = textVAlignAsian;
     }
+
+    /**
+     * @return the current active winding rule ({@link Path2D#WIND_EVEN_ODD} or {@link Path2D#WIND_NON_ZERO})
+     */
+    public int getWindingRule() {
+        return getPolyfillMode().awtFlag;
+    }
+
+    public HwmfTernaryRasterOp getRasterOp() {
+        return rasterOp;
+    }
+
+    public void setRasterOp(HwmfTernaryRasterOp rasterOp) {
+        this.rasterOp = rasterOp;
+    }
+
+    public AffineTransform getTransform() {
+        return transform;
+    }
+
+    public void setTransform(AffineTransform transform) {
+        this.transform.setTransform(transform);
+    }
+
+    public Shape getClip() {
+        return clip;
+    }
+
+    public void setClip(Shape clip) {
+        this.clip = clip;
+    }
 }



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


Mime
View raw message