aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2014-04-28 19:22:32 +0000
committerVincent Hennebert <vhennebert@apache.org>2014-04-28 19:22:32 +0000
commitc3ac99e58b7c66fe8fe23b32930f93d66cb59581 (patch)
tree8260ddf75125f602c3ff0e981f4fca72a941e84b
parentb37680209557f4dece0b25f5a4bf1594ab72194e (diff)
downloadxmlgraphics-fop-c3ac99e58b7c66fe8fe23b32930f93d66cb59581.tar.gz
xmlgraphics-fop-c3ac99e58b7c66fe8fe23b32930f93d66cb59581.zip
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
-rw-r--r--src/java/org/apache/fop/fo/Constants.java4
-rw-r--r--src/java/org/apache/fop/fo/FOPropertyMapping.java5
-rw-r--r--src/java/org/apache/fop/fo/flow/MultiSwitch.java6
-rw-r--r--src/java/org/apache/fop/layoutmgr/MultiSwitchLayoutManager.java3
-rw-r--r--test/layoutengine/standard-testcases/multi-switch_select-first-fitting.xml (renamed from test/layoutengine/standard-testcases/multi-switch_best-fit.xml)2
-rw-r--r--test/layoutengine/standard-testcases/multi-switch_select-first-fitting_forced-page-break.xml (renamed from test/layoutengine/standard-testcases/multi-switch_best-fit_forced_page_break.xml)6
-rw-r--r--test/layoutengine/standard-testcases/multi-switch_select-first-fitting_middle-page.xml (renamed from test/layoutengine/standard-testcases/multi-switch_best-fit_middle-page.xml)2
-rw-r--r--test/layoutengine/standard-testcases/multi-switch_select-first-fitting_multiple-variants.xml (renamed from test/layoutengine/standard-testcases/multi-switch_best-fit_multiple-variants.xml)6
-rw-r--r--test/layoutengine/standard-testcases/multi-switch_select-first-fitting_padding.xml (renamed from test/layoutengine/standard-testcases/multi-switch_best-fit_padding.xml)6
-rw-r--r--test/layoutengine/standard-testcases/multi-switch_select-first-fitting_several-multi-switch.xml (renamed from test/layoutengine/standard-testcases/multi-switch_best-fit_multiple_dynamic_contents.xml)14
10 files changed, 29 insertions, 25 deletions
diff --git a/src/java/org/apache/fop/fo/Constants.java b/src/java/org/apache/fop/fo/Constants.java
index 3fae008b5..2d53d1d46 100644
--- a/src/java/org/apache/fop/fo/Constants.java
+++ b/src/java/org/apache/fop/fo/Constants.java
@@ -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;
}
diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java
index 26ead3bd0..16f7ab457 100644
--- a/src/java/org/apache/fop/fo/FOPropertyMapping.java
+++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java
@@ -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-*
diff --git a/src/java/org/apache/fop/fo/flow/MultiSwitch.java b/src/java/org/apache/fop/fo/flow/MultiSwitch.java
index f681f1695..1248d1ca4 100644
--- a/src/java/org/apache/fop/fo/flow/MultiSwitch.java
+++ b/src/java/org/apache/fop/fo/flow/MultiSwitch.java
@@ -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;
}
diff --git a/src/java/org/apache/fop/layoutmgr/MultiSwitchLayoutManager.java b/src/java/org/apache/fop/layoutmgr/MultiSwitchLayoutManager.java
index 2aff34e14..1310fb888 100644
--- a/src/java/org/apache/fop/layoutmgr/MultiSwitchLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/MultiSwitchLayoutManager.java
@@ -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();
diff --git a/test/layoutengine/standard-testcases/multi-switch_best-fit.xml b/test/layoutengine/standard-testcases/multi-switch_select-first-fitting.xml
index d41fa1c13..2c8aa44ca 100644
--- a/test/layoutengine/standard-testcases/multi-switch_best-fit.xml
+++ b/test/layoutengine/standard-testcases/multi-switch_select-first-fitting.xml
@@ -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>
diff --git a/test/layoutengine/standard-testcases/multi-switch_best-fit_forced_page_break.xml b/test/layoutengine/standard-testcases/multi-switch_select-first-fitting_forced-page-break.xml
index 6b47dcf32..dd9ed615c 100644
--- a/test/layoutengine/standard-testcases/multi-switch_best-fit_forced_page_break.xml
+++ b/test/layoutengine/standard-testcases/multi-switch_select-first-fitting_forced-page-break.xml
@@ -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>
diff --git a/test/layoutengine/standard-testcases/multi-switch_best-fit_middle-page.xml b/test/layoutengine/standard-testcases/multi-switch_select-first-fitting_middle-page.xml
index 6b9342b85..dabc10e52 100644
--- a/test/layoutengine/standard-testcases/multi-switch_best-fit_middle-page.xml
+++ b/test/layoutengine/standard-testcases/multi-switch_select-first-fitting_middle-page.xml
@@ -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>
diff --git a/test/layoutengine/standard-testcases/multi-switch_best-fit_multiple-variants.xml b/test/layoutengine/standard-testcases/multi-switch_select-first-fitting_multiple-variants.xml
index 11b3cfe7d..8ab004151 100644
--- a/test/layoutengine/standard-testcases/multi-switch_best-fit_multiple-variants.xml
+++ b/test/layoutengine/standard-testcases/multi-switch_select-first-fitting_multiple-variants.xml
@@ -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>
diff --git a/test/layoutengine/standard-testcases/multi-switch_best-fit_padding.xml b/test/layoutengine/standard-testcases/multi-switch_select-first-fitting_padding.xml
index 5f11ce57d..1ec9e2975 100644
--- a/test/layoutengine/standard-testcases/multi-switch_best-fit_padding.xml
+++ b/test/layoutengine/standard-testcases/multi-switch_select-first-fitting_padding.xml
@@ -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>
diff --git a/test/layoutengine/standard-testcases/multi-switch_best-fit_multiple_dynamic_contents.xml b/test/layoutengine/standard-testcases/multi-switch_select-first-fitting_several-multi-switch.xml
index df4c59f74..969a4786b 100644
--- a/test/layoutengine/standard-testcases/multi-switch_best-fit_multiple_dynamic_contents.xml
+++ b/test/layoutengine/standard-testcases/multi-switch_select-first-fitting_several-multi-switch.xml
@@ -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>