aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-01-07 07:55:47 +0000
committerJeremias Maerki <jeremias@apache.org>2005-01-07 07:55:47 +0000
commit4a96fb5584fd9445fae1a649cee2c911ae050e92 (patch)
tree008df1c1a3452f92348891cf6974e0bcf57787e9
parent09ebfbf3592f257ecf00d216f0626fb3039de366 (diff)
downloadxmlgraphics-fop-4a96fb5584fd9445fae1a649cee2c911ae050e92.tar.gz
xmlgraphics-fop-4a96fb5584fd9445fae1a649cee2c911ae050e92.zip
Provide access to the current PageViewport from the outside.
Added a few useful debug log statements. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198246 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
index a94fb03ef..5585ed4e0 100644
--- a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
@@ -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 class PageSequenceLayoutManager extends AbstractLayoutManager {
*/
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 class PageSequenceLayoutManager extends AbstractLayoutManager {
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 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
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 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager {
// 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