import org.apache.fop.area.AreaTreeHandler;
import org.apache.fop.fo.ElementMapping.Maker;
import org.apache.fop.fo.extensions.ExtensionElementMapping;
+import org.apache.fop.fo.extensions.pdf.PDFExtensionElementMapping;
import org.apache.fop.fo.pagination.Root;
import org.apache.fop.util.ContentHandlerFactory;
import org.apache.fop.util.ContentHandlerFactory.ObjectBuiltListener;
}
} else { // check that incoming node is valid for currentFObj
if (currentFObj.getNamespaceURI().equals(FOElementMapping.URI)
- || currentFObj.getNamespaceURI().equals(ExtensionElementMapping.URI)) {
+ || currentFObj.getNamespaceURI().equals(ExtensionElementMapping.URI)
+ || currentFObj.getNamespaceURI().equals(PDFExtensionElementMapping.URI)) {
currentFObj.validateChildNode(locator, namespaceURI, localName);
}
}
rootFObj.setBuilderContext(builderContext);
rootFObj.setFOEventHandler(foEventHandler);
}
+ builderContext.foIndex++;
propertyList = foNode.createPropertyList(
currentPropertyList, foEventHandler);
foNode.processNode(localName, getEffectiveLocator(),
builderContext.switchMarkerContext(true);
}
}
+ if (foNode.getNameId() == Constants.FO_PAGE_SEQUENCE) {
+ builderContext.getXMLWhiteSpaceHandler().reset();
+ }
} catch (IllegalArgumentException e) {
throw new SAXException(e);
}
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="AD" type="fix" fixes-bug="47710">
+ White-space handling in markers with inline-content throws a NullPointerException
+ in some cases.
+ </action>
<action context="Renderers" dev="CB" type="fix" fixes-bug="47694">
- Dithered Background Shading can produce illegal AFP if objects are very small
+ Dithered Background Shading can produce illegal AFP if objects are very small
</action>
<action context="Renderers" dev="CB" type="add">
AFP Output: Added support for IMM Extension on fo:simple-page-master.
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+-->\r
+<!-- $Id$ -->\r
+<testcase>\r
+ <info>\r
+ <p>\r
+ This test checks for a potential NPE after white-space handling\r
+ for retrieved markers with only inline content.\r
+ </p>\r
+ </info>\r
+ <fo>\r
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">\r
+ <fo:layout-master-set>\r
+ <fo:simple-page-master margin-right="6mm" margin-left="7mm" margin-bottom="4mm" margin-top="5mm" page-width="210mm" page-height="297mm" master-name="letterPageFront">\r
+ <fo:region-body margin-right="59mm" margin-left="8mm" margin-top="53mm" margin-bottom="57mm" region-name="letterPageBody"/>\r
+ <fo:region-after precedence="false" extent="52mm" region-name="letterPageFooter"/>\r
+ <fo:region-end precedence="true" extent="49mm" region-name="letterPageSidebar"/>\r
+ </fo:simple-page-master>\r
+ </fo:layout-master-set>\r
+ <fo:page-sequence initial-page-number="1" page-break-before="right" master-reference="letterPageFront">\r
+ <fo:flow flow-name="letterPageBody">\r
+ <fo:block>page 1</fo:block>\r
+ </fo:flow>\r
+ </fo:page-sequence>\r
+ <fo:page-sequence master-reference="letterPageFront">\r
+ <fo:static-content flow-name="letterPageFooter">\r
+ <fo:block text-align="right" margin-right="1cm" margin-left="8mm">\r
+ <fo:retrieve-marker retrieve-position="last-ending-within-page" retrieve-boundary="page-sequence" retrieve-class-name="statementFooterMarker"/>\r
+ </fo:block>\r
+ </fo:static-content>\r
+ <fo:flow flow-name="letterPageBody">\r
+ <fo:block>\r
+ <fo:block font="bold 16pt Arial">\r
+ <fo:block>\r
+ <fo:marker marker-class-name="statementFooterMarker">\r
+ <fo:inline font-family="HelveticaNeue-LightCond" font-size="11pt" line-height="13pt" text-align="right">Test Marker</fo:inline>\r
+ </fo:marker>\r
+ </fo:block>\r
+ </fo:block>\r
+ <fo:block break-before="page">\r
+ <fo:block>\r
+ <fo:marker marker-class-name="statementFooterMarker"/>\r
+ </fo:block>\r
+ </fo:block>\r
+ </fo:block>\r
+ <fo:block id="TH_LastPage"/>\r
+ </fo:flow>\r
+ </fo:page-sequence>\r
+ <fo:page-sequence master-reference="letterPageFront">\r
+ <fo:static-content flow-name="letterPageSidebar">\r
+ <fo:block-container height="284mm">\r
+ <fo:block> </fo:block>\r
+ </fo:block-container>\r
+ </fo:static-content>\r
+ <fo:flow break-before="odd-page" flow-name="letterPageBody">\r
+ <fo:block>last page</fo:block>\r
+ </fo:flow>\r
+ </fo:page-sequence>\r
+ </fo:root>\r
+ </fo>\r
+ <checks /><!-- none except the default; simply check for non-occurrence of NPE -->\r
+</testcase>\r