aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop
diff options
context:
space:
mode:
authorGlenn Adams <gadams@apache.org>2013-10-31 19:44:25 +0000
committerGlenn Adams <gadams@apache.org>2013-10-31 19:44:25 +0000
commitadd7ec865295a648dcaadb464292a872a140aaf8 (patch)
tree1b268f64e66e9925787a53bb906c771ac23d87d4 /src/java/org/apache/fop
parent2d97c4c3db687e0a914cbe627dda16969a104578 (diff)
downloadxmlgraphics-fop-add7ec865295a648dcaadb464292a872a140aaf8.tar.gz
xmlgraphics-fop-add7ec865295a648dcaadb464292a872a140aaf8.zip
FOP-2310: Fix misplaced table cell border in WM RTL context.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1537600 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r--src/java/org/apache/fop/fo/FObj.java17
-rw-r--r--src/java/org/apache/fop/fo/flow/BlockContainer.java18
-rw-r--r--src/java/org/apache/fop/fo/flow/InlineContainer.java16
-rw-r--r--src/java/org/apache/fop/fo/flow/table/Table.java13
-rw-r--r--src/java/org/apache/fop/fo/pagination/PageSequence.java18
-rw-r--r--src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java2
-rw-r--r--src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java2
-rw-r--r--src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java1
-rw-r--r--src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java2
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java1
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java1
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java19
-rw-r--r--src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java7
-rw-r--r--src/java/org/apache/fop/render/rtf/RTFPlaceHolderHelper.java6
-rw-r--r--src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java4
-rw-r--r--src/java/org/apache/fop/traits/WritingMode.java5
-rw-r--r--src/java/org/apache/fop/traits/WritingModeTraits.java21
-rw-r--r--src/java/org/apache/fop/traits/WritingModeTraitsGetter.java5
-rw-r--r--src/java/org/apache/fop/traits/WritingModeTraitsSetter.java5
19 files changed, 136 insertions, 27 deletions
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java
index 92dc9fd73..b6f2ec83e 100644
--- a/src/java/org/apache/fop/fo/FObj.java
+++ b/src/java/org/apache/fop/fo/FObj.java
@@ -611,7 +611,7 @@ public abstract class FObj extends FONode implements Constants {
if (bidiLevel >= 0) {
if ((this.bidiLevel < 0) || (bidiLevel < this.bidiLevel)) {
this.bidiLevel = bidiLevel;
- if (parent != null) {
+ if ((parent != null) && !isBidiPropagationBoundary()) {
FObj foParent = (FObj) parent;
int parentBidiLevel = foParent.getBidiLevel();
if ((parentBidiLevel < 0) || (bidiLevel < parentBidiLevel)) {
@@ -646,10 +646,25 @@ public abstract class FObj extends FONode implements Constants {
return level;
}
}
+ if (isBidiInheritanceBoundary()) {
+ break;
+ }
}
return -1;
}
+ protected boolean isBidiBoundary(boolean propagate) {
+ return false;
+ }
+
+ private boolean isBidiInheritanceBoundary() {
+ return isBidiBoundary(false);
+ }
+
+ private boolean isBidiPropagationBoundary() {
+ return isBidiBoundary(true);
+ }
+
/**
* Add a new extension attachment to this FObj.
* (see org.apache.fop.fo.FONode for details)
diff --git a/src/java/org/apache/fop/fo/flow/BlockContainer.java b/src/java/org/apache/fop/fo/flow/BlockContainer.java
index b8616c1ce..b250a117c 100644
--- a/src/java/org/apache/fop/fo/flow/BlockContainer.java
+++ b/src/java/org/apache/fop/fo/flow/BlockContainer.java
@@ -98,7 +98,8 @@ public class BlockContainer extends FObj implements BreakPropertySet, WritingMod
referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
span = pList.get(PR_SPAN).getEnum();
writingModeTraits = new WritingModeTraits(
- WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum()));
+ WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum()),
+ pList.getExplicit(PR_WRITING_MODE) != null);
disableColumnBalancing = pList.get(PR_X_DISABLE_COLUMN_BALANCING).getEnum();
}
@@ -280,6 +281,14 @@ public class BlockContainer extends FObj implements BreakPropertySet, WritingMod
return writingModeTraits.getWritingMode();
}
+ /**
+ * Obtain writing mode explicit indicator.
+ * @return the writing mode explicit indicator
+ */
+ public boolean getExplicitWritingMode() {
+ return writingModeTraits.getExplicitWritingMode();
+ }
+
/** {@inheritDoc} */
public String getLocalName() {
return "block-container";
@@ -292,5 +301,10 @@ public class BlockContainer extends FObj implements BreakPropertySet, WritingMod
public int getNameId() {
return FO_BLOCK_CONTAINER;
}
-}
+ @Override
+ protected boolean isBidiBoundary(boolean propagate) {
+ return getExplicitWritingMode();
+ }
+
+}
diff --git a/src/java/org/apache/fop/fo/flow/InlineContainer.java b/src/java/org/apache/fop/fo/flow/InlineContainer.java
index 748eb593a..cf970c325 100644
--- a/src/java/org/apache/fop/fo/flow/InlineContainer.java
+++ b/src/java/org/apache/fop/fo/flow/InlineContainer.java
@@ -96,7 +96,8 @@ public class InlineContainer extends FObj {
overflow = pList.get(PR_OVERFLOW).getEnum();
referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
writingModeTraits = new WritingModeTraits(
- WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum()));
+ WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum()),
+ pList.getExplicit(PR_WRITING_MODE) != null);
}
/**
@@ -238,6 +239,14 @@ public class InlineContainer extends FObj {
return writingModeTraits.getWritingMode();
}
+ /**
+ * Obtain writing mode explicit indicator.
+ * @return the writing mode explicit indicator
+ */
+ public boolean getExplicitWritingMode() {
+ return writingModeTraits.getExplicitWritingMode();
+ }
+
/** {@inheritDoc} */
public String getLocalName() {
return "inline-container";
@@ -256,4 +265,9 @@ public class InlineContainer extends FObj {
return false;
}
+ @Override
+ protected boolean isBidiBoundary(boolean propagate) {
+ return getExplicitWritingMode();
+ }
+
}
diff --git a/src/java/org/apache/fop/fo/flow/table/Table.java b/src/java/org/apache/fop/fo/flow/table/Table.java
index 983954e79..e1252e45e 100644
--- a/src/java/org/apache/fop/fo/flow/table/Table.java
+++ b/src/java/org/apache/fop/fo/flow/table/Table.java
@@ -139,7 +139,8 @@ public class Table extends TableFObj implements ColumnNumberManagerHolder, Break
tableOmitFooterAtBreak = pList.get(PR_TABLE_OMIT_FOOTER_AT_BREAK).getEnum();
tableOmitHeaderAtBreak = pList.get(PR_TABLE_OMIT_HEADER_AT_BREAK).getEnum();
writingModeTraits = new WritingModeTraits(
- WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum()));
+ WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum()),
+ pList.getExplicit(PR_WRITING_MODE) != null);
//Bind extension properties
widowContentLimit = pList.get(PR_X_WIDOW_CONTENT_LIMIT).getLength();
@@ -554,6 +555,11 @@ public class Table extends TableFObj implements ColumnNumberManagerHolder, Break
return writingModeTraits.getWritingMode();
}
+ /** {@inheritDoc} */
+ public boolean getExplicitWritingMode() {
+ return writingModeTraits.getExplicitWritingMode();
+ }
+
/** @return the "fox:widow-content-limit" extension FO trait */
public Length getWidowContentLimit() {
return widowContentLimit;
@@ -620,4 +626,9 @@ public class Table extends TableFObj implements ColumnNumberManagerHolder, Break
return ranges;
}
+ @Override
+ protected boolean isBidiBoundary(boolean propagate) {
+ return getExplicitWritingMode();
+ }
+
}
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java
index 368b69f90..ba874d31f 100644
--- a/src/java/org/apache/fop/fo/pagination/PageSequence.java
+++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java
@@ -96,7 +96,8 @@ public class PageSequence extends AbstractPageSequence implements WritingModeTra
masterReference = pList.get(PR_MASTER_REFERENCE).getString();
referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
writingModeTraits = new WritingModeTraits(
- WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum()));
+ WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum()),
+ pList.getExplicit(PR_WRITING_MODE) != null);
if (masterReference == null || masterReference.equals("")) {
missingPropertyError("master-reference");
}
@@ -403,6 +404,16 @@ public class PageSequence extends AbstractPageSequence implements WritingModeTra
}
}
+ /**
+ * {@inheritDoc}
+ */
+ public boolean getExplicitWritingMode() {
+ if (writingModeTraits != null) {
+ return writingModeTraits.getExplicitWritingMode();
+ } else {
+ return false;
+ }
+ }
@Override
protected Stack collectDelimitedTextRanges(Stack ranges, DelimitedTextRange currentRange) {
@@ -423,6 +434,11 @@ public class PageSequence extends AbstractPageSequence implements WritingModeTra
return ranges;
}
+ @Override
+ protected boolean isBidiBoundary(boolean propagate) {
+ return true;
+ }
+
/**
* Releases a page-sequence's children after the page-sequence has been fully processed.
*/
diff --git a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
index 0fb738aea..55b17e953 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
@@ -360,7 +360,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager implements Co
curBlockArea.setIPD(super.getContentAreaIPD());
- curBlockArea.setBidiLevel(getBlockFO().getBidiLevel());
+ curBlockArea.setBidiLevel(getBlockFO().getBidiLevelRecursive());
TraitSetter.addBreaks(curBlockArea,
getBlockFO().getBreakBefore(), getBlockFO().getBreakAfter());
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
index 61d8a891d..5d89b3440 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
@@ -242,6 +242,8 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
int contentIPD = referenceIPD - getIPIndents();
curBlockArea.setIPD(contentIPD);
+ curBlockArea.setBidiLevel(getListBlockFO().getBidiLevel());
+
setCurrentArea(curBlockArea);
}
return curBlockArea;
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java
index f017da381..b16c9dfc4 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java
@@ -181,6 +181,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager imp
//TODO: Check - itemIPD never set?
curBlockArea.setIPD(itemIPD);
//curBlockArea.setHeight();
+ curBlockArea.setBidiLevel(getPartFO().getBidiLevel());
TraitSetter.setProducerID(curBlockArea, getPartFO().getId());
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
index 083e4ee1b..84dba03ee 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
@@ -615,6 +615,8 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager implements
int contentIPD = referenceIPD - getIPIndents();
curBlockArea.setIPD(contentIPD);
+ curBlockArea.setBidiLevel(fo.getBidiLevel());
+
setCurrentArea(curBlockArea);
}
return curBlockArea;
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java
index 0582a0283..aaa896ce3 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java
@@ -184,6 +184,7 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager {
Area parentArea = parentLayoutManager.getParentArea(curBlockArea);
int referenceIPD = parentArea.getIPD();
curBlockArea.setIPD(referenceIPD);
+ curBlockArea.setBidiLevel(getTableAndCaptionFO().getBidiLevel());
// Get reference IPD from parentArea
setCurrentArea(curBlockArea); // ??? for generic operations
}
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java
index 66f7ad9f2..8823c0fae 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java
@@ -180,6 +180,7 @@ public class TableCaptionLayoutManager extends BlockStackingLayoutManager {
Area parentArea = parentLayoutManager.getParentArea(curBlockArea);
int referenceIPD = parentArea.getIPD();
curBlockArea.setIPD(referenceIPD);
+ curBlockArea.setBidiLevel(getTableCaptionFO().getBidiLevel());
// Get reference IPD from parentArea
setCurrentArea(curBlockArea); // ??? for generic operations
}
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
index c8f2cea85..af8e071d5 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
@@ -441,12 +441,14 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
Block[][] blocks = new Block[getTableCell().getNumberRowsSpanned()][getTableCell()
.getNumberColumnsSpanned()];
GridUnit[] gridUnits = (GridUnit[]) primaryGridUnit.getRows().get(startRow);
+ int level = getTableCell().getBidiLevelRecursive();
for (int x = 0; x < getTableCell().getNumberColumnsSpanned(); x++) {
GridUnit gu = gridUnits[x];
BorderInfo border = gu.getBorderBefore(borderBeforeWhich);
int borderWidth = border.getRetainedWidth() / 2;
if (borderWidth > 0) {
- addBorder(blocks, startRow, x, Trait.BORDER_BEFORE, border, firstOnPage);
+ addBorder(blocks, startRow, x, Trait.BORDER_BEFORE, border,
+ firstOnPage, level);
adjustYOffset(blocks[startRow][x], -borderWidth);
adjustBPD(blocks[startRow][x], -borderWidth);
}
@@ -457,7 +459,8 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
BorderInfo border = gu.getBorderAfter(borderAfterWhich);
int borderWidth = border.getRetainedWidth() / 2;
if (borderWidth > 0) {
- addBorder(blocks, endRow, x, Trait.BORDER_AFTER, border, lastOnPage);
+ addBorder(blocks, endRow, x, Trait.BORDER_AFTER, border,
+ lastOnPage, level);
adjustBPD(blocks[endRow][x], -borderWidth);
}
}
@@ -466,7 +469,8 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
BorderInfo border = gridUnits[0].getBorderStart();
int borderWidth = border.getRetainedWidth() / 2;
if (borderWidth > 0) {
- addBorder(blocks, y, 0, Trait.BORDER_START, border, inFirstColumn);
+ addBorder(blocks, y, 0, Trait.BORDER_START, border,
+ inFirstColumn, level);
adjustXOffset(blocks[y][0], borderWidth);
adjustIPD(blocks[y][0], -borderWidth);
}
@@ -474,7 +478,7 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
borderWidth = border.getRetainedWidth() / 2;
if (borderWidth > 0) {
addBorder(blocks, y, gridUnits.length - 1, Trait.BORDER_END, border,
- inLastColumn);
+ inLastColumn, level);
adjustIPD(blocks[y][gridUnits.length - 1], -borderWidth);
}
}
@@ -511,10 +515,12 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
if (getTableCell().getDisplayAlign() == EN_CENTER) {
Block space = new Block();
space.setBPD((cellBPD - usedBPD) / 2);
+ space.setBidiLevel(getTableCell().getBidiLevelRecursive());
curBlockArea.addBlock(space);
} else if (getTableCell().getDisplayAlign() == EN_AFTER) {
Block space = new Block();
space.setBPD(cellBPD - usedBPD);
+ space.setBidiLevel(getTableCell().getBidiLevelRecursive());
curBlockArea.addBlock(space);
}
}
@@ -590,11 +596,12 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
}
private void addBorder(Block[][] blocks, int i, int j, Integer side, BorderInfo border,
- boolean outer) {
+ boolean outer, int level) {
if (blocks[i][j] == null) {
blocks[i][j] = new Block();
blocks[i][j].addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
blocks[i][j].setPositioning(Block.ABSOLUTE);
+ blocks[i][j].setBidiLevel(level);
}
blocks[i][j].addTrait(side, BorderProps.makeRectangular(border.getStyle(),
border.getRetainedWidth(), border.getColor(),
@@ -629,6 +636,7 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
block.setBPD(bpd);
block.setXOffset(xoffset + startIndent - paddingStart);
block.setYOffset(yoffset + borderBeforeWidth);
+ block.setBidiLevel(getTableCell().getBidiLevelRecursive());
return block;
}
@@ -654,6 +662,7 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
curBlockArea.setXOffset(xoffset + startIndent);
curBlockArea.setYOffset(yoffset);
curBlockArea.setIPD(cellIPD);
+ curBlockArea.setBidiLevel(getTableCell().getBidiLevelRecursive());
/*Area parentArea =*/ parentLayoutManager.getParentArea(curBlockArea);
// Get reference IPD from parentArea
diff --git a/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java b/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java
index 4d34b8be4..3cc7a1017 100644
--- a/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java
+++ b/src/java/org/apache/fop/render/pdf/PDFStructureTreeBuilder.java
@@ -358,7 +358,12 @@ class PDFStructureTreeBuilder implements StructureTreeEventHandler {
}
public StructureTreeElement startNode(String name, Attributes attributes, StructureTreeElement parent) {
- PDFStructElem parentElem = parent == null ? ancestors.getFirst() : (PDFStructElem) parent;
+ PDFStructElem parentElem;
+ if ((parent != null) && (parent instanceof PDFStructElem)) {
+ parentElem = (PDFStructElem) parent;
+ } else {
+ parentElem = ancestors.getFirst();
+ }
PDFStructElem structElem = createStructureElement(name, parentElem, attributes,
pdfFactory, eventBroadcaster);
ancestors.addFirst(structElem);
diff --git a/src/java/org/apache/fop/render/rtf/RTFPlaceHolderHelper.java b/src/java/org/apache/fop/render/rtf/RTFPlaceHolderHelper.java
index c31c68db1..e3278ad95 100644
--- a/src/java/org/apache/fop/render/rtf/RTFPlaceHolderHelper.java
+++ b/src/java/org/apache/fop/render/rtf/RTFPlaceHolderHelper.java
@@ -65,8 +65,10 @@ public class RTFPlaceHolderHelper {
builderContext.pushContainer(newRow);
builderContext.getTableContext().selectFirstColumn();
}
- } catch (Exception ex) {
- throw new RtfException(ex.getMessage());
+ } catch (org.apache.fop.apps.FOPException e) {
+ throw new RtfException(e.getMessage());
+ } catch (java.io.IOException e) {
+ throw new RtfException(e.getMessage());
}
}
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java
index 6dcae5412..4b3f8bd4a 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java
@@ -196,8 +196,8 @@ public class BuilderContext {
} else {
/* This should never happen unless a placeholder is not catered for
* in the RTFHandler.endContainer method. */
- LOG.warn("Unhandled RTF structure tag mismatch detected between " +
- aClass.getSimpleName() + " and "+object.getClass().getSimpleName());
+ LOG.warn("Unhandled RTF structure tag mismatch detected between "
+ + aClass.getSimpleName() + " and " + object.getClass().getSimpleName());
}
}
diff --git a/src/java/org/apache/fop/traits/WritingMode.java b/src/java/org/apache/fop/traits/WritingMode.java
index 8718118ef..f8c784941 100644
--- a/src/java/org/apache/fop/traits/WritingMode.java
+++ b/src/java/org/apache/fop/traits/WritingMode.java
@@ -54,8 +54,9 @@ public final class WritingMode extends TraitEnum {
* Assign writing mode traits from this trait to the specified
* writing mode traits setter.
* @param wms a writing mode traits setter
+ * @param explicit true if writing mode property explicitly specified
*/
- public void assignWritingModeTraits(WritingModeTraitsSetter wms) {
+ public void assignWritingModeTraits(WritingModeTraitsSetter wms, boolean explicit) {
Direction inlineProgressionDirection;
Direction blockProgressionDirection;
Direction columnProgressionDirection;
@@ -97,7 +98,7 @@ public final class WritingMode extends TraitEnum {
wms.setColumnProgressionDirection(columnProgressionDirection);
wms.setRowProgressionDirection(rowProgressionDirection);
wms.setShiftDirection(shiftDirection);
- wms.setWritingMode(this);
+ wms.setWritingMode(this, explicit);
}
/**
diff --git a/src/java/org/apache/fop/traits/WritingModeTraits.java b/src/java/org/apache/fop/traits/WritingModeTraits.java
index 279326afa..fbd150ca9 100644
--- a/src/java/org/apache/fop/traits/WritingModeTraits.java
+++ b/src/java/org/apache/fop/traits/WritingModeTraits.java
@@ -31,20 +31,21 @@ public class WritingModeTraits implements WritingModeTraitsSetter {
private Direction rowProgressionDirection;
private Direction shiftDirection;
private WritingMode writingMode;
+ private boolean explicit;
/**
* Default writing mode traits constructor.
*/
public WritingModeTraits() {
- this (WritingMode.LR_TB);
+ this (WritingMode.LR_TB, false);
}
/**
* Construct writing mode traits using the specified writing mode.
* @param writingMode a writing mode traits object
*/
- public WritingModeTraits(WritingMode writingMode) {
- assignWritingModeTraits(writingMode);
+ public WritingModeTraits(WritingMode writingMode, boolean explicit) {
+ assignWritingModeTraits(writingMode, explicit);
}
/**
@@ -125,17 +126,25 @@ public class WritingModeTraits implements WritingModeTraitsSetter {
}
/**
+ * @return the "explicit-writing-mode" trait.
+ */
+ public boolean getExplicitWritingMode() {
+ return explicit;
+ }
+
+ /**
* @param writingMode the "writing-mode" trait.
*/
- public void setWritingMode(WritingMode writingMode) {
+ public void setWritingMode(WritingMode writingMode, boolean explicit) {
this.writingMode = writingMode;
+ this.explicit = explicit;
}
/**
* @param writingMode the "writing-mode" trait.
*/
- public void assignWritingModeTraits(WritingMode writingMode) {
- writingMode.assignWritingModeTraits(this);
+ public void assignWritingModeTraits(WritingMode writingMode, boolean explicit) {
+ writingMode.assignWritingModeTraits(this, explicit);
}
/**
diff --git a/src/java/org/apache/fop/traits/WritingModeTraitsGetter.java b/src/java/org/apache/fop/traits/WritingModeTraitsGetter.java
index a67e437c9..7340b3e8c 100644
--- a/src/java/org/apache/fop/traits/WritingModeTraitsGetter.java
+++ b/src/java/org/apache/fop/traits/WritingModeTraitsGetter.java
@@ -55,4 +55,9 @@ public interface WritingModeTraitsGetter {
*/
WritingMode getWritingMode();
+ /**
+ * @return the "explicit-writing-mode" trait
+ */
+ boolean getExplicitWritingMode();
+
}
diff --git a/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java b/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java
index 6dcf0fb12..b70f73954 100644
--- a/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java
+++ b/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java
@@ -58,13 +58,14 @@ public interface WritingModeTraitsSetter extends WritingModeTraitsGetter {
* Set value of writing-mode trait.
* @param writingMode the "writing-mode" trait
*/
- void setWritingMode(WritingMode writingMode);
+ void setWritingMode(WritingMode writingMode, boolean explicit);
/**
* Collectivelly assign values to all writing mode traits based upon a specific
* writing mode.
* @param writingMode the "writing-mode" trait
+ * @param explicit true if writing mode explicitly specified
*/
- void assignWritingModeTraits(WritingMode writingMode);
+ void assignWritingModeTraits(WritingMode writingMode, boolean explicit);
}