Browse Source

Renamed value of auto-toggle property to select-first-fitting

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_WhitespaceManagement@1590754 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-2_0
Vincent Hennebert 10 years ago
parent
commit
c3ac99e58b

+ 3
- 1
src/java/org/apache/fop/fo/Constants.java View File

@@ -1263,6 +1263,8 @@ public interface Constants {
int EN_TB_LR = 205; // for top-to-bottom, left-to-right writing mode
/** Enumeration constant -- for fo:retrieve-table-marker */
int EN_FIRST_INCLUDING_CARRYOVER = 206;
/** Enumeration constant -- for auto-toggle */
int EN_SELECT_FIRST_FITTING = 207;
/** Number of enumeration constants defined */
int ENUM_COUNT = 206;
int ENUM_COUNT = 207;
}

+ 3
- 2
src/java/org/apache/fop/fo/FOPropertyMapping.java View File

@@ -2618,9 +2618,10 @@ public final class FOPropertyMapping implements Constants {
addPropertyMaker("fox:alt-text", m);

// fox:auto-toggle, used only in fo:multi-switch
m = new StringProperty.Maker(PR_X_AUTO_TOGGLE);
m = new EnumProperty.Maker(PR_X_AUTO_TOGGLE);
m.setInherited(false);
m.setDefault("");
m.addEnum("select-first-fitting", getEnumProperty(EN_SELECT_FIRST_FITTING, "SELECT_FIRST_FITTING"));
m.setDefault("select-first-fitting");
addPropertyMaker("fox:auto-toggle", m);

// fox:border-*-radius-*

+ 3
- 3
src/java/org/apache/fop/fo/flow/MultiSwitch.java View File

@@ -38,7 +38,7 @@ public class MultiSwitch extends FObj {
// private CommonAccessibility commonAccessibility;
// End of property values

private String autoToggle;
private int autoToggle;

/**
* Base constructor
@@ -53,7 +53,7 @@ public class MultiSwitch extends FObj {
@Override
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
autoToggle = pList.get(PR_X_AUTO_TOGGLE).getString();
autoToggle = pList.get(PR_X_AUTO_TOGGLE).getEnum();
// autoRestore = pList.get(PR_AUTO_RESTORE);
}

@@ -95,7 +95,7 @@ public class MultiSwitch extends FObj {
return FO_MULTI_SWITCH;
}

public String getAutoToggle() {
public int getAutoToggle() {
return autoToggle;
}


+ 2
- 1
src/java/org/apache/fop/layoutmgr/MultiSwitchLayoutManager.java View File

@@ -21,6 +21,7 @@ import java.util.LinkedList;
import java.util.List;

import org.apache.fop.area.Area;
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.flow.MultiSwitch;

@@ -118,7 +119,7 @@ public class MultiSwitchLayoutManager extends BlockStackingLayoutManager {
public MultiSwitchLayoutManager(FObj node) {
super(node);
MultiSwitch multiSwitchNode = (MultiSwitch) node;
if (multiSwitchNode.getAutoToggle().equals("best-fit")) {
if (multiSwitchNode.getAutoToggle() == Constants.EN_SELECT_FIRST_FITTING) {
knuthGen = new WhitespaceManagement();
} else {
knuthGen = new DefaultKnuthListGenerator();

test/layoutengine/standard-testcases/multi-switch_best-fit.xml → test/layoutengine/standard-testcases/multi-switch_select-first-fitting.xml View File

@@ -31,7 +31,7 @@
</fo:layout-master-set>
<fo:page-sequence master-reference="page">
<fo:flow flow-name="xsl-region-body">
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>First variant</fo:block>
</fo:multi-case>

test/layoutengine/standard-testcases/multi-switch_best-fit_forced_page_break.xml → test/layoutengine/standard-testcases/multi-switch_select-first-fitting_forced-page-break.xml View File

@@ -33,20 +33,20 @@
<fo:flow flow-name="xsl-region-body">
<fo:block break-after="page">
Block 1 page 1
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>MS1 Variant 1</fo:block>
</fo:multi-case>
</fo:multi-switch>
</fo:block>
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>MS2 Variant 1</fo:block>
</fo:multi-case>
</fo:multi-switch>
<fo:block break-before="page">
Block 2 page 3
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>MS3 Variant 1</fo:block>
</fo:multi-case>

test/layoutengine/standard-testcases/multi-switch_best-fit_middle-page.xml → test/layoutengine/standard-testcases/multi-switch_select-first-fitting_middle-page.xml View File

@@ -32,7 +32,7 @@
<fo:page-sequence master-reference="page">
<fo:flow flow-name="xsl-region-body" font-size="8pt" line-height="10pt">
<fo:block>Before the multi-switch</fo:block>
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>First variant</fo:block>
</fo:multi-case>

test/layoutengine/standard-testcases/multi-switch_best-fit_multiple-variants.xml → test/layoutengine/standard-testcases/multi-switch_select-first-fitting_multiple-variants.xml View File

@@ -41,7 +41,7 @@
<fo:block>Page 1 line 3</fo:block>
<fo:block font-size="16pt" line-height="20pt">Filler</fo:block>
<fo:block>Before the multi-switch</fo:block>
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>Variant 1 line 1</fo:block>
<fo:block>Variant 1 line 2</fo:block>
@@ -64,7 +64,7 @@
<fo:block>Page 2 line 1</fo:block>
<fo:block font-size="16pt" line-height="20pt">Filler</fo:block>
<fo:block>Before the multi-switch</fo:block>
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>Variant 1 line 1</fo:block>
<fo:block>Variant 1 line 2</fo:block>
@@ -88,7 +88,7 @@
<fo:block>Page 2 line 2</fo:block>
<fo:block font-size="16pt" line-height="20pt">Filler</fo:block>
<fo:block>Before the multi-switch</fo:block>
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>Variant 1 line 1</fo:block>
<fo:block>Variant 1 line 2</fo:block>

test/layoutengine/standard-testcases/multi-switch_best-fit_padding.xml → test/layoutengine/standard-testcases/multi-switch_select-first-fitting_padding.xml View File

@@ -31,17 +31,17 @@
</fo:layout-master-set>
<fo:page-sequence master-reference="page">
<fo:flow flow-name="xsl-region-body">
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block padding="10pt">MS1 Variant 1</fo:block>
</fo:multi-case>
</fo:multi-switch>
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block padding-before="10pt" padding-after="10pt">MS2 Variant 1</fo:block>
</fo:multi-case>
</fo:multi-switch>
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>
<fo:inline padding-start="10pt" padding-end="10pt">MS3 Variant 1</fo:inline>

test/layoutengine/standard-testcases/multi-switch_best-fit_multiple_dynamic_contents.xml → test/layoutengine/standard-testcases/multi-switch_select-first-fitting_several-multi-switch.xml View File

@@ -32,17 +32,17 @@
</fo:layout-master-set>
<fo:page-sequence master-reference="page">
<fo:flow flow-name="xsl-region-body">
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>MS 1 Variant 1</fo:block>
</fo:multi-case>
</fo:multi-switch>
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>MS 2 Variant 1</fo:block>
</fo:multi-case>
</fo:multi-switch>
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>MS 3 Variant 1</fo:block>
</fo:multi-case>
@@ -52,17 +52,17 @@

<fo:page-sequence master-reference="page">
<fo:flow flow-name="xsl-region-body">
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block line-height="70pt">MS 1 Variant 1</fo:block>
</fo:multi-case>
</fo:multi-switch>
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>MS 2 Variant 1</fo:block>
</fo:multi-case>
</fo:multi-switch>
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block line-height="50pt">MS 3 Variant 1</fo:block>
</fo:multi-case>
@@ -70,7 +70,7 @@
<fo:block>MS 3 Variant 2</fo:block>
</fo:multi-case>
</fo:multi-switch>
<fo:multi-switch fox:auto-toggle="best-fit">
<fo:multi-switch fox:auto-toggle="select-first-fitting">
<fo:multi-case>
<fo:block>MS 4 Variant 1</fo:block>
</fo:multi-case>

Loading…
Cancel
Save