You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ga...@apache.org on 2016/03/13 02:32:45 UTC
svn commit: r1734752 [11/11] - in /xmlgraphics/fop/branches/maven: ./
fop-core/ fop-core/src/main/codegen/fonts/
fop-core/src/tools/resources/checkstyle/ fop-events/ fop-sandbox/
fop-sandbox/src/main/java/org/apache/fop/render/mif/ fop-sandbox/src/main...
Modified: xmlgraphics/fop/branches/maven/fop-core/src/main/codegen/fonts/code-point-mapping.xsl
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-core/src/main/codegen/fonts/code-point-mapping.xsl?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-core/src/main/codegen/fonts/code-point-mapping.xsl (original)
+++ xmlgraphics/fop/branches/maven/fop-core/src/main/codegen/fonts/code-point-mapping.xsl Sun Mar 13 01:32:45 2016
@@ -28,9 +28,9 @@
* 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.
@@ -40,8 +40,10 @@
package org.apache.fop.fonts;
-import java.util.Map;
import java.util.Collections;
+import java.util.Map;
+
+// CSOFF: ConstantNameCheck
public class CodePointMapping extends AbstractCodePointMapping {
@@ -64,23 +66,26 @@ public class CodePointMapping extends Ab
CodePointMapping mapping = (CodePointMapping) mappings.get(encoding);
if (mapping != null) {
return mapping;
- } <xsl:apply-templates mode="get"/>
- throw new UnsupportedOperationException("Unknown encoding: " + encoding);
+<xsl:apply-templates mode="get"/>
+ } else {
+ throw new UnsupportedOperationException("Unknown encoding: " + encoding);
+ }
}
<xsl:apply-templates mode="table"/>
<xsl:apply-templates select="encoding" mode="names"/>
}
- </xsl:template>
+</xsl:template>
- <xsl:template match="encoding" mode="constant"> public static final String <xsl:value-of select="@constant"/> = "<xsl:value-of select="@id"/>";</xsl:template>
+ <xsl:template match="encoding" mode="constant">
+ public static final String <xsl:value-of select="@constant"/> = "<xsl:value-of select="@id"/>";
+</xsl:template>
- <xsl:template match="encoding" mode="get">
- else if (encoding.equals(<xsl:value-of select="@constant"/>)) {
- mapping = new CodePointMapping(<xsl:value-of select="@constant"/>, enc<xsl:value-of select="@id"/>, names<xsl:value-of select="@id"/>);
+<xsl:template match="encoding" mode="get">
+ } else if (encoding.equals(<xsl:value-of select="@constant"/>)) {
+ mapping = new CodePointMapping(<xsl:value-of select="@constant"/>, enc<xsl:value-of select="@id"/>, names<xsl:value-of select="@id"/>);
mappings.put(<xsl:value-of select="@constant"/>, mapping);
return mapping;
- }
- </xsl:template>
+</xsl:template>
<xsl:template match="encoding" mode="table">
<xsl:variable name="glyphlist-name" select="@glyphlist"/>
@@ -93,7 +98,7 @@ public class CodePointMapping extends Ab
0x<xsl:value-of select="$codepoint"/>, 0x<xsl:value-of select="@codepoint"/>, // <xsl:value-of select="$name"/>
</xsl:for-each></xsl:for-each>
};
- </xsl:template>
+</xsl:template>
<xsl:template match="encoding" mode="names">
private static final String[] names<xsl:value-of select="@id"/>
@@ -102,7 +107,7 @@ public class CodePointMapping extends Ab
<xsl:with-param name="idx" select="0"/>
</xsl:call-template>
};
- </xsl:template>
+</xsl:template>
<xsl:template name="charname">
<xsl:param name="idx"/>
@@ -121,20 +126,20 @@ public class CodePointMapping extends Ab
<xsl:value-of select="$idx"/>-<xsl:value-of select="$idxHEXraw"/>-<xsl:value-of select="$idxHEX"/>-<xsl:value-of select="$idxhex"/>
-->
<xsl:if test="($idx mod 4) = 0">
- <xsl:text>
 /*</xsl:text><xsl:value-of select="$idxHEX"/><xsl:text>*/ </xsl:text>
+ <xsl:text>
 /*</xsl:text><xsl:value-of select="$idxHEX"/><xsl:text>*/</xsl:text>
</xsl:if>
<xsl:variable name="v">
<xsl:value-of select="child::glyph[@codepoint = $idxHEX or @codepoint = $idxhex]/@name"/><!--<xsl:value-of select="glyph[@codepoint = $idxhex]/@name"/>-->
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($v) > 0">
- <xsl:text>"</xsl:text><xsl:value-of select="$v"/><xsl:text>"</xsl:text>
+ <xsl:text> "</xsl:text><xsl:value-of select="$v"/><xsl:text>"</xsl:text>
</xsl:when>
- <xsl:otherwise>null</xsl:otherwise>
+ <xsl:otherwise> null</xsl:otherwise>
</xsl:choose>
<xsl:if test="$idx < 255">
- <xsl:text>, </xsl:text>
+ <xsl:text>,</xsl:text>
<xsl:call-template name="charname">
<xsl:with-param name="idx" select="$idx + 1"/>
</xsl:call-template>
Modified: xmlgraphics/fop/branches/maven/fop-core/src/main/codegen/fonts/font-file.xsl
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-core/src/main/codegen/fonts/font-file.xsl?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-core/src/main/codegen/fonts/font-file.xsl (original)
+++ xmlgraphics/fop/branches/maven/fop-core/src/main/codegen/fonts/font-file.xsl Sun Mar 13 01:32:45 2016
@@ -32,7 +32,23 @@
<xsl:param name="encoding" select="/font-metrics/encoding"/>
<xsl:variable name="glyphs" select="document('encodings.xml')/encoding-set/encoding[@id=$encoding]/glyph"/>
- <xsl:template match="font-metrics">
+ <xsl:template match="font-metrics"> /*
+ * 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.fop.fonts.base14;
import java.awt.Rectangle;
@@ -41,53 +57,58 @@ import java.net.URI;
import java.util.Map;
</xsl:if>
import java.util.Set;
-import org.apache.fop.fonts.FontType;
+
import org.apache.fop.fonts.Base14Font;
import org.apache.fop.fonts.CodePointMapping;
+import org.apache.fop.fonts.FontType;
import org.apache.fop.fonts.Typeface;
+// CSOFF: ConstantNameCheck
+
public class <xsl:value-of select="class-name"/> extends Base14Font {
- private final static URI fontFileURI;
- private final static String fontName = "<xsl:value-of select="font-name"/>";
- private final static String fullName = "<xsl:value-of select="full-name"/>";
- private final static Set familyNames;
- private final static int underlinePosition = <xsl:value-of select="underline-position"/>;
- private final static int underlineThickness = <xsl:value-of select="underline-thickness"/>;
- private final static String encoding = "<xsl:value-of select="$encoding"/>";
- private final static int capHeight = <xsl:value-of select="cap-height"/>;
- private final static int xHeight = <xsl:value-of select="x-height"/>;
- private final static int ascender = <xsl:value-of select="ascender"/>;
- private final static int descender = <xsl:value-of select="descender"/>;
- private final static int firstChar = <xsl:value-of select="first-char"/>;
- private final static int lastChar = <xsl:value-of select="last-char"/>;
- private final static int[] width;
- private final static Rectangle[] boundingBoxes;
+ private static final URI fontFileURI;
+ private static final String fontName = "<xsl:value-of select="font-name"/>";
+ private static final String fullName = "<xsl:value-of select="full-name"/>";
+ private static final Set familyNames;
+ private static final int underlinePosition = <xsl:value-of select="underline-position"/>;
+ private static final int underlineThickness = <xsl:value-of select="underline-thickness"/>;
+ private static final String encoding = "<xsl:value-of select="$encoding"/>";
+ private static final int capHeight = <xsl:value-of select="cap-height"/>;
+ private static final int xHeight = <xsl:value-of select="x-height"/>;
+ private static final int ascender = <xsl:value-of select="ascender"/>;
+ private static final int descender = <xsl:value-of select="descender"/>;
+ private static final int firstChar = <xsl:value-of select="first-char"/>;
+ private static final int lastChar = <xsl:value-of select="last-char"/>;
+ private static final int[] width;
+ private static final Rectangle[] boundingBoxes;
private final CodePointMapping mapping =
CodePointMapping.getMapping("<xsl:value-of select="$encoding"/>");
<xsl:if test="count(kerning) > 0">
- private final static Map kerning;
+ private static final Map kerning;
</xsl:if>
- private boolean enableKerning = false;
+ private boolean enableKerning;
static {
URI uri = null;
try {
uri = new URI("base14:" + fontName.toLowerCase());
} catch (java.net.URISyntaxException e) {
+ throw new RuntimeException(e);
}
fontFileURI = uri;
width = new int[256];
boundingBoxes = new Rectangle[256];
- <xsl:apply-templates select="char-metrics"/>
+<xsl:apply-templates select="char-metrics"/>
+ familyNames = new java.util.HashSet();
+ familyNames.add("<xsl:value-of select="family-name"/>");
<xsl:if test="count(kerning) > 0">
kerning = new java.util.HashMap();
- Integer first, second;
+ Integer first;
+ Integer second;
Map pairs;
- <xsl:apply-templates select="kerning"/>
+<xsl:apply-templates select="kerning"/>
</xsl:if>
- familyNames = new java.util.HashSet();
- familyNames.add("<xsl:value-of select="family-name"/>");
}
public <xsl:value-of select="class-name"/>() {
@@ -158,7 +179,7 @@ public class <xsl:value-of select="class
return lastChar;
}
- public int getWidth(int i,int size) {
+ public int getWidth(int i, int size) {
return size * width[i];
}
@@ -172,9 +193,8 @@ public class <xsl:value-of select="class
System.arraycopy(width, getFirstChar(), arr, 0, getLastChar() - getFirstChar() + 1);
return arr;
}
-
<xsl:choose>
- <xsl:when test="count(kerning) > 0">
+<xsl:when test="count(kerning) > 0">
public boolean hasKerningInfo() {
return enableKerning;
}
@@ -182,8 +202,8 @@ public class <xsl:value-of select="class
public java.util.Map getKerningInfo() {
return kerning;
}
- </xsl:when>
- <xsl:otherwise>
+</xsl:when>
+<xsl:otherwise>
public boolean hasKerningInfo() {
return false;
}
@@ -191,9 +211,8 @@ public class <xsl:value-of select="class
public java.util.Map getKerningInfo() {
return java.util.Collections.EMPTY_MAP;
}
- </xsl:otherwise>
+</xsl:otherwise>
</xsl:choose>
-
public char mapChar(char c) {
notifyMapOperation();
char d = mapping.mapChar(c);
@@ -210,25 +229,24 @@ public class <xsl:value-of select="class
}
}
- </xsl:template>
+</xsl:template>
- <xsl:template match="char-metrics/char">
- <xsl:variable name="char-name" select="@name"/><xsl:variable name="char-num" select="$glyphs[@name = $char-name]/@codepoint"/><xsl:if test="$char-num!=''"> width[0x<xsl:value-of select="$char-num"/>] = <xsl:value-of select="@width"/>;
- boundingBoxes[0x<xsl:value-of select="$char-num"/>] = new Rectangle(<xsl:value-of select="@llx"/>,<xsl:value-of select="@lly"/>,<xsl:value-of select="@urx - @llx"/>,<xsl:value-of select="@ury - @lly"/>);</xsl:if></xsl:template>
+<xsl:template match="char-metrics/char"><xsl:variable name="char-name" select="@name"/><xsl:variable name="char-num" select="$glyphs[@name = $char-name]/@codepoint"/><xsl:if test="$char-num!=''"> width[0x<xsl:value-of select="$char-num"/>] = <xsl:value-of select="@width"/>;
+ boundingBoxes[0x<xsl:value-of select="$char-num"/>] = new Rectangle(<xsl:value-of select="@llx"/>, <xsl:value-of select="@lly"/>, <xsl:value-of select="@urx - @llx"/>, <xsl:value-of select="@ury - @lly"/>);</xsl:if></xsl:template>
- <xsl:template match="kerning">
+<xsl:template match="kerning">
first = new Integer(<xsl:value-of select="@kpx1"/>);
pairs = (Map)kerning.get(first);
if (pairs == null) {
pairs = new java.util.HashMap();
kerning.put(first, pairs);
}
- <xsl:apply-templates select="pair"/>
- </xsl:template>
+<xsl:apply-templates select="pair"/></xsl:template>
- <xsl:template match="pair">
+<xsl:template match="pair">
second = new Integer(<xsl:value-of select="@kpx2"/>);
pairs.put(second, new Integer(<xsl:value-of select="@kern"/>));
- </xsl:template>
+</xsl:template>
+
</xsl:stylesheet>
Modified: xmlgraphics/fop/branches/maven/fop-core/src/tools/resources/checkstyle/checkstyle.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-core/src/tools/resources/checkstyle/checkstyle.xml?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-core/src/tools/resources/checkstyle/checkstyle.xml (original)
+++ xmlgraphics/fop/branches/maven/fop-core/src/tools/resources/checkstyle/checkstyle.xml Sun Mar 13 01:32:45 2016
@@ -37,7 +37,7 @@
<!-- ===================================================================================================== -->
<module name="SuppressionCommentFilter">
- <property name="offCommentFormat" value="CSOFF\: (LineLength)"/>
+ <property name="offCommentFormat" value="CSOFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CSON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
Modified: xmlgraphics/fop/branches/maven/fop-events/pom.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-events/pom.xml?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-events/pom.xml (original)
+++ xmlgraphics/fop/branches/maven/fop-events/pom.xml Sun Mar 13 01:32:45 2016
@@ -95,9 +95,7 @@
</plugin>
<!-- code analysis - checkstyle -->
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
- <version>${checkstyle.plugin.version}</version>
<configuration>
<configLocation>${project.baseUri}../fop-core/src/tools/resources/checkstyle/checkstyle.xml</configLocation>
<headerLocation>${project.baseUri}../fop-core/src/tools/resources/checkstyle/LICENSE.txt</headerLocation>
Modified: xmlgraphics/fop/branches/maven/fop-sandbox/pom.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-sandbox/pom.xml?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-sandbox/pom.xml (original)
+++ xmlgraphics/fop/branches/maven/fop-sandbox/pom.xml Sun Mar 13 01:32:45 2016
@@ -90,9 +90,7 @@
</plugin>
<!-- code analysis - checkstyle -->
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
- <version>${checkstyle.plugin.version}</version>
<configuration>
<configLocation>${project.baseUri}../fop-core/src/tools/resources/checkstyle/checkstyle.xml</configLocation>
<headerLocation>${project.baseUri}../fop-core/src/tools/resources/checkstyle/LICENSE.txt</headerLocation>
@@ -110,7 +108,7 @@
<artifactId>findbugs-maven-plugin</artifactId>
<version>${findbugs.plugin.version}</version>
<configuration>
- <excludeFilterFile>../fop-core/src/tools/resources/findbugs/exclusions.xml</excludeFilterFile>
+ <excludeFilterFile>src/tools/resources/findbugs/exclusions.xml</excludeFilterFile>
<effort>Max</effort>
<threshold>Low</threshold>
</configuration>
Modified: xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/mif/MIFElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/mif/MIFElement.java?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/mif/MIFElement.java (original)
+++ xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/mif/MIFElement.java Sun Mar 13 01:32:45 2016
@@ -83,10 +83,11 @@ public class MIFElement {
return false;
}
- String indentStr = "";
+ StringBuffer sb = new StringBuffer();
for (int c = 0; c < indent; c++) {
- indentStr += " ";
+ sb.append(' ');
}
+ String indentStr = sb.toString();
if (!started) {
os.write((indentStr + "<" + name).getBytes());
if (valueElements != null) {
Modified: xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/mif/MIFFile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/mif/MIFFile.java?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/mif/MIFFile.java (original)
+++ xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/mif/MIFFile.java Sun Mar 13 01:32:45 2016
@@ -38,31 +38,31 @@ public class MIFFile extends MIFElement
/** pgfCatalog */
protected PGFElement pgfCatalog;
/** fontCatalog */
- protected MIFElement fontCatalog;
+ // protected MIFElement fontCatalog;
/** rulingCatalog */
protected RulingElement rulingCatalog;
/** tblCatalog */
- protected MIFElement tblCatalog;
+ // protected MIFElement tblCatalog;
/** views */
- protected MIFElement views;
+ // protected MIFElement views;
/** variableFormats */
- protected MIFElement variableFormats;
+ // protected MIFElement variableFormats;
/** xRefFormats */
- protected MIFElement xRefFormats;
+ // protected MIFElement xRefFormats;
/** document */
- protected MIFElement document;
+ // protected MIFElement document;
/** bookComponent */
- protected MIFElement bookComponent;
+ // protected MIFElement bookComponent;
/** initialAutoNums */
- protected MIFElement initialAutoNums;
+ // protected MIFElement initialAutoNums;
/** aFrames */
- protected MIFElement aFrames;
+ // protected MIFElement aFrames;
/** tbls */
- protected MIFElement tbls;
+ // protected MIFElement tbls;
/** pages */
protected List pages = new java.util.ArrayList();
/** textFlows */
- protected List textFlows;
+ // protected List textFlows;
/** default constructor */
Modified: xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/mif/MIFHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/mif/MIFHandler.java?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/mif/MIFHandler.java (original)
+++ xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/mif/MIFHandler.java Sun Mar 13 01:32:45 2016
@@ -53,7 +53,6 @@ import org.apache.fop.fo.flow.table.Tabl
import org.apache.fop.fo.flow.table.TableRow;
import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
-import org.apache.fop.fo.pagination.PageSequenceMaster;
import org.apache.fop.fo.pagination.SimplePageMaster;
import org.apache.fop.fo.pagination.StaticContent;
import org.apache.fop.fonts.FontSetup;
@@ -122,10 +121,7 @@ public class MIFHandler extends FOEventH
// setup the pages for this sequence
String name = pageSeq.getMasterReference();
SimplePageMaster spm = pageSeq.getRoot().getLayoutMasterSet().getSimplePageMaster(name);
- if (spm == null) {
- PageSequenceMaster psm
- = pageSeq.getRoot().getLayoutMasterSet().getPageSequenceMaster(name);
- } else {
+ if (spm != null) {
// create simple master with regions
MIFElement prop = new MIFElement("PageType");
prop.setValue("BodyPage");
Modified: xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/EmbeddedSVGImageHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/EmbeddedSVGImageHandler.java?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/EmbeddedSVGImageHandler.java (original)
+++ xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/EmbeddedSVGImageHandler.java Sun Mar 13 01:32:45 2016
@@ -42,7 +42,6 @@ import org.apache.xmlgraphics.image.load
import org.apache.xmlgraphics.image.loader.ImageFlavor;
import org.apache.xmlgraphics.image.loader.impl.ImageRawStream;
import org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM;
-import org.apache.xmlgraphics.util.QName;
import org.apache.fop.image.loader.batik.BatikImageFlavors;
import org.apache.fop.render.ImageHandler;
@@ -77,16 +76,21 @@ public class EmbeddedSVGImageHandler imp
};
}
+ /*
private void addAttribute(AttributesImpl atts, QName attribute, String value) {
atts.addAttribute(attribute.getNamespaceURI(),
attribute.getLocalName(), attribute.getQName(), CDATA, value);
}
+ */
/** {@inheritDoc} */
public void handleImage(RenderingContext context, Image image, final Rectangle pos)
throws IOException {
SVGRenderingContext svgContext = (SVGRenderingContext)context;
- ImageXMLDOM svg = (ImageXMLDOM)image;
+ if (!(image instanceof ImageXMLDOM)) {
+ throw new IllegalStateException();
+ }
+ ImageXMLDOM svg = (ImageXMLDOM) image;
ContentHandler handler = svgContext.getContentHandler();
AttributesImpl atts = new AttributesImpl();
atts.addAttribute("", "x", "x", CDATA, SVGUtil.formatMptToPt(pos.x));
Modified: xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/SVGDataUrlImageHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/SVGDataUrlImageHandler.java?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/SVGDataUrlImageHandler.java (original)
+++ xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/SVGDataUrlImageHandler.java Sun Mar 13 01:32:45 2016
@@ -75,6 +75,9 @@ public class SVGDataUrlImageHandler impl
public void handleImage(RenderingContext context, Image image, Rectangle pos)
throws IOException {
SVGRenderingContext svgContext = (SVGRenderingContext)context;
+ if (!(image instanceof ImageRawStream)) {
+ throw new IllegalStateException();
+ }
ImageRawStream raw = (ImageRawStream)image;
InputStream in = raw.createInputStream();
try {
Modified: xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/SVGDocumentHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/SVGDocumentHandler.java?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/SVGDocumentHandler.java (original)
+++ xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/SVGDocumentHandler.java Sun Mar 13 01:32:45 2016
@@ -75,6 +75,8 @@ public class SVGDocumentHandler extends
*/
public SVGDocumentHandler(IFContext context) {
super(context);
+ this.multiFileUtil = null;
+ this.reusedParts = null;
}
/** {@inheritDoc} */
@@ -192,10 +194,13 @@ public class SVGDocumentHandler extends
} catch (TransformerConfigurationException tce) {
throw new IFException("Error setting up a Transformer", tce);
} catch (TransformerException te) {
- if (te.getCause() instanceof SAXException) {
- throw (SAXException)te.getCause();
+ Throwable t = te.getCause();
+ if (t instanceof SAXException) {
+ throw (SAXException) t;
+ } else if (t instanceof Exception) {
+ throw new IFException("Error while serializing reused parts", (Exception) t);
} else {
- throw new IFException("Error while serializing reused parts", te);
+ throw new RuntimeException(t);
}
}
} catch (SAXException e) {
Modified: xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/SVGPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/SVGPainter.java?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/SVGPainter.java (original)
+++ xmlgraphics/fop/branches/maven/fop-sandbox/src/main/java/org/apache/fop/render/svg/SVGPainter.java Sun Mar 13 01:32:45 2016
@@ -278,9 +278,7 @@ public class SVGPainter extends Abstract
XMLUtil.addAttribute(atts, "y", SVGUtil.formatMptToPt(rect.y));
XMLUtil.addAttribute(atts, "width", SVGUtil.formatMptToPt(rect.width));
XMLUtil.addAttribute(atts, "height", SVGUtil.formatMptToPt(rect.height));
- if (fill != null) {
- XMLUtil.addAttribute(atts, "fill", toString(fill));
- }
+ XMLUtil.addAttribute(atts, "fill", toString(fill));
/* disabled
if (stroke != null) {
XMLUtil.addAttribute(atts, "stroke", toString(stroke));
Added: xmlgraphics/fop/branches/maven/fop-sandbox/src/tools/resources/findbugs/exclusions.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-sandbox/src/tools/resources/findbugs/exclusions.xml?rev=1734752&view=auto
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-sandbox/src/tools/resources/findbugs/exclusions.xml (added)
+++ xmlgraphics/fop/branches/maven/fop-sandbox/src/tools/resources/findbugs/exclusions.xml Sun Mar 13 01:32:45 2016
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FindBugsFilter>
+
+ <!--
+ !
+ ! This file is divided into two parts:
+ ! 1. APPROVED EXCLUSIONS
+ ! 2. TEMPORARY (UNAPPROVED) EXCLUSIONS
+ !
+ ! Approved exclusions come in two sub-types:
+ ! 1. general exclusion of a named bug pattern, meaning that all instances that matches the bug
+ ! pattern identifier are excluded;
+ ! 2. specific exclusions for a named bug pattern, meaning that all instance exclusions are
+ ! explicitly enumerated;
+ !
+ ! All specific exclusions must be accompanied inline (i.e., in the affected source code) by
+ ! a commented out annotation of the form:
+ !
+ ! // @SuppressFBWarnings("pattern identifier")
+ !
+ ! where pattern identifier is one of findbugs' named patterns. At an appropriate point in the
+ ! future, these commented out annotations will be uncommented and exclusion patterns removed
+ ! from this file.
+ !
+ ! Temporary (unapproved) exclusions are short-term work arounds that should be removed as
+ ! soon as possible by either (1) fixing (eliminating) cause of warning, or (2) conversion to
+ ! approved exclusion.
+ !
+ ! The organization of pattern matches employs the following levels (from top down):
+ ! 1. bug pattern
+ ! 2. or clause matching instances
+ ! 3. class name, if applies to class/interface
+ ! 4. and clause matching class/instance and single or or clause of multiple {method,field} members
+ !
+ ! for example,
+ !
+ ! <Match>
+ ! <Bug pattern="pattern identifier"/>
+ ! <Or>
+ ! <And>
+ ! <Class name="dotted class name"/>
+ ! <Member name="unqualified member name"/>
+ ! </And>
+ ! </Or>
+ ! </Match>
+ !
+ -->
+
+ <!-- START - APPROVED EXCLUSIONS -->
+ <!-- END - APPROVED EXCLUSIONS -->
+
+ <!-- START - TEMPORARY (UNAPPROVED) EXCLUSIONS -->
+ <Match>
+ <Bug pattern="DM_DEFAULT_ENCODING"/>
+ </Match>
+ <Match>
+ <Bug pattern="EI_EXPOSE_REP"/>
+ </Match>
+ <Match>
+ <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
+ </Match>
+ <!--
+ <Match>
+ <Bug pattern="BC_UNCONFIRMED_CAST"/>
+ </Match>
+ <Match>
+ <Bug pattern="DB_DUPLICATE_SWITCH_CLAUSES"/>
+ </Match>
+ <Match>
+ <Bug pattern="DLS_DEAD_LOCAL_STORE"/>
+ </Match>
+ <Match>
+ <Bug pattern="DM_CONVERT_CASE"/>
+ </Match>
+ <Match>
+ <Bug pattern="DM_FP_NUMBER_CTOR"/>
+ </Match>
+ <Match>
+ <Bug pattern="DM_NUMBER_CTOR"/>
+ </Match>
+ <Match>
+ <Bug pattern="EI_EXPOSE_REP2"/>
+ </Match>
+ <Match>
+ <Bug pattern="FE_FLOATING_POINT_EQUALITY"/>
+ </Match>
+ <Match>
+ <Bug pattern="MS_OOI_PKGPROTECT"/>
+ </Match>
+ <Match>
+ <Bug pattern="MS_PKGPROTECT"/>
+ </Match>
+ <Match>
+ <Bug pattern="NM_CONFUSING"/>
+ </Match>
+ <Match>
+ <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
+ </Match>
+ <Match>
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
+ </Match>
+ <Match>
+ <Bug pattern="REC_CATCH_EXCEPTION"/>
+ </Match>
+ <Match>
+ <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
+ </Match>
+ <Match>
+ <Bug pattern="SE_BAD_FIELD"/>
+ </Match>
+ <Match>
+ <Bug pattern="SIC_INNER_SHOULD_BE_STATIC"/>
+ </Match>
+ <Match>
+ <Bug pattern="UI_INHERITANCE_UNSAFE_GETRESOURCE"/>
+ </Match>
+ <Match>
+ <Bug pattern="URF_UNREAD_FIELD"/>
+ </Match>
+ <Match>
+ <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
+ </Match>
+ -->
+ <!-- END - TEMPORARY (UNAPPROVED) EXCLUSIONS -->
+
+</FindBugsFilter>
Propchange: xmlgraphics/fop/branches/maven/fop-sandbox/src/tools/resources/findbugs/exclusions.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: xmlgraphics/fop/branches/maven/fop-util/pom.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop-util/pom.xml?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop-util/pom.xml (original)
+++ xmlgraphics/fop/branches/maven/fop-util/pom.xml Sun Mar 13 01:32:45 2016
@@ -44,9 +44,7 @@
</plugin>
<!-- code analysis - checkstyle -->
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
- <version>${checkstyle.plugin.version}</version>
<configuration>
<configLocation>${project.baseUri}../fop-core/src/tools/resources/checkstyle/checkstyle.xml</configLocation>
<headerLocation>${project.baseUri}../fop-core/src/tools/resources/checkstyle/LICENSE.txt</headerLocation>
Modified: xmlgraphics/fop/branches/maven/fop/build.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/fop/build.xml?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/fop/build.xml (original)
+++ xmlgraphics/fop/branches/maven/fop/build.xml Sun Mar 13 01:32:45 2016
@@ -153,7 +153,7 @@ list of possible build targets.
<property name="Name" value="Apache FOP"/>
<property name="name" value="fop"/>
<property name="NAME" value="FOP"/>
- <property name="version" value="svn-trunk"/>
+ <property name="version" value="2.2.0-SNAPSHOT"/>
<property name="year" value="1999-2016"/>
<property name="javac.debug" value="on"/>
<property name="javac.optimize" value="off"/>
@@ -194,8 +194,8 @@ list of possible build targets.
<property name="src.java.dir" value="${src.dir}/main/java"/>
<property name="src.resources.dir" value="${src.dir}/main/resources"/>
<property name="src.sandbox.dir" value="${sandbox.src.dir}"/>
- <property name="src.viewer.resources.dir" value="${src.java.dir}/org/apache/fop/render/awt/viewer/resources"/>
- <property name="src.viewer.images.dir" value="${src.java.dir}/org/apache/fop/render/awt/viewer/images"/>
+ <property name="src.viewer.resources.dir" value="${core.src.dir}/main/resources/org/apache/fop/render/awt/viewer/resources"/>
+ <property name="src.viewer.images.dir" value="${core.src.dir}/main/resources/org/apache/fop/render/awt/viewer/images"/>
<property name="fo.examples.dir" value="${basedir}/examples/fo/basic"/>
<property name="fo.examples.userconfig" value="conf/fop.xconf"/>
<property name="fo.examples.include" value="**/*.fo"/>
@@ -523,7 +523,7 @@ list of possible build targets.
<attribute name="Implementation-Vendor" value="The Apache Software Foundation (http://xmlgraphics.apache.org/fop/)"/>
</section>
</manifest>
- <metainf dir="${basedir}" includes="../LICENSE,../NOTICE"/>
+ <metainf dir="${basedir}/.." includes="LICENSE,NOTICE"/>
<fileset dir="${build.classes.dir}">
<exclude name="**/tools/Event*.class"/>
<exclude name="**/tools/*.xsl"/>
@@ -543,7 +543,7 @@ list of possible build targets.
<manifest>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}, Target Java ${javac.target}])"/>
</manifest>
- <metainf dir="${basedir}" includes="../LICENSE,../NOTICE"/>
+ <metainf dir="${basedir}/.." includes="LICENSE,NOTICE"/>
</jar>
</target>
<target name="uptodate-jar-sources" depends="codegen">
@@ -673,7 +673,7 @@ list of possible build targets.
<attribute name="Implementation-Vendor" value="The Apache Software Foundation (http://xmlgraphics.apache.org/fop/)"/>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}, Target Java ${javac.target}])"/>
</manifest>
- <metainf dir="${basedir}" includes="../LICENSE,../NOTICE"/>
+ <metainf dir="${basedir}/.." includes="LICENSE,NOTICE"/>
</jar>
<!-- all-in-one transcoder jar -->
<property name="transcoder-deps" value="${build.dir}/transcoder-dependencies"/>
@@ -708,7 +708,7 @@ list of possible build targets.
<attribute name="Implementation-Vendor" value="The Apache Software Foundation (http://xmlgraphics.apache.org/fop/)"/>
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}, Target Java ${javac.target}])"/>
</manifest>
- <metainf dir="${basedir}" includes="../LICENSE,../NOTICE"/>
+ <metainf dir="${basedir}/.." includes="LICENSE,NOTICE"/>
</jar>
</target>
<target name="all" depends="package, servlet, transcoder-pkg, junit"/>
@@ -1074,7 +1074,7 @@ NOTE:
<attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}, Target Java ${javac.target}])"/>
</manifest>
<fileset dir="${build.javadocs.dir}"/>
- <metainf dir="${basedir}" includes="../LICENSE,../NOTICE"/>
+ <metainf dir="${basedir}/.." includes="LICENSE,NOTICE"/>
</jar>
</target>
<!-- =================================================================== -->
Modified: xmlgraphics/fop/branches/maven/pom.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/maven/pom.xml?rev=1734752&r1=1734751&r2=1734752&view=diff
==============================================================================
--- xmlgraphics/fop/branches/maven/pom.xml (original)
+++ xmlgraphics/fop/branches/maven/pom.xml Sun Mar 13 01:32:45 2016
@@ -13,13 +13,13 @@
<antrun.plugin.version>1.8</antrun.plugin.version>
<avalon.version>4.3.1</avalon.version>
<batik.version>1.9.0-SNAPSHOT</batik.version>
- <build.helper.plugin.version>1.10</build.helper.plugin.version>
- <checkstyle.plugin.version>2.15</checkstyle.plugin.version>
+ <build.helper.plugin.version>1.9.1</build.helper.plugin.version>
+ <checkstyle.plugin.version>2.14</checkstyle.plugin.version>
<commons.io.version>1.3.1</commons.io.version>
<commons.logging.version>1.0.4</commons.logging.version>
<compiler.plugin.version>3.1</compiler.plugin.version>
<exec.plugin.version>1.4.0</exec.plugin.version>
- <findbugs.plugin.version>3.0.1</findbugs.plugin.version>
+ <findbugs.plugin.version>2.5.5</findbugs.plugin.version>
<jar.plugin.version>2.6</jar.plugin.version>
<java.version>1.6</java.version>
<junit.version>4.11</junit.version>
@@ -62,6 +62,11 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>${checkstyle.plugin.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler.plugin.version}</version>
<configuration>
@@ -98,10 +103,23 @@
<repository>
<id>apache.snapshots.https</id>
<url>https://repository.apache.org/content/repositories/snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
+ <repository>
+ <id>apache.releases.https</id>
+ <url>https://repository.apache.org/content/repositories/releases</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
</repositories>
<distributionManagement>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org