From ddaf8b2ad8b8241641d9406805319709e17b2f0d Mon Sep 17 00:00:00 2001 From: Kelly Campbell Date: Fri, 23 Feb 2001 06:00:29 +0000 Subject: [PATCH] Patch for list-block to support body-start and label-end PR: 682 Obtained from: Submitted by: Peter S. Housel Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194086 13f79535-47bb-0310-9956-ffa450edef68 --- docs/bugtests/list-mountjoy.fo | 52 +- docs/bugtests/list-nested-breaks.fo | 80 +-- docs/bugtests/list-nested.fo | 62 +- docs/examples/fo/extensive.fo | 36 +- docs/examples/fo/leader.fo | 8 +- docs/examples/fo/list.fo | 624 +++++++++--------- docs/examples/fo/pdfoutline.fo | 308 ++++----- docs/examples/fo/readme.fo | 308 ++++----- docs/examples/fo/textdeko.fo | 36 +- docs/examples/svg/Document.xsl | 20 +- docs/xml-docs/fop/limitations.xml | 12 - docs/xml-docs/xml2pdf.xsl | 8 +- .../datatypes/LinearCombinationLength.java | 89 +++ src/org/apache/fop/fo/FONode.java | 51 -- .../apache/fop/fo/expr/BodyStartFunction.java | 79 +++ .../apache/fop/fo/expr/LabelEndFunction.java | 96 +++ src/org/apache/fop/fo/expr/Numeric.java | 1 + .../apache/fop/fo/expr/PropertyParser.java | 4 +- src/org/apache/fop/fo/flow/Block.java | 13 - .../apache/fop/fo/flow/ExternalGraphic.java | 11 - src/org/apache/fop/fo/flow/InlineGraphic.java | 11 - .../fop/fo/flow/InstreamForeignObject.java | 11 - src/org/apache/fop/fo/flow/ListBlock.java | 23 +- src/org/apache/fop/fo/flow/ListItem.java | 313 +++++---- src/org/apache/fop/fo/flow/ListItemBody.java | 5 +- src/org/apache/fop/fo/flow/ListItemLabel.java | 5 - 26 files changed, 1194 insertions(+), 1072 deletions(-) create mode 100644 src/org/apache/fop/datatypes/LinearCombinationLength.java create mode 100644 src/org/apache/fop/fo/expr/BodyStartFunction.java create mode 100644 src/org/apache/fop/fo/expr/LabelEndFunction.java diff --git a/docs/bugtests/list-mountjoy.fo b/docs/bugtests/list-mountjoy.fo index a050c0e10..6ee1fa5ae 100644 --- a/docs/bugtests/list-mountjoy.fo +++ b/docs/bugtests/list-mountjoy.fo @@ -53,11 +53,11 @@ - + - + attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or @@ -67,11 +67,11 @@ - + - + entities (other than amp, lt, gt, apos, quot), if references to those entities appear in the document, or @@ -81,11 +81,11 @@ - + - + attributes with values subject to normalization, where the attribute appears in the document with a value which will @@ -95,11 +95,11 @@ - + - + change as a result of normalization, or @@ -109,11 +109,11 @@ - + - + element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white spaceadsfadsfsssssssssssssss thin any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white spaceadsfadsfssssssssthin any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white spaceadsfadsfssssssssthin any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white spaceadsfadsfssssssssthin any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white spaceadsfadsfssssssss @@ -126,18 +126,18 @@ - - + + - + - + attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or @@ -146,11 +146,11 @@ - + - + attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or @@ -159,11 +159,11 @@ - + - + attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or @@ -172,11 +172,11 @@ - + - + attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or @@ -190,11 +190,11 @@ - + - + element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. elementtance of those types. @@ -203,11 +203,11 @@ - + - + element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. elementtance of those types. @@ -216,11 +216,11 @@ - + - + element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. element types with element content, if white space occurs directly within any instance of those types. elementtance of those types. diff --git a/docs/bugtests/list-nested-breaks.fo b/docs/bugtests/list-nested-breaks.fo index 92826fecc..1e7742d89 100644 --- a/docs/bugtests/list-nested-breaks.fo +++ b/docs/bugtests/list-nested-breaks.fo @@ -9,8 +9,8 @@ margin-bottom="2cm" margin-left="2.5cm" margin-right="2.5cm"> - + @@ -53,11 +53,11 @@ - - · + + · - + attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or @@ -67,11 +67,11 @@ - - · + + · - + entities (other than amp, lt, gt, apos, quot), if references to those entities appear in the document, or @@ -81,11 +81,11 @@ - - · + + · - + attributes with values subject to normalization, where the attribute appears in the document with a value which will @@ -95,11 +95,11 @@ - - · + + · - + change as a result of normalization, or @@ -109,75 +109,75 @@ - - · + + · - + element types with element content, if white space occurs directly within any instance of those types. - - · + + · - + This is the first item of a nested list - - · + + · - + This is the second item of a nested list - - · + + · - + This is the third item of a nested list. The next list item's block will have a page break-after - - · + + · - + This is the fourth item of a nested list - - · + + · - + This is the fifth item of a nested list - - · + + · - + This is the sixth item of a nested list. The next list-item-body's block contains a page break-before. - - · + + · - + This is the seventh item of a nested list - - · + + · - + This is the eigth item of a nested list diff --git a/docs/bugtests/list-nested.fo b/docs/bugtests/list-nested.fo index 746c50b25..c7f5c7057 100644 --- a/docs/bugtests/list-nested.fo +++ b/docs/bugtests/list-nested.fo @@ -9,8 +9,8 @@ margin-bottom="2cm" margin-left="2.5cm" margin-right="2.5cm"> - + @@ -53,11 +53,11 @@ - - · + + · - + attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or @@ -67,11 +67,11 @@ - - · + + · - + entities (other than amp, lt, gt, apos, quot), if references to those entities appear in the document, or @@ -81,11 +81,11 @@ - - · + + · - + attributes with values subject to normalization, where the attribute appears in the document with a value which will @@ -95,11 +95,11 @@ - - · + + · - + change as a result of normalization, or @@ -109,51 +109,51 @@ - - · + + · - + element types with element content, if white space occurs directly within any instance of those types. - - · + + · - + This is the first item of a nested list - - · + + · - + This is the second item of a nested list - - · + + · - + This is the third item of a nested list - - · + + · - + This is the fourth item of a nested list - - · + + · - + This is the fifth item of a nested list diff --git a/docs/examples/fo/extensive.fo b/docs/examples/fo/extensive.fo index 16b004b46..8116cbec1 100644 --- a/docs/examples/fo/extensive.fo +++ b/docs/examples/fo/extensive.fo @@ -35,46 +35,46 @@ Text beforeA block with 100pt start-indent within a block with 50pt start-intentText after - -This is a multiple line block that extends over more than one line. There should be appropriate line breaks. + +This is a multiple line block that extends over more than one line. There should be appropriate line breaks. - -This is a multiple line block that extends over more than one line. There should be appropriate line breaks.This is a multiple line block that extends over more than one line. There should be appropriate line breaks.This is a multiple line block that extends over more than one line. There should be appropriate line breaks. + +This is a multiple line block that extends over more than one line. There should be appropriate line breaks.This is a multiple line block that extends over more than one line. There should be appropriate line breaks.This is a multiple line block that extends over more than one line. There should be appropriate line breaks. - -This is a multiple line block that extends over more than one line. There should be appropriate line breaks. The list-block has a start-indent of 50pt and a text-align of justified. + +This is a multiple line block that extends over more than one line. There should be appropriate line breaks. The list-block has a start-indent of 50pt and a text-align of justified. - -This is a multiple line block that extends over more than one line. There should be appropriate line breaks.This is a second multiple line block that extends over more than one line. There should be appropriate line breaks.This is a third multiple line block that extends over more than one line. There should be appropriate line breaks. + +This is a multiple line block that extends over more than one line. There should be appropriate line breaks.This is a second multiple line block that extends over more than one line. There should be appropriate line breaks.This is a third multiple line block that extends over more than one line. There should be appropriate line breaks. - -This is a multiple line block that extends over more than one line. There should be appropriate line breaks.This is a multiple line block with start-indent 100pt that extends over more than one line. There should be appropriate line breaks.This is a multiple line block that extends over more than one line. There should be appropriate line breaks. + +This is a multiple line block that extends over more than one line. There should be appropriate line breaks.This is a multiple line block with start-indent 100pt that extends over more than one line. There should be appropriate line breaks.This is a multiple line block that extends over more than one line. There should be appropriate line breaks. - -This is a multiple line block that extends over more than one line. There should be appropriate line breaks.This is an embedded multiple line block that extends over more than one line. There should be appropriate line breaks.This is a multiple line block that extends over more than one line. There should be appropriate line breaks. + +This is a multiple line block that extends over more than one line. There should be appropriate line breaks.This is an embedded multiple line block that extends over more than one line. There should be appropriate line breaks.This is a multiple line block that extends over more than one line. There should be appropriate line breaks. - - A block in a list-item-body + + A block in a list-item-body - - + + - - This is a list item in a list that is itself a list item + + This is a list item in a list that is itself a list item diff --git a/docs/examples/fo/leader.fo b/docs/examples/fo/leader.fo index 6555b5878..f90769dbc 100644 --- a/docs/examples/fo/leader.fo +++ b/docs/examples/fo/leader.fo @@ -271,11 +271,11 @@ - + · - + Entry 1 @@ -290,11 +290,11 @@ - + · - + Entry 2 diff --git a/docs/examples/fo/list.fo b/docs/examples/fo/list.fo index e3ef2fd0a..8ea1ca394 100644 --- a/docs/examples/fo/list.fo +++ b/docs/examples/fo/list.fo @@ -88,11 +88,11 @@ - + · - + here is text in the list item body @@ -102,11 +102,11 @@ - + · - + here is text in the list item body @@ -116,11 +116,11 @@ - + · - + here is text in the list item body @@ -130,11 +130,11 @@ - + · - + here is text in the list item body @@ -144,11 +144,11 @@ - + · - + here is text in the list item body @@ -172,13 +172,13 @@ - + · - + here is text in the list item body @@ -254,11 +254,11 @@ - + · - + here is text in the list item body @@ -268,11 +268,11 @@ - + · - + here is text in the list item body @@ -282,11 +282,11 @@ - + · - + here is text in the list item body @@ -311,13 +311,13 @@ - + · - + here is text in the list item body @@ -361,11 +361,11 @@ - + · - + here is text in the list item body @@ -375,11 +375,11 @@ - + · - + here is text in the list item body @@ -389,11 +389,11 @@ - + · - + here is text in the list item body @@ -403,11 +403,11 @@ - + · - + here is text in the list item body @@ -417,11 +417,11 @@ - + · - + here is text in the list item body @@ -461,11 +461,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -478,11 +478,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -495,11 +495,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -512,11 +512,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -529,11 +529,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -574,11 +574,11 @@ - + label 1) - + here is text in the list item body @@ -588,11 +588,11 @@ - + lab. 2) - + here is text in the list item body @@ -602,11 +602,11 @@ - + lab. 3) - + here is text in the list item body @@ -616,11 +616,11 @@ - + lab. 4) - + here is text in the list item body @@ -630,11 +630,11 @@ - + lab. 5) - + here is text in the list item body @@ -677,11 +677,11 @@ - + · - + here is text in the list item body @@ -691,11 +691,11 @@ - + · - + here is text in the list item body @@ -705,11 +705,11 @@ - + · - + here is text in the list item body @@ -719,11 +719,11 @@ - + · - + here is text in the list item body @@ -733,11 +733,11 @@ - + · - + here is text in the list item body @@ -747,11 +747,11 @@ - + · - + here is text in the list item body @@ -761,11 +761,11 @@ - + · - + here is text in the list item body @@ -775,11 +775,11 @@ - + · - + here is text in the list item body @@ -789,11 +789,11 @@ - + · - + here is text in the list item body @@ -803,11 +803,11 @@ - + · - + here is text in the list item body @@ -817,11 +817,11 @@ - + · - + here is text in the list item body @@ -831,11 +831,11 @@ - + · - + here is text in the list item body @@ -845,11 +845,11 @@ - + · - + here is text in the list item body @@ -859,11 +859,11 @@ - + · - + here is text in the list item body @@ -873,11 +873,11 @@ - + · - + here is text in the list item body @@ -887,11 +887,11 @@ - + · - + here is text in the list item body @@ -901,11 +901,11 @@ - + · - + here is text in the list item body @@ -915,11 +915,11 @@ - + · - + here is text in the list item body @@ -929,11 +929,11 @@ - + · - + here is text in the list item body @@ -943,11 +943,11 @@ - + · - + here is text in the list item body @@ -957,11 +957,11 @@ - + · - + here is text in the list item body @@ -971,11 +971,11 @@ - + · - + here is text in the list item body @@ -985,11 +985,11 @@ - + · - + here is text in the list item body @@ -999,11 +999,11 @@ - + · - + here is text in the list item body @@ -1013,11 +1013,11 @@ - + · - + here is text in the list item body @@ -1027,11 +1027,11 @@ - + · - + here is text in the list item body @@ -1041,11 +1041,11 @@ - + · - + here is text in the list item body @@ -1055,11 +1055,11 @@ - + · - + here is text in the list item body @@ -1069,11 +1069,11 @@ - + · - + here is text in the list item body @@ -1083,11 +1083,11 @@ - + · - + here is text in the list item body @@ -1097,11 +1097,11 @@ - + · - + here is text in the list item body @@ -1111,11 +1111,11 @@ - + · - + here is text in the list item body @@ -1125,11 +1125,11 @@ - + · - + here is text in the list item body @@ -1139,11 +1139,11 @@ - + · - + here is text in the list item body @@ -1153,11 +1153,11 @@ - + · - + here is text in the list item body @@ -1167,11 +1167,11 @@ - + · - + here is text in the list item body @@ -1181,11 +1181,11 @@ - + · - + here is text in the list item body @@ -1195,11 +1195,11 @@ - + · - + here is text in the list item body @@ -1209,11 +1209,11 @@ - + · - + here is text in the list item body @@ -1223,11 +1223,11 @@ - + · - + here is text in the list item body @@ -1237,11 +1237,11 @@ - + · - + here is text in the list item body @@ -1251,11 +1251,11 @@ - + · - + here is text in the list item body @@ -1265,11 +1265,11 @@ - + · - + here is text in the list item body @@ -1279,11 +1279,11 @@ - + · - + here is text in the list item body @@ -1293,11 +1293,11 @@ - + · - + here is text in the list item body @@ -1307,11 +1307,11 @@ - + · - + here is text in the list item body @@ -1321,11 +1321,11 @@ - + · - + here is text in the list item body @@ -1335,11 +1335,11 @@ - + · - + here is text in the list item body @@ -1349,11 +1349,11 @@ - + · - + here is text in the list item body @@ -1363,11 +1363,11 @@ - + · - + here is text in the list item body @@ -1377,11 +1377,11 @@ - + · - + here is text in the list item body @@ -1391,11 +1391,11 @@ - + · - + here is text in the list item body @@ -1404,11 +1404,11 @@ - + · - + here is text in the list item body @@ -1418,11 +1418,11 @@ - + · - + here is text in the list item body @@ -1432,11 +1432,11 @@ - + · - + here is text in the list item body @@ -1446,11 +1446,11 @@ - + · - + here is text in the list item body @@ -1460,11 +1460,11 @@ - + · - + here is text in the list item body @@ -1474,11 +1474,11 @@ - + · - + here is text in the list item body @@ -1488,11 +1488,11 @@ - + · - + here is text in the list item body @@ -1502,11 +1502,11 @@ - + · - + here is text in the list item body @@ -1516,11 +1516,11 @@ - + · - + here is text in the list item body @@ -1530,11 +1530,11 @@ - + · - + here is text in the list item body @@ -1544,11 +1544,11 @@ - + · - + here is text in the list item body @@ -1558,11 +1558,11 @@ - + · - + here is text in the list item body @@ -1572,11 +1572,11 @@ - + · - + here is text in the list item body @@ -1586,11 +1586,11 @@ - + · - + here is text in the list item body @@ -1600,11 +1600,11 @@ - + · - + here is text in the list item body @@ -1614,11 +1614,11 @@ - + · - + here is text in the list item body @@ -1628,11 +1628,11 @@ - + · - + here is text in the list item body @@ -1642,11 +1642,11 @@ - + · - + here is text in the list item body @@ -1656,11 +1656,11 @@ - + · - + here is text in the list item body @@ -1670,11 +1670,11 @@ - + · - + here is text in the list item body @@ -1684,11 +1684,11 @@ - + · - + here is text in the list item body @@ -1698,11 +1698,11 @@ - + · - + here is text in the list item body @@ -1712,11 +1712,11 @@ - + · - + here is text in the list item body @@ -1726,11 +1726,11 @@ - + · - + here is text in the list item body @@ -1740,11 +1740,11 @@ - + · - + here is text in the list item body @@ -1754,11 +1754,11 @@ - + · - + here is text in the list item body @@ -1767,11 +1767,11 @@ - + · - + here is text in the list item body @@ -1781,11 +1781,11 @@ - + · - + here is text in the list item body @@ -1795,11 +1795,11 @@ - + · - + here is text in the list item body @@ -1809,11 +1809,11 @@ - + · - + here is text in the list item body @@ -1823,11 +1823,11 @@ - + · - + here is text in the list item body @@ -1837,11 +1837,11 @@ - + · - + here is text in the list item body @@ -1851,11 +1851,11 @@ - + · - + here is text in the list item body @@ -1865,11 +1865,11 @@ - + · - + here is text in the list item body @@ -1879,11 +1879,11 @@ - + · - + here is text in the list item body @@ -1893,11 +1893,11 @@ - + · - + here is text in the list item body @@ -1907,11 +1907,11 @@ - + · - + here is text in the list item body @@ -1921,11 +1921,11 @@ - + · - + here is text in the list item body @@ -1935,11 +1935,11 @@ - + · - + here is text in the list item body @@ -1978,11 +1978,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -1993,11 +1993,11 @@ - + · - + here comes a nested list with numbers @@ -2008,11 +2008,11 @@ - + 1.) - + nested list item @@ -2021,11 +2021,11 @@ - + 2.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2037,11 +2037,11 @@ - + 3.) - + nested list item @@ -2050,11 +2050,11 @@ - + 4.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2066,11 +2066,11 @@ - + 5.) - + nested list item @@ -2087,11 +2087,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -2102,11 +2102,11 @@ - + · - + here is text in the list item body @@ -2116,11 +2116,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -2163,11 +2163,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -2178,11 +2178,11 @@ - + · - + here comes a nested list with numbers @@ -2193,11 +2193,11 @@ - + 1.) - + nested list item @@ -2249,11 +2249,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -2264,11 +2264,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -2279,11 +2279,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -2294,11 +2294,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -2309,11 +2309,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -2324,11 +2324,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -2339,11 +2339,11 @@ - + · - + here comes a nested list with numbers @@ -2354,11 +2354,11 @@ - + 1.) - + nested list item @@ -2367,11 +2367,11 @@ - + 2.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2383,11 +2383,11 @@ - + 3.) - + nested list item @@ -2396,11 +2396,11 @@ - + 4.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2412,11 +2412,11 @@ - + 5.) - + nested list item @@ -2425,11 +2425,11 @@ - + 6.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2441,11 +2441,11 @@ - + 7.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2457,11 +2457,11 @@ - + 8.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2473,11 +2473,11 @@ - + 9.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2489,11 +2489,11 @@ - + 10.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2505,11 +2505,11 @@ - + 11.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2521,11 +2521,11 @@ - + 12.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2537,11 +2537,11 @@ - + 13.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2553,11 +2553,11 @@ - + 14.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2569,11 +2569,11 @@ - + 15.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2585,11 +2585,11 @@ - + 16.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2601,11 +2601,11 @@ - + 17.) - + nested list item with more text. nested list item with more text. nested list item with more text. nested list item with more text. @@ -2624,11 +2624,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. @@ -2639,11 +2639,11 @@ - + · - + here is text in the list item body @@ -2653,11 +2653,11 @@ - + · - + here is text in the list item body. here is text in the list item body. here is text in the list item body. here is text in the list item body. diff --git a/docs/examples/fo/pdfoutline.fo b/docs/examples/fo/pdfoutline.fo index c77ae9465..5f91c1952 100644 --- a/docs/examples/fo/pdfoutline.fo +++ b/docs/examples/fo/pdfoutline.fo @@ -354,226 +354,226 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. 1) Formatting Objects - + · - + root - + · - + layout-master-set - + · - + simple-page-master - + · - + region-body - + · - + region-before - + · - + region-after - + · - + page-sequence - + · - + sequence-specification - + · - + sequence-specifier-single - + · - + sequence-specifier-repeating - + · - + sequence-specifier-alternating - + · - + flow - + · - + static-content - + · - + block - + · - + list-block - + · - + list-item - + · - + list-item-label - + · - + list-item-body - + · - + page-number - + · - + display-sequence - + · - + inline - + · - + display-rule - + · - + display-graphic - + · - + table (minimal support) - + · - + table-column (minimal support) - + · - + table-body (minimal support) - + · - + table-row (minimal support) - + · - + table-cell (minimal support) @@ -584,330 +584,330 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. 2) Properties - + · - + end-indent - + · - + page-master-name - + · - + page-master-first - + · - + page-master-repeating - + · - + page-master-odd - + · - + page-master-even - + · - + margin-top (only on pages and regions) - + · - + margin-bottom (only on pages and regions) - + · - + margin-left (only on pages and regions) - + · - + margin-right (only on pages and regions) - + · - + extent - + · - + page-width - + · - + page-height - + · - + flow-name - + · - + font-family - + · - + font-style - + · - + font-weight - + · - + font-size - + · - + line-height - + · - + text-align - + · - + text-align-last - + · - + space-before.optimum - + · - + space-after.optimum - + · - + start-indent - + · - + end-indent - + · - + provisional-distance-between-starts - + · - + provisional-label-separation - + · - + rule-thickness - + · - + color - + · - + wrap-option - + · - + white-space-treatment - + · - + break-before - + · - + break-after - + · - + text-indent - + · - + href - + · - + column-width - + · - + background-color - + · - + padding-top (only in conjunction with background color) - + · - + padding-left (only in conjunction with background color) - + · - + padding-bottom (only in conjunction with background color) - + · - + padding-right (only in conjunction with background color) @@ -1095,10 +1095,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + XML Recommendation @@ -1108,10 +1108,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + XSL-FO Working Draft @@ -1121,10 +1121,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + XSLT Recommendation @@ -1134,10 +1134,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + PDF Documentation @@ -1147,10 +1147,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + Simple API for XML (SAX) @@ -1160,10 +1160,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + Document Object Model (DOM) @@ -1173,10 +1173,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + Namespaces in XML Recommendation @@ -1186,10 +1186,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + Java JDK 1.1 Documentation diff --git a/docs/examples/fo/readme.fo b/docs/examples/fo/readme.fo index 7924aa6f5..f1f7e5cda 100644 --- a/docs/examples/fo/readme.fo +++ b/docs/examples/fo/readme.fo @@ -284,226 +284,226 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. 1) Formatting Objects - + · - + root - + · - + layout-master-set - + · - + simple-page-master - + · - + region-body - + · - + region-before - + · - + region-after - + · - + page-sequence - + · - + sequence-specification - + · - + sequence-specifier-single - + · - + sequence-specifier-repeating - + · - + sequence-specifier-alternating - + · - + flow - + · - + static-content - + · - + block - + · - + list-block - + · - + list-item - + · - + list-item-label - + · - + list-item-body - + · - + page-number - + · - + display-sequence - + · - + inline - + · - + display-rule - + · - + display-graphic - + · - + table (minimal support) - + · - + table-column (minimal support) - + · - + table-body (minimal support) - + · - + table-row (minimal support) - + · - + table-cell (minimal support) @@ -514,330 +514,330 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. 2) Properties - + · - + end-indent - + · - + page-master-name - + · - + page-master-first - + · - + page-master-repeating - + · - + page-master-odd - + · - + page-master-even - + · - + margin-top (only on pages and regions) - + · - + margin-bottom (only on pages and regions) - + · - + margin-left (only on pages and regions) - + · - + margin-right (only on pages and regions) - + · - + extent - + · - + page-width - + · - + page-height - + · - + flow-name - + · - + font-family - + · - + font-style - + · - + font-weight - + · - + font-size - + · - + line-height - + · - + text-align - + · - + text-align-last - + · - + space-before.optimum - + · - + space-after.optimum - + · - + start-indent - + · - + end-indent - + · - + provisional-distance-between-starts - + · - + provisional-label-separation - + · - + rule-thickness - + · - + color - + · - + wrap-option - + · - + white-space-treatment - + · - + break-before - + · - + break-after - + · - + text-indent - + · - + href - + · - + column-width - + · - + background-color - + · - + padding-top (only in conjunction with background color) - + · - + padding-left (only in conjunction with background color) - + · - + padding-bottom (only in conjunction with background color) - + · - + padding-right (only in conjunction with background color) @@ -1025,10 +1025,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + XML Recommendation @@ -1038,10 +1038,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + XSL-FO Working Draft @@ -1051,10 +1051,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + XSLT Recommendation @@ -1064,10 +1064,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + PDF Documentation @@ -1077,10 +1077,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + Simple API for XML (SAX) @@ -1090,10 +1090,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + Document Object Model (DOM) @@ -1103,10 +1103,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + Namespaces in XML Recommendation @@ -1116,10 +1116,10 @@ This is not the latest Fop documentation, but just an fo example. FOP - p. - + · - + Java JDK 1.1 Documentation diff --git a/docs/examples/fo/textdeko.fo b/docs/examples/fo/textdeko.fo index f12fc3333..08d01484f 100644 --- a/docs/examples/fo/textdeko.fo +++ b/docs/examples/fo/textdeko.fo @@ -102,10 +102,10 @@ - + - + none @@ -113,10 +113,10 @@ - + - + underline @@ -124,10 +124,10 @@ - + - + overline @@ -135,10 +135,10 @@ - + - + line-through @@ -146,10 +146,10 @@ - + - + blink @@ -157,10 +157,10 @@ - + - + no-underline @@ -168,10 +168,10 @@ - + - + no-overline @@ -179,10 +179,10 @@ - + - + no-line-through @@ -190,10 +190,10 @@ - + - + no-blink diff --git a/docs/examples/svg/Document.xsl b/docs/examples/svg/Document.xsl index 6954a5c3d..9e565be69 100644 --- a/docs/examples/svg/Document.xsl +++ b/docs/examples/svg/Document.xsl @@ -228,21 +228,21 @@ - + - + - + - + - + - + @@ -267,10 +267,10 @@ - + - + @@ -286,10 +286,10 @@ - + - + diff --git a/docs/xml-docs/fop/limitations.xml b/docs/xml-docs/fop/limitations.xml index 33fcbc4cc..fd3b1288f 100644 --- a/docs/xml-docs/fop/limitations.xml +++ b/docs/xml-docs/fop/limitations.xml @@ -20,18 +20,6 @@

- -

The fo working draft allows describes two ways to markup lists.The list-block must have as - children either: 1) pairs of fo:list-item-label and fo:list-item-body formatting objects, or - 2) fo:list-item formatting objects.

-

At the moment FOP only implements the second way. Therefore a list has a basic structure like this:

-

<fo:list-block>

-

<fo:list-item>

-

<fo:list-item-label><fo:block></fo:block></fo:list-item-label>

-

<fo:list-item-body><fo:block></fo:block></fo:list-item-body>

-

</fo:list-item>

-

</fo:list-block>

-

Padding works in conjunction with indents and spaces. It is only implemented for blocks. At the moment padding can't be used to make extra space (indents+spaces diff --git a/docs/xml-docs/xml2pdf.xsl b/docs/xml-docs/xml2pdf.xsl index 052dd9746..7b4dd9860 100644 --- a/docs/xml-docs/xml2pdf.xsl +++ b/docs/xml-docs/xml2pdf.xsl @@ -267,10 +267,10 @@ TBD: - The faq doesn't show in the content - + · - + @@ -284,12 +284,12 @@ TBD: - The faq doesn't show in the content - + ) - + diff --git a/src/org/apache/fop/datatypes/LinearCombinationLength.java b/src/org/apache/fop/datatypes/LinearCombinationLength.java new file mode 100644 index 000000000..71126cfea --- /dev/null +++ b/src/org/apache/fop/datatypes/LinearCombinationLength.java @@ -0,0 +1,89 @@ +/*-- $Id$ -- + + ============================================================================ + The Apache Software License, Version 1.1 + ============================================================================ + + Copyright (C) 1999 The Apache Software Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without modifica- + tion, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. The end-user documentation included with the redistribution, if any, must + include the following acknowledgment: "This product includes software + developed by the Apache Software Foundation (http://www.apache.org/)." + Alternately, this acknowledgment may appear in the software itself, if + and wherever such third-party acknowledgments normally appear. + + 4. The names "Fop" and "Apache Software Foundation" must not be used to + endorse or promote products derived from this software without prior + written permission. For written permission, please contact + apache@apache.org. + + 5. Products derived from this software may not be called "Apache", nor may + "Apache" appear in their name, without prior written permission of the + Apache Software Foundation. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + This software consists of voluntary contributions made by many individuals + on behalf of the Apache Software Foundation and was originally created by + James Tauber . For more information on the Apache + Software Foundation, please see . + + */ +package org.apache.fop.datatypes; + +import java.util.Vector; +import org.apache.fop.messaging.MessageHandler; + +/** + * a percent specified length quantity in XSL + */ +public class LinearCombinationLength extends Length { + + protected Vector factors; + protected Vector lengths; + + public LinearCombinationLength() { + super(0); + factors = new Vector(); + lengths = new Vector(); + super.setIsComputed(false); + } + + public void addTerm(double factor, Length length) { + factors.addElement(new Double(factor)); + lengths.addElement(length); + } + + /** + * Return the computed value in millipoints. + */ + protected int computeValue() { + int result = 0; + int numFactors = factors.size(); + for(int i = 0; i < numFactors; ++i) { + result += (int)(((Double)factors.elementAt(i)).doubleValue() + * (double)((Length)lengths.elementAt(i)).mvalue()); + } + return result; + } + +} diff --git a/src/org/apache/fop/fo/FONode.java b/src/org/apache/fop/fo/FONode.java index c0245c59e..a4d67c608 100644 --- a/src/org/apache/fop/fo/FONode.java +++ b/src/org/apache/fop/fo/FONode.java @@ -81,14 +81,8 @@ abstract public class FONode { */ protected int marker = START; - protected boolean isInLabel = false; - protected boolean isInListBody = false; protected boolean isInTableCell = false; - protected int bodyIndent; - protected int distanceBetweenStarts; - protected int labelSeparation; - protected int forcedStartOffset = 0; protected int forcedWidth = 0; @@ -101,24 +95,6 @@ abstract public class FONode { this.parent = parent; } - public void setIsInLabel() { - this.isInLabel = true; - // made recursive by Eric Schaeffer - for (int i = 0; i < this.children.size(); i++ ) { - FONode child = (FONode) this.children.elementAt(i); - child.setIsInLabel(); - } - } - - public void setIsInListBody() { - this.isInListBody = true; - // made recursive by Eric Schaeffer - for (int i = 0; i < this.children.size(); i++) { - FONode child = (FONode) this.children.elementAt(i); - child.setIsInListBody(); - } - } - public void setIsInTableCell() { this.isInTableCell = true; // made recursive by Eric Schaeffer @@ -128,33 +104,6 @@ abstract public class FONode { } } - public void setDistanceBetweenStarts(int distance) { - this.distanceBetweenStarts = distance; - // made recursive by Eric Schaeffer - for (int i = 0; i < this.children.size(); i++) { - FONode child = (FONode) this.children.elementAt(i); - child.setDistanceBetweenStarts(distance); - } - } - - public void setLabelSeparation(int separation) { - this.labelSeparation = separation; - // made recursive by Eric Schaeffer - for (int i = 0; i < this.children.size(); i++) { - FONode child = (FONode) this.children.elementAt(i); - child.setLabelSeparation(separation); - } - } - - public void setBodyIndent(int indent) { - this.bodyIndent = indent; - // made recursive by Eric Schaeffer - for (int i = 0; i < this.children.size(); i++) { - FONode child = (FONode) this.children.elementAt(i); - child.setBodyIndent(indent); - } - } - public void forceStartOffset(int offset) { this.forcedStartOffset = offset; // made recursive by Eric Schaeffer diff --git a/src/org/apache/fop/fo/expr/BodyStartFunction.java b/src/org/apache/fop/fo/expr/BodyStartFunction.java new file mode 100644 index 000000000..56a3a1fb4 --- /dev/null +++ b/src/org/apache/fop/fo/expr/BodyStartFunction.java @@ -0,0 +1,79 @@ +/*-- $Id$ -- + + ============================================================================ + The Apache Software License, Version 1.1 + ============================================================================ + + Copyright (C) 1999 The Apache Software Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without modifica- + tion, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. The end-user documentation included with the redistribution, if any, must + include the following acknowledgment: "This product includes software + developed by the Apache Software Foundation (http://www.apache.org/)." + Alternately, this acknowledgment may appear in the software itself, if + and wherever such third-party acknowledgments normally appear. + + 4. The names "FOP" and "Apache Software Foundation" must not be used to + endorse or promote products derived from this software without prior + written permission. For written permission, please contact + apache@apache.org. + + 5. Products derived from this software may not be called "Apache", nor may + "Apache" appear in their name, without prior written permission of the + Apache Software Foundation. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + This software consists of voluntary contributions made by many individuals + on behalf of the Apache Software Foundation and was originally created by + James Tauber . For more information on the Apache + Software Foundation, please see . + + */ +package org.apache.fop.fo.expr; + +import org.apache.fop.fo.Property; +import org.apache.fop.fo.FObj; +import org.apache.fop.fo.flow.ListItem; + +public class BodyStartFunction extends FunctionBase { + + public int nbArgs() { return 0; } + + public Property eval(Property[] args, PropertyInfo pInfo) + throws PropertyException + { + Numeric distance + = pInfo.getPropertyList().get("provisional-distance-between-starts").getNumeric(); + + FObj item = pInfo.getFO(); + while(item != null && !(item instanceof ListItem)) { + item = item.getParent(); + } + if(item == null) { + throw new PropertyException("body-start() called from outside an fo:list-item"); + } + + Numeric startIndent = item.properties.get("start-indent").getNumeric(); + + return new NumericProperty(distance.add(startIndent)); + } +} diff --git a/src/org/apache/fop/fo/expr/LabelEndFunction.java b/src/org/apache/fop/fo/expr/LabelEndFunction.java new file mode 100644 index 000000000..6ab37cec7 --- /dev/null +++ b/src/org/apache/fop/fo/expr/LabelEndFunction.java @@ -0,0 +1,96 @@ +/*-- $Id$ -- + + ============================================================================ + The Apache Software License, Version 1.1 + ============================================================================ + + Copyright (C) 1999 The Apache Software Foundation. All rights reserved. + + Redistribution and use in source and binary forms, with or without modifica- + tion, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. The end-user documentation included with the redistribution, if any, must + include the following acknowledgment: "This product includes software + developed by the Apache Software Foundation (http://www.apache.org/)." + Alternately, this acknowledgment may appear in the software itself, if + and wherever such third-party acknowledgments normally appear. + + 4. The names "FOP" and "Apache Software Foundation" must not be used to + endorse or promote products derived from this software without prior + written permission. For written permission, please contact + apache@apache.org. + + 5. Products derived from this software may not be called "Apache", nor may + "Apache" appear in their name, without prior written permission of the + Apache Software Foundation. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + This software consists of voluntary contributions made by many individuals + on behalf of the Apache Software Foundation and was originally created by + James Tauber . For more information on the Apache + Software Foundation, please see . + + */ +package org.apache.fop.fo.expr; + +import org.apache.fop.datatypes.*; +import org.apache.fop.fo.Property; +import org.apache.fop.fo.LengthProperty; +import org.apache.fop.fo.FObj; +import org.apache.fop.fo.flow.ListItem; + +public class LabelEndFunction extends FunctionBase { + + public int nbArgs() { return 0; } + + public Property eval(Property[] args, PropertyInfo pInfo) + throws PropertyException { + + Length distance + = pInfo.getPropertyList() + .get("provisional-distance-between-starts").getLength(); + Length separation + = pInfo.getPropertyList() + .getNearestSpecified("provisional-label-separation").getLength(); + + FObj item = pInfo.getFO(); + while(item != null && !(item instanceof ListItem)) { + item = item.getParent(); + } + if(item == null) { + throw new PropertyException("label-end() called from outside an fo:list-item"); + } + Length startIndent = item.properties.get("start-indent").getLength(); + + LinearCombinationLength labelEnd = new LinearCombinationLength(); + + // Should be CONTAINING_REFAREA but that doesn't work + LengthBase base = new LengthBase(item, pInfo.getPropertyList(), + LengthBase.CONTAINING_BOX); + PercentLength refWidth = new PercentLength(1.0, base); + + labelEnd.addTerm(1.0, refWidth); + labelEnd.addTerm(-1.0, distance); + labelEnd.addTerm(-1.0, startIndent); + labelEnd.addTerm(1.0, separation); + + return new LengthProperty(labelEnd); + } +} diff --git a/src/org/apache/fop/fo/expr/Numeric.java b/src/org/apache/fop/fo/expr/Numeric.java index 12bcdbf49..f13ccbc76 100644 --- a/src/org/apache/fop/fo/expr/Numeric.java +++ b/src/org/apache/fop/fo/expr/Numeric.java @@ -54,6 +54,7 @@ package org.apache.fop.fo.expr; import org.apache.fop.fo.Property; import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.PercentLength; +import org.apache.fop.datatypes.LinearCombinationLength; import org.apache.fop.datatypes.MixedLength; import org.apache.fop.datatypes.TableColLength; import org.apache.fop.datatypes.PercentBase; diff --git a/src/org/apache/fop/fo/expr/PropertyParser.java b/src/org/apache/fop/fo/expr/PropertyParser.java index b10cf671c..004a507e7 100644 --- a/src/org/apache/fop/fo/expr/PropertyParser.java +++ b/src/org/apache/fop/fo/expr/PropertyParser.java @@ -85,6 +85,8 @@ public class PropertyParser extends PropertyTokenizer { functionTable.put("from-parent", new FromParentFunction()); functionTable.put("from-nearest-specified-value", new NearestSpecPropFunction()); functionTable.put("proportional-column-width", new PPColWidthFunction()); + functionTable.put("label-end", new LabelEndFunction()); + functionTable.put("body-start", new BodyStartFunction()); // NOTE: used from code generated for corresponding properties functionTable.put("_fop-property-value", new FopPropValFunction()); @@ -94,8 +96,6 @@ public class PropertyParser extends PropertyTokenizer { functionTable.put("system-font", new SystemFontFunction()); - functionTable.put("label-end", new LabelEndFunction()); - functionTable.put("body-start", new BodyStartFunction()); functionTable.put("merge-property-values", new MergePropsFunction()); ***/ } diff --git a/src/org/apache/fop/fo/flow/Block.java b/src/org/apache/fop/fo/flow/Block.java index ea66f10fa..e88e1f844 100644 --- a/src/org/apache/fop/fo/flow/Block.java +++ b/src/org/apache/fop/fo/flow/Block.java @@ -256,14 +256,6 @@ public class Block extends FObjMixed { if (area instanceof BlockArea) { area.end(); } - if (this.isInLabel) { - startIndent += bodyIndent; - endIndent += (area.getAllocationWidth() - - distanceBetweenStarts - startIndent) + - labelSeparation; - } else if (this.isInListBody) { - startIndent += bodyIndent + distanceBetweenStarts; - } if(area.getIDReferences() != null) area.getIDReferences().createID(id); @@ -358,11 +350,6 @@ public class Block extends FObjMixed { int numChildren = this.children.size(); for (int i = this.marker; i < numChildren; i++) { FONode fo = (FONode) children.elementAt(i); - if (this.isInListBody) { - fo.setIsInListBody(); - fo.setDistanceBetweenStarts(this.distanceBetweenStarts); - fo.setBodyIndent(this.bodyIndent); - } Status status; if ((status = fo.layout(blockArea)).isIncomplete()) { this.marker = i; diff --git a/src/org/apache/fop/fo/flow/ExternalGraphic.java b/src/org/apache/fop/fo/flow/ExternalGraphic.java index 5636fa70a..c67f4f189 100644 --- a/src/org/apache/fop/fo/flow/ExternalGraphic.java +++ b/src/org/apache/fop/fo/flow/ExternalGraphic.java @@ -125,17 +125,6 @@ public class ExternalGraphic extends FObj { area.end(); } - if (this.isInLabel) { - startIndent += bodyIndent; - endIndent += (area.getAllocationWidth() - - distanceBetweenStarts - startIndent) + - labelSeparation; - } - - if (this.isInListBody) { - startIndent += bodyIndent + distanceBetweenStarts; - } - if (this.isInTableCell) { startIndent += forcedStartOffset; endIndent = area.getAllocationWidth() - forcedWidth - diff --git a/src/org/apache/fop/fo/flow/InlineGraphic.java b/src/org/apache/fop/fo/flow/InlineGraphic.java index ee585998c..5ed0edfe9 100644 --- a/src/org/apache/fop/fo/flow/InlineGraphic.java +++ b/src/org/apache/fop/fo/flow/InlineGraphic.java @@ -146,17 +146,6 @@ public class InlineGraphic extends FObj { area.end(); } - if (this.isInLabel) { - startIndent += bodyIndent; - endIndent += (area.getAllocationWidth() - - distanceBetweenStarts - startIndent) - + labelSeparation; - } - - if (this.isInListBody) { - startIndent += bodyIndent + distanceBetweenStarts; - } - if (this.isInTableCell) { startIndent += forcedStartOffset; endIndent = area.getAllocationWidth() - forcedWidth - diff --git a/src/org/apache/fop/fo/flow/InstreamForeignObject.java b/src/org/apache/fop/fo/flow/InstreamForeignObject.java index 15c23853d..c7c109971 100644 --- a/src/org/apache/fop/fo/flow/InstreamForeignObject.java +++ b/src/org/apache/fop/fo/flow/InstreamForeignObject.java @@ -250,17 +250,6 @@ public class InstreamForeignObject extends FObj { area.increaseHeight(areaCurrent.getEffectiveHeight()); } - if (this.isInLabel) { - startIndent += bodyIndent; -/* endIndent += (areaCurrent.getEffectiveWidth() - - distanceBetweenStarts - startIndent) - + labelSeparation;*/ - } - - if (this.isInListBody) { - startIndent += bodyIndent + distanceBetweenStarts; - } - if (this.isInTableCell) { startIndent += forcedStartOffset; /* endIndent = areaCurrent.getEffectiveWidth() - forcedWidth - diff --git a/src/org/apache/fop/fo/flow/ListBlock.java b/src/org/apache/fop/fo/flow/ListBlock.java index 962e9103e..b5ce9f2ad 100644 --- a/src/org/apache/fop/fo/flow/ListBlock.java +++ b/src/org/apache/fop/fo/flow/ListBlock.java @@ -87,8 +87,6 @@ public class ListBlock extends FObj { int endIndent; int spaceBefore; int spaceAfter; - int provisionalDistanceBetweenStarts; - int provisionalLabelSeparation; int spaceBetweenListRows = 0; ColorType backgroundColor; @@ -128,11 +126,6 @@ public class ListBlock extends FObj { "space-before.optimum").getLength().mvalue(); this.spaceAfter = this.properties.get( "space-after.optimum").getLength().mvalue(); - this.provisionalDistanceBetweenStarts = this.properties.get( - "provisional-distance-between-starts").getLength(). - mvalue(); - this.provisionalLabelSeparation = this.properties.get( - "provisional-label-separation").getLength().mvalue(); this.spaceBetweenListRows = 0; // not used at present this.backgroundColor = this.properties.get( "background-color").getColorType(); @@ -147,11 +140,6 @@ public class ListBlock extends FObj { area.addDisplaySpace(spaceBefore); } - if (this.isInListBody) { - startIndent += bodyIndent + distanceBetweenStarts; - bodyIndent = startIndent; - } - if (this.isInTableCell) { startIndent += forcedStartOffset; endIndent += area.getAllocationWidth() - forcedWidth - @@ -176,14 +164,10 @@ public class ListBlock extends FObj { int numChildren = this.children.size(); for (int i = this.marker; i < numChildren; i++) { if (!(children.elementAt(i) instanceof ListItem)) { - MessageHandler.errorln("WARNING: This version of FOP requires list-items inside list-blocks"); + MessageHandler.errorln("children of list-blocks must be list-items"); return new Status(Status.OK); } ListItem listItem = (ListItem) children.elementAt(i); - listItem.setDistanceBetweenStarts( - this.provisionalDistanceBetweenStarts); - listItem.setLabelSeparation(this.provisionalLabelSeparation); - listItem.setBodyIndent(this.bodyIndent); Status status; if ((status = listItem.layout(blockArea)).isIncomplete()) { if(status.getCode() == Status.AREA_FULL_NONE && i > 0) { @@ -214,9 +198,4 @@ public class ListBlock extends FObj { return new Status(Status.OK); } - public void setBodyIndent(int indent) { - if (! this.isInListBody) { - super.setBodyIndent(indent); - } - } } diff --git a/src/org/apache/fop/fo/flow/ListItem.java b/src/org/apache/fop/fo/flow/ListItem.java index b5a889642..4d80641df 100644 --- a/src/org/apache/fop/fo/flow/ListItem.java +++ b/src/org/apache/fop/fo/flow/ListItem.java @@ -1,35 +1,35 @@ /*-- $Id$ -- ============================================================================ - The Apache Software License, Version 1.1 + The Apache Software License, Version 1.1 ============================================================================ - Copyright (C) 1999 The Apache Software Foundation. All rights reserved. + Copyright (C) 1999 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must - include the following acknowledgment: "This product includes software - developed by the Apache Software Foundation (http://www.apache.org/)." - Alternately, this acknowledgment may appear in the software itself, if - and wherever such third-party acknowledgments normally appear. + include the following acknowledgment: "This product includes software + developed by the Apache Software Foundation (http://www.apache.org/)." + Alternately, this acknowledgment may appear in the software itself, if + and wherever such third-party acknowledgments normally appear. 4. The names "FOP" and "Apache Software Foundation" must not be used to - endorse or promote products derived from this software without prior - written permission. For written permission, please contact - apache@apache.org. + endorse or promote products derived from this software without prior + written permission. For written permission, please contact + apache@apache.org. 5. Products derived from this software may not be called "Apache", nor may - "Apache" appear in their name, without prior written permission of the - Apache Software Foundation. + "Apache" appear in their name, without prior written permission of the + Apache Software Foundation. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND @@ -64,149 +64,144 @@ import java.util.Enumeration; public class ListItem extends FObj { - public static class Maker extends FObj.Maker { - public FObj make(FObj parent, PropertyList propertyList) - throws FOPException { - return new ListItem(parent, propertyList); - } - } - - public static FObj.Maker maker() { - return new ListItem.Maker(); - } - - FontState fs; - int align; - int alignLast; - int breakBefore; - int breakAfter; - int lineHeight; - int startIndent; - int endIndent; - int spaceBefore; - int spaceAfter; - String id; - - public ListItem(FObj parent, PropertyList propertyList) { - super(parent, propertyList); - this.name = "fo:list-item"; - } - - public Status layout(Area area) throws FOPException { - if (this.marker == START) { - String fontFamily = - this.properties.get("font-family").getString(); - String fontStyle = - this.properties.get("font-style").getString(); - String fontWeight = - this.properties.get("font-weight").getString(); - int fontSize = - this.properties.get("font-size").getLength().mvalue(); - // font-variant support - // added by Eric SCHAEFFER - int fontVariant = - this.properties.get("font-variant").getEnum(); - - this.fs = new FontState(area.getFontInfo(), fontFamily, - fontStyle, fontWeight, fontSize, fontVariant); - - this.align = this.properties.get("text-align").getEnum(); - this.alignLast = - this.properties.get("text-align-last").getEnum(); - this.lineHeight = - this.properties.get("line-height").getLength().mvalue(); - this.startIndent = - this.properties.get("start-indent").getLength().mvalue(); - this.endIndent = - this.properties.get("end-indent").getLength().mvalue(); - this.spaceBefore = - this.properties.get("space-before.optimum").getLength().mvalue(); - this.spaceAfter = - this.properties.get("space-after.optimum").getLength().mvalue(); - this.id = - this.properties.get("id").getString(); - - area.getIDReferences().createID(id); - - this.marker = 0; - } - - /* not sure this is needed given we know area is from list block */ - if (area instanceof BlockArea) { - area.end(); - } - - if (spaceBefore != 0) { - area.addDisplaySpace(spaceBefore); - } - - startIndent += this.bodyIndent; - - BlockArea blockArea = - new BlockArea(fs, area.getAllocationWidth(), - area.spaceLeft(), startIndent, endIndent, - 0, align, alignLast, lineHeight); - blockArea.setPage(area.getPage()); - blockArea.start(); - - blockArea.setAbsoluteHeight(area.getAbsoluteHeight()); - blockArea.setIDReferences(area.getIDReferences()); - - int numChildren = this.children.size(); - if (numChildren != 2) { - throw new FOPException("list-item must have exactly two children"); - } - ListItemLabel label = (ListItemLabel) children.elementAt(0); - ListItemBody body = (ListItemBody) children.elementAt(1); - - label.setDistanceBetweenStarts(this.distanceBetweenStarts); - label.setLabelSeparation(this.labelSeparation); - label.setBodyIndent(this.bodyIndent); - - body.setDistanceBetweenStarts(this.distanceBetweenStarts); - body.setBodyIndent(this.bodyIndent); - - /* this doesn't actually do anything */ - body.setLabelSeparation(this.labelSeparation); - - Status status; - - // what follows doesn't yet take into account whether the - // body failed completely or only got some text in - - if (this.marker == 0) { - // configure id - area.getIDReferences().configureID(id,area); - - status = label.layout(blockArea); - if (status.isIncomplete()) { - return status; - } - } - - status = body.layout(blockArea); - if (status.isIncomplete()) { - blockArea.end(); - area.addChild(blockArea); - area.increaseHeight(blockArea.getHeight()); - area.setAbsoluteHeight(blockArea.getAbsoluteHeight()); - this.marker = 1; - return status; - } - - blockArea.end(); - area.addChild(blockArea); - area.increaseHeight(blockArea.getHeight()); - area.setAbsoluteHeight(blockArea.getAbsoluteHeight()); - - if (spaceAfter != 0) { - area.addDisplaySpace(spaceAfter); - } - - /* not sure this is needed given we know area is from list block */ - if (area instanceof BlockArea) { - area.start(); - } - return new Status(Status.OK); - } + public static class Maker extends FObj.Maker { + public FObj make(FObj parent, PropertyList propertyList) + throws FOPException { + return new ListItem(parent, propertyList); + } + } + + public static FObj.Maker maker() { + return new ListItem.Maker(); + } + + FontState fs; + int align; + int alignLast; + int breakBefore; + int breakAfter; + int lineHeight; + int startIndent; + int endIndent; + int spaceBefore; + int spaceAfter; + String id; + BlockArea blockArea; + + public ListItem(FObj parent, PropertyList propertyList) { + super(parent, propertyList); + this.name = "fo:list-item"; + } + + public Status layout(Area area) throws FOPException { + if (this.marker == START) { + String fontFamily = + this.properties.get("font-family").getString(); + String fontStyle = + this.properties.get("font-style").getString(); + String fontWeight = + this.properties.get("font-weight").getString(); + int fontSize = + this.properties.get("font-size").getLength().mvalue(); + // font-variant support + // added by Eric SCHAEFFER + int fontVariant = + this.properties.get("font-variant").getEnum(); + + this.fs = new FontState(area.getFontInfo(), fontFamily, + fontStyle, fontWeight, fontSize, fontVariant); + + this.align = this.properties.get("text-align").getEnum(); + this.alignLast = + this.properties.get("text-align-last").getEnum(); + this.lineHeight = + this.properties.get("line-height").getLength().mvalue(); + this.spaceBefore = + this.properties.get("space-before.optimum").getLength().mvalue(); + this.spaceAfter = + this.properties.get("space-after.optimum").getLength().mvalue(); + this.id = + this.properties.get("id").getString(); + + area.getIDReferences().createID(id); + + this.marker = 0; + } + + /* not sure this is needed given we know area is from list block */ + if (area instanceof BlockArea) { + area.end(); + } + + if (spaceBefore != 0) { + area.addDisplaySpace(spaceBefore); + } + + this.blockArea = + new BlockArea(fs, area.getAllocationWidth(), + area.spaceLeft(), 0, 0, + 0, align, alignLast, lineHeight); + blockArea.setPage(area.getPage()); + blockArea.start(); + + blockArea.setAbsoluteHeight(area.getAbsoluteHeight()); + blockArea.setIDReferences(area.getIDReferences()); + + int numChildren = this.children.size(); + if (numChildren != 2) { + throw new FOPException("list-item must have exactly two children"); + } + ListItemLabel label = (ListItemLabel) children.elementAt(0); + ListItemBody body = (ListItemBody) children.elementAt(1); + + Status status; + + // what follows doesn't yet take into account whether the + // body failed completely or only got some text in + + if (this.marker == 0) { + // configure id + area.getIDReferences().configureID(id,area); + + status = label.layout(blockArea); + if (status.isIncomplete()) { + return status; + } + } + + status = body.layout(blockArea); + if (status.isIncomplete()) { + blockArea.end(); + area.addChild(blockArea); + area.increaseHeight(blockArea.getHeight()); + area.setAbsoluteHeight(blockArea.getAbsoluteHeight()); + this.marker = 1; + return status; + } + + blockArea.end(); + area.addChild(blockArea); + area.increaseHeight(blockArea.getHeight()); + area.setAbsoluteHeight(blockArea.getAbsoluteHeight()); + + if (spaceAfter != 0) { + area.addDisplaySpace(spaceAfter); + } + + /* not sure this is needed given we know area is from list block */ + if (area instanceof BlockArea) { + area.start(); + } + return new Status(Status.OK); + } + + /** + * Return the content width of the boxes generated by this FO. + */ + public int getContentWidth() { + if (blockArea != null) + return blockArea.getContentWidth(); //getAllocationWidth()?? + else return 0; // not laid out yet + } + } diff --git a/src/org/apache/fop/fo/flow/ListItemBody.java b/src/org/apache/fop/fo/flow/ListItemBody.java index b98b33db4..fd7b1dfd2 100644 --- a/src/org/apache/fop/fo/flow/ListItemBody.java +++ b/src/org/apache/fop/fo/flow/ListItemBody.java @@ -90,10 +90,7 @@ public class ListItemBody extends FObj { int numChildren = this.children.size(); for (int i = this.marker; i < numChildren; i++) { FObj fo = (FObj) children.elementAt(i); - fo.setIsInListBody(); - fo.setDistanceBetweenStarts(this.distanceBetweenStarts); - fo.setLabelSeparation(this.labelSeparation); - fo.setBodyIndent(this.bodyIndent); + Status status; if ((status = fo.layout(area)).isIncomplete()) { this.marker = i; diff --git a/src/org/apache/fop/fo/flow/ListItemLabel.java b/src/org/apache/fop/fo/flow/ListItemLabel.java index b06eb7d73..4e481cca3 100644 --- a/src/org/apache/fop/fo/flow/ListItemLabel.java +++ b/src/org/apache/fop/fo/flow/ListItemLabel.java @@ -92,11 +92,6 @@ public class ListItemLabel extends FObj { Block block = (Block) children.elementAt(0); - block.setIsInLabel(); - block.setDistanceBetweenStarts(this.distanceBetweenStarts); - block.setLabelSeparation(this.labelSeparation); - block.setBodyIndent(this.bodyIndent); - Status status; status = block.layout(area); area.addDisplaySpace(-block.getAreaHeight()); -- 2.39.5