aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Adams <gadams@apache.org>2012-04-07 20:23:56 +0000
committerGlenn Adams <gadams@apache.org>2012-04-07 20:23:56 +0000
commita93ce40b9a41760b54fde89f3e8b31d924c866f6 (patch)
tree3a3e05a1ec987ce3b6839edbf8c4249b4c580471
parente1322d63fc41b169f6eb2d4b8dbe858145883818 (diff)
downloadxmlgraphics-fop-a93ce40b9a41760b54fde89f3e8b31d924c866f6.tar.gz
xmlgraphics-fop-a93ce40b9a41760b54fde89f3e8b31d924c866f6.zip
Bugzilla #49763: Incorrect message when encountering a block in an inline in a footnote
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1310853 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/fo/FONode.java46
-rw-r--r--src/java/org/apache/fop/fo/flow/Inline.java3
-rw-r--r--src/java/org/apache/fop/render/ps/NativeTextHandler.java1
-rw-r--r--status.xml3
4 files changed, 38 insertions, 15 deletions
diff --git a/src/java/org/apache/fop/fo/FONode.java b/src/java/org/apache/fop/fo/FONode.java
index 99d133f16..c66259f11 100644
--- a/src/java/org/apache/fop/fo/FONode.java
+++ b/src/java/org/apache/fop/fo/FONode.java
@@ -405,6 +405,27 @@ public abstract class FONode implements Cloneable {
}
/**
+ * Helper function to obtain standard usage prefix for FOP related
+ * namespace URIs.
+ * @param namespaceURI URI of node found
+ * (e.g., "http://www.w3.org/1999/XSL/Format")
+ * @return the prefix or null if none
+ */
+ public static String getNodePrefix(String namespaceURI) {
+ if (namespaceURI.equals(FOElementMapping.URI)) {
+ return "fo";
+ } else if (namespaceURI.equals(ExtensionElementMapping.URI)) {
+ return "fox";
+ } else if (namespaceURI.equals(InternalElementMapping.URI)) {
+ return "foi";
+ } else if (namespaceURI.equals(SVGElementMapping.URI)) {
+ return "svg";
+ } else {
+ return null;
+ }
+ }
+
+ /**
* Helper function to standardize the names of all namespace URI - local
* name pairs in text messages.
* For readability, using fo:, fox:, svg:, for those namespaces even
@@ -416,14 +437,9 @@ public abstract class FONode implements Cloneable {
* with the unabbreviated URI otherwise.
*/
public static String getNodeString(String namespaceURI, String localName) {
- if (namespaceURI.equals(FOElementMapping.URI)) {
- return "fo:" + localName;
- } else if (namespaceURI.equals(ExtensionElementMapping.URI)) {
- return "fox:" + localName;
- } else if (namespaceURI.equals(InternalElementMapping.URI)) {
- return "foi:" + localName; // used FOP internally for accessibility
- } else if (namespaceURI.equals(SVGElementMapping.URI)) {
- return "svg:" + localName;
+ String prefix = getNodePrefix ( namespaceURI );
+ if ( prefix != null ) {
+ return prefix + ":" + localName;
} else {
return "(Namespace URI: \"" + namespaceURI + "\", "
+ "Local Name: \"" + localName + "\")";
@@ -527,16 +543,22 @@ public abstract class FONode implements Cloneable {
*
* @param loc org.xml.sax.Locator object of the error (*not* parent node)
* @param parentName the name of the parent element
- * @param nsURI namespace URI of incoming invalid node
- * @param lName local name (i.e., no prefix) of incoming node
+ * @param nsURI namespace URI of incoming offending node
+ * @param lName local name (i.e., no prefix) of incoming offending node
* @param ruleViolated name of the rule violated (used to lookup a resource in a bundle)
* @throws ValidationException the validation error provoked by the method call
*/
protected void invalidChildError(Locator loc, String parentName, String nsURI, String lName,
String ruleViolated)
throws ValidationException {
- getFOValidationEventProducer().invalidChild(this, parentName,
- new QName(nsURI, lName), ruleViolated, loc);
+ String prefix = getNodePrefix ( nsURI );
+ QName qn; // qualified name of offending node
+ if ( prefix != null ) {
+ qn = new QName(nsURI, prefix, lName);
+ } else {
+ qn = new QName(nsURI, lName);
+ }
+ getFOValidationEventProducer().invalidChild(this, parentName, qn, ruleViolated, loc);
}
/**
diff --git a/src/java/org/apache/fop/fo/flow/Inline.java b/src/java/org/apache/fop/fo/flow/Inline.java
index 3a9583580..941850cdd 100644
--- a/src/java/org/apache/fop/fo/flow/Inline.java
+++ b/src/java/org/apache/fop/fo/flow/Inline.java
@@ -118,8 +118,7 @@ public class Inline extends InlineLevel {
invalidChildError(loc, nsURI, localName);
} else if (!canHaveBlockLevelChildren && isBlockItem(nsURI, localName)
&& !isNeutralItem(nsURI, localName)) {
- invalidChildError(loc, getParent().getName(), nsURI, getName(),
- "rule.inlineContent");
+ invalidChildError(loc, getName(), nsURI, localName, "rule.inlineContent");
} else {
blockOrInlineItemFound = true;
}
diff --git a/src/java/org/apache/fop/render/ps/NativeTextHandler.java b/src/java/org/apache/fop/render/ps/NativeTextHandler.java
index a31d828b1..5a39842fb 100644
--- a/src/java/org/apache/fop/render/ps/NativeTextHandler.java
+++ b/src/java/org/apache/fop/render/ps/NativeTextHandler.java
@@ -31,7 +31,6 @@ import org.apache.xmlgraphics.ps.PSGenerator;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.fonts.FontSetup;
-import org.apache.fop.fonts.FontTriplet;
/**
* Specialized TextHandler implementation that the PSGraphics2D class delegates to to paint text
diff --git a/status.xml b/status.xml
index a00e11f59..140016156 100644
--- a/status.xml
+++ b/status.xml
@@ -62,6 +62,9 @@
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="FOP Trunk" date="TBD">
+ <action context="Code" dev="GA" type="fix" fixes-bug="49763" due-to="Adrian Buza">
+ Incorrect message when encountering a block in an inline in a footnote.
+ </action>
<action context="Code" dev="GA" type="fix" fixes-bug="47380" due-to="Georg Datterl">
Specified rule-thickness applies only when leader-pattern is rule, otherwise should use default thickness.
</action>