You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2005/01/07 08:55:47 UTC
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr PageSequenceLayoutManager.java
jeremias 2005/01/06 23:55:47
Modified: src/java/org/apache/fop/layoutmgr
PageSequenceLayoutManager.java
Log:
Provide access to the current PageViewport from the outside.
Added a few useful debug log statements.
Revision Changes Path
1.22 +18 -5 xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
Index: PageSequenceLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- PageSequenceLayoutManager.java 27 Dec 2004 10:13:05 -0000 1.21
+++ PageSequenceLayoutManager.java 7 Jan 2005 07:55:47 -0000 1.22
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -255,7 +255,7 @@
*/
public BreakPoss getNextBreakPoss(LayoutContext context) {
- LayoutManager curLM ; // currently active LM
+ LayoutManager curLM; // currently active LM
while ((curLM = getChildLM()) != null) {
BreakPoss bp = null;
@@ -287,6 +287,14 @@
public String getCurrentPageNumber() {
return pageNumberString;
}
+
+ /**
+ * Provides access to the current page.
+ * @return the current PageViewport
+ */
+ public PageViewport getCurrentPageViewport() {
+ return this.curPage;
+ }
/**
* Resolve a reference ID.
@@ -478,11 +486,15 @@
try {
curPage = createPage(bIsBlank, bIsLast);
isFirstPage = false;
- } catch (FOPException fopex) { /* ???? */
- fopex.printStackTrace();
+ } catch (FOPException fopex) {
+ //TODO this exception is fatal, isn't it?
+ log.error("Cannot create page", fopex);
}
curPage.setPageNumber(getCurrentPageNumber());
+ if (log.isDebugEnabled()) {
+ log.debug("[" + curPage.getPageNumber() + "]");
+ }
RegionViewport rv = curPage.getPage().getRegionViewport(
FO_REGION_BODY);
curBody = (BodyRegion) rv.getRegion();
@@ -575,6 +587,7 @@
// We may be forced to make new page
handleBreak(breakVal);
} else if (curPage == null) {
+ log.debug("curPage is null. Making new page");
makeNewPage(false, false);
}
// Now we should be on the right kind of page
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org