package org.apache.fop.fo.flow;
+import java.util.Iterator;
+import java.util.Stack;
+
import org.xml.sax.Locator;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.complexscripts.bidi.DelimitedTextRange;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
public int getNameId() {
return FO_FOOTNOTE;
}
+
+ @Override
+ protected Stack<DelimitedTextRange> collectDelimitedTextRanges(Stack<DelimitedTextRange> ranges,
+ DelimitedTextRange currentRange) {
+ FootnoteBody body = getFootnoteBody();
+ if (body != null) {
+ ranges = body.collectDelimitedTextRanges(ranges);
+ }
+
+ Inline inline = getFootnoteCitation();
+ if (inline != null) {
+ ranges = inline.collectDelimitedTextRanges(ranges);
+ }
+
+ for (Iterator it = getChildNodes(); (it != null) && it.hasNext();) {
+ ranges = ((FONode) it.next()).collectDelimitedTextRanges(ranges);
+ }
+ return ranges;
+ }
}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that the footnote respects writing-mode="rl" specified on block-container.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="first" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="first">
+ <fo:flow flow-name="xsl-region-body">
+ <fo:block-container writing-mode="rl-tb">
+ <fo:block>
+ rightLeft
+ <fo:footnote>
+ <fo:inline>1</fo:inline>
+ <fo:footnote-body>
+ <fo:block>
+ <fo:inline>1</fo:inline>
+ footnoteRL
+ </fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ </fo:block-container>
+ <fo:block-container writing-mode="lr-tb">
+ <fo:block>
+ leftRight
+ <fo:footnote>
+ <fo:inline>2</fo:inline>
+ <fo:footnote-body>
+ <fo:block>
+ <fo:inline>2</fo:inline>
+ footnoteLR
+ </fo:block>
+ </fo:footnote-body>
+ </fo:footnote>
+ </fo:block>
+ </fo:block-container>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="1 rightLeft" xpath="//block[1]"/>
+ <eval expected="footnoteRL 1" xpath="//footnote/block[1]"/>
+ <eval expected="leftRight 2" xpath="//block[2]"/>
+ <eval expected="2 footnoteLR" xpath="//footnote/block[2]"/>
+ </checks>
+</testcase>