From 416bcd114ebfae2c8dec56baf8429ec16e9c2bdc Mon Sep 17 00:00:00 2001 From: Matthias Reischenbacher Date: Wed, 24 May 2017 21:33:32 +0000 Subject: [PATCH] FOP-2707: fix wrong bidi level, when creating new spans git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1796102 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/area/MainReference.java | 5 ++ ...body_column-count_span_writing-mode_rl.xml | 47 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 fop/test/layoutengine/standard-testcases/region-body_column-count_span_writing-mode_rl.xml diff --git a/fop-core/src/main/java/org/apache/fop/area/MainReference.java b/fop-core/src/main/java/org/apache/fop/area/MainReference.java index 9778db87f..c3d553429 100644 --- a/fop-core/src/main/java/org/apache/fop/area/MainReference.java +++ b/fop-core/src/main/java/org/apache/fop/area/MainReference.java @@ -37,6 +37,7 @@ public class MainReference extends Area { private BodyRegion parent; private List spanAreas = new java.util.ArrayList(); private boolean isEmpty = true; + private WritingModeTraitsGetter wmtg; /** * Constructor @@ -62,6 +63,9 @@ public class MainReference extends Area { Span newSpan = new Span(((spanAll) ? 1 : getColumnCount()), getColumnGap(), parent.getContentIPD()); spanAreas.add(newSpan); + if (wmtg != null) { + newSpan.setWritingModeTraits(wmtg); + } return getCurrentSpan(); } @@ -127,6 +131,7 @@ public class MainReference extends Area { * @param wmtg a WM traits getter */ public void setWritingModeTraits(WritingModeTraitsGetter wmtg) { + this.wmtg = wmtg; for (Span s : getSpans()) { s.setWritingModeTraits(wmtg); } diff --git a/fop/test/layoutengine/standard-testcases/region-body_column-count_span_writing-mode_rl.xml b/fop/test/layoutengine/standard-testcases/region-body_column-count_span_writing-mode_rl.xml new file mode 100644 index 000000000..4b9f0cda7 --- /dev/null +++ b/fop/test/layoutengine/standard-testcases/region-body_column-count_span_writing-mode_rl.xml @@ -0,0 +1,47 @@ + + + + + +

+ This test checks multi-column documents with right-to-left writing mode. Normal multi-column document breaking over more than one page. +

+
+ + + + + + + + + + Spanned Block + Col1 + Col2 + Col3 + + + + + + + + +
-- 2.39.5