}
/** {@inheritDoc} */
+ @Override
protected void characters(char[] data, int start, int length,
PropertyList pList,
Locator locator) throws FOPException {
}
/** {@inheritDoc} */
+ @Override
protected void endOfNode() throws FOPException {
super.endOfNode();
}
/** {@inheritDoc} */
+ @Override
protected void addChildNode(FONode child) throws FOPException {
flushText();
}
/** {@inheritDoc} */
+ @Override
+ public void removeChild(FONode child) {
+ super.removeChild(child);
+ if (child == this.currentTextNode) {
+ // reset to following sibling
+ this.currentTextNode = child.siblings != null ? child.siblings[1] : null;
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override
public void finalizeNode() throws FOPException {
flushText();
*
* @return iterator for this object
*/
+ @Override
public CharIterator charIterator() {
return new RecursiveCharIterator(this);
}
--- /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 NullPointerException due to white-space removal.\r
+ See also: https://issues.apache.org/bugzilla/show_bug.cgi?id=50988\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 master-name="even" page-height="210mm" page-width="148mm">\r
+ <fo:region-body margin="20mm"/>\r
+ </fo:simple-page-master>\r
+ </fo:layout-master-set>\r
+ <fo:page-sequence master-reference="even">\r
+ <fo:flow flow-name="xsl-region-body">\r
+ <fo:block><fo:character character=" " hyphenate="false"/></fo:block>\r
+ <fo:block><fo:character character=" " hyphenate="false"/><fo:character character="A" hyphenate="false"/></fo:block>\r
+ </fo:flow>\r
+ </fo:page-sequence>\r
+ </fo:root>\r
+ </fo>\r
+ <!-- Default checks only; should just not throw a NPE -->\r
+ <checks />\r
+</testcase>
\ No newline at end of file