View | Details | Raw Unified | Return to bug 43042
Collapse All | Expand All

(-)D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java (-2 / +2 lines)
Lines 39-46 Link Here
39
    protected void initialize() {
39
    protected void initialize() {
40
        if (foObjs == null) {
40
        if (foObjs == null) {
41
            foObjs = new java.util.HashMap();
41
            foObjs = new java.util.HashMap();
42
            foObjs.put("ps-setup-code", new PSSetupCodeMaker());
42
            foObjs.put(PSSetupCodeElement.ELEMENT, new PSSetupCodeMaker());
43
            foObjs.put("ps-page-setup-code", new PSPageSetupCodeMaker());
43
            foObjs.put(PSPageSetupCodeElement.ELEMENT, new PSPageSetupCodeMaker());
44
        }
44
        }
45
    }
45
    }
46
46
(-)D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java (-1 / +3 lines)
Lines 29-34 Link Here
29
 */
29
 */
30
public class PSPageSetupCodeElement extends AbstractPSExtensionObject {
30
public class PSPageSetupCodeElement extends AbstractPSExtensionObject {
31
31
32
    protected static final String ELEMENT = "ps-page-setup-code";
33
    
32
    /**
34
    /**
33
     * Main constructor
35
     * Main constructor
34
     * @param parent parent FO node
36
     * @param parent parent FO node
Lines 47-53 Link Here
47
    
49
    
48
    /** {@inheritDoc} */
50
    /** {@inheritDoc} */
49
    public String getLocalName() {
51
    public String getLocalName() {
50
        return "ps-page-setup-code";
52
        return ELEMENT;
51
    }
53
    }
52
54
53
}
55
}
(-)D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java (-1 / +3 lines)
Lines 29-34 Link Here
29
 */
29
 */
30
public class PSSetupCodeElement extends AbstractPSExtensionObject {
30
public class PSSetupCodeElement extends AbstractPSExtensionObject {
31
31
32
    protected static final String ELEMENT = "ps-setup-code";
33
    
32
    /**
34
    /**
33
     * Main constructor
35
     * Main constructor
34
     * @param parent parent FO node
36
     * @param parent parent FO node
Lines 47-53 Link Here
47
    
49
    
48
    /** {@inheritDoc} */
50
    /** {@inheritDoc} */
49
    public String getLocalName() {
51
    public String getLocalName() {
50
        return "ps-setup-code";
52
        return ELEMENT;
51
    }
53
    }
52
    
54
    
53
}
55
}
(-)D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java (-2 / +2 lines)
Lines 49-55 Link Here
49
        if (PSSetupCode.CATEGORY.equals(uri)) {
49
        if (PSSetupCode.CATEGORY.equals(uri)) {
50
            lastAttributes = attributes;
50
            lastAttributes = attributes;
51
            handled = true; 
51
            handled = true; 
52
            if ("ps-setup-code".equals(localName)) {
52
            if (PSSetupCodeElement.ELEMENT.equals(localName)) {
53
                //handled in endElement
53
                //handled in endElement
54
            } else {
54
            } else {
55
                handled = false;
55
                handled = false;
Lines 69-75 Link Here
69
    /** {@inheritDoc} */
69
    /** {@inheritDoc} */
70
    public void endElement(String uri, String localName, String qName) throws SAXException {
70
    public void endElement(String uri, String localName, String qName) throws SAXException {
71
        if (PSSetupCode.CATEGORY.equals(uri)) {
71
        if (PSSetupCode.CATEGORY.equals(uri)) {
72
            if ("ps-setup-code".equals(localName)) {
72
            if (PSSetupCodeElement.ELEMENT.equals(localName)) {
73
                String name = lastAttributes.getValue("name");
73
                String name = lastAttributes.getValue("name");
74
                this.returnedObject = new PSSetupCode(name, content.toString());
74
                this.returnedObject = new PSSetupCode(name, content.toString());
75
            }
75
            }
(-)D:/eclipse/test/fop_trunk/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java (-2 / +1 lines)
Lines 92-98 Link Here
92
    }
92
    }
93
93
94
    private static final String ATT_NAME = "name";
94
    private static final String ATT_NAME = "name";
95
    private static final String ELEMENT = "ps-setup-code";
96
    
95
    
97
    /** {@inheritDoc} */
96
    /** {@inheritDoc} */
98
    public void toSAX(ContentHandler handler) throws SAXException {
97
    public void toSAX(ContentHandler handler) throws SAXException {
Lines 100-106 Link Here
100
        if (name != null && name.length() > 0) {
99
        if (name != null && name.length() > 0) {
101
            atts.addAttribute(null, ATT_NAME, ATT_NAME, "CDATA", name);
100
            atts.addAttribute(null, ATT_NAME, ATT_NAME, "CDATA", name);
102
        }
101
        }
103
        handler.startElement(CATEGORY, ELEMENT, ELEMENT, atts);
102
        handler.startElement(CATEGORY, PSSetupCodeElement.ELEMENT, PSSetupCodeElement.ELEMENT, atts);
104
        if (content != null && content.length() > 0) {
103
        if (content != null && content.length() > 0) {
105
            char[] chars = content.toCharArray();
104
            char[] chars = content.toCharArray();
106
            handler.characters(chars, 0, chars.length);
105
            handler.characters(chars, 0, chars.length);

Return to bug 43042