I do some change in RetrieveMarker code, the first page condition was
forgotten. The RetrieveMarker.layout method
calls RetreiveMarker.locatePrevioussPage which can retrun a nul value when
the page is the first one. I just put a test inside the loop looking for a
page containing a marker.
The code
public Status layout(Area area) throws FOPException {
// locate qualifying areas by 'marker-class-name' and
// 'retrieve-boundary'. Initially we will always check
// the containing page
Page containingPage = area.getPage();
Marker bestMarker = searchPage(containingPage, true);
// if marker not yet found, and 'retrieve-boundary' permits,
// search forward by Page
if ((null == bestMarker) && (retrieveBoundary !=
RetrieveBoundary.PAGE)) {
// System.out.println("Null bestMarker and
searching...");
Page currentPage = containingPage;
boolean isFirstCall = true;
while (bestMarker == null) {
Page previousPage =
locatePreviousPage(currentPage,
retrieveBoundary, isFirstCall);
isFirstCall = false;
// System.out.println("Previous page = '" +
previousPage + "'");
>> // <jcg>
>> if (previousPage == null)
>> break;
>> // </jcg>
bestMarker = searchPage(previousPage, false);
currentPage = previousPage;
}
}
Fop behave correctly, except while no marker are defined. In my test, the
first marker is defined on page 3. There is a problem before when markers
list is empty, and surprisingly, Fop return a warning containing "Warning:
Some static content could not fit in the area." while we expect an empty
data 8-).
Since page I get the true chapter number I desire.
FOP 0.19.0-CVS
using SAX parser org.apache.xerces.parsers.SAXParser
building formatting object tree
setting up fonts
formatting FOs into areas
[1Warning: Some static content could not fit in the area.
] [2Warning: Some static content could not fit in the area.
] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]
[19]
rendering areas to PDF
writing out PDF
Another surprising side effect: the footer contain a page number labelled
Page "x of y". While I get the warning "Some static content..." the page
number is correct (Strings "Page" and "of" are present), but when the Marker
is assigned, the static strings desappear. The values "x" and "y" seem
stuck, but their values are right.
Everything is perfectible.
Bye
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]