Переглянути джерело

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
tags/fop-1_1rc1old
Glenn Adams 12 роки тому
джерело
коміт
a93ce40b9a

+ 34
- 12
src/java/org/apache/fop/fo/FONode.java Переглянути файл

@@ -404,6 +404,27 @@ public abstract class FONode implements Cloneable {
return new OneCharIterator(CharUtilities.CODE_EOT);
}

/**
* 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.
@@ -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);
}

/**

+ 1
- 2
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;
}

+ 0
- 1
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

+ 3
- 0
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>

Завантаження…
Відмінити
Зберегти