return this.columnGap;
}
+ int getContentIPD() {
+ RegionViewport rv = getRegionViewport();
+ return getIPD() - rv.getBorderAndPaddingWidthStart() - rv.getBorderAndPaddingWidthEnd();
+ }
+
+ public int getColumnIPD() {
+ return (getContentIPD() - (columnCount - 1) * columnGap) / columnCount;
+ }
+
/**
* Get the main reference area.
*
//Remove the current one if it is empty
spanAreas.remove(spanAreas.size() - 1);
}
- RegionViewport rv = parent.getRegionViewport();
- int ipdWidth = parent.getIPD()
- - rv.getBorderAndPaddingWidthStart() - rv.getBorderAndPaddingWidthEnd();
-
Span newSpan = new Span(((spanAll) ? 1 : getColumnCount()),
- getColumnGap(), ipdWidth);
+ getColumnGap(), parent.getContentIPD());
spanAreas.add(newSpan);
return getCurrentSpan();
}
this.flowMap.clear();
}
+ public SimplePageMaster getLastSimplePageMaster(int page, boolean isFirstPage, boolean isBlank) {
+ boolean isOddPage = ((page % 2) != 0); // please findbugs...
+ log.debug("getNextSimplePageMaster(page=" + page + " isOdd=" + isOddPage + " isFirst="
+ + isFirstPage + " isLast=true" + " isBlank=" + isBlank + ")");
+ if (pageSequenceMaster == null) {
+ return simplePageMaster;
+ }
+ return pageSequenceMaster.getLastSimplePageMaster(isOddPage, isFirstPage, isBlank, getMainFlow()
+ .getFlowName());
+ }
}
return FO_PAGE_SEQUENCE_MASTER;
}
+ public SimplePageMaster getLastSimplePageMaster(boolean isOddPage, boolean isFirstPage, boolean isBlank,
+ String flowName) {
+ if (currentSubSequence == null) {
+ currentSubSequence = getNextSubSequence();
+ if (currentSubSequence == null) {
+ blockLevelEventProducer.missingSubsequencesInPageSequenceMaster(this, masterName,
+ getLocator());
+ }
+ if (currentSubSequence.isInfinite() && !currentSubSequence.canProcess(flowName)) {
+ throw new PageProductionException(
+ "The current sub-sequence will not terminate whilst processing the main flow");
+ }
+ }
+
+ SimplePageMaster pageMaster = currentSubSequence.getLastPageMaster(isOddPage, isFirstPage, isBlank,
+ blockLevelEventProducer);
+ return pageMaster;
+ }
}
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
import org.apache.fop.fo.properties.Property;
+import org.apache.fop.layoutmgr.BlockLevelEventProducer;
/**
* Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_repeatable-page-master-alternatives">
return null;
}
+ public SimplePageMaster getLastPageMaster(boolean isOddPage, boolean isFirstPage, boolean isBlankPage,
+ BlockLevelEventProducer blockLevelEventProducer) {
+ for (ConditionalPageMasterReference cpmr : conditionalPageMasterRefs) {
+ if (cpmr.isValid(isOddPage, isFirstPage, true, isBlankPage)) {
+ return cpmr.getMaster();
+ }
+ }
+ blockLevelEventProducer.lastPageMasterReferenceMissing(this, getLocator());
+ for (ConditionalPageMasterReference cpmr : conditionalPageMasterRefs) {
+ if (cpmr.isValid(isOddPage, isFirstPage, false, isBlankPage)) {
+ return cpmr.getMaster();
+ }
+ }
+ throw new PageProductionException("Last page master not found: oddpage=" + isOddPage
+ + " firstpage=" + isFirstPage + " blankpage=" + isBlankPage);
+ }
/**
* Adds a new conditional page master reference.
return master;
}
+ public SimplePageMaster getLastPageMaster(boolean isOddPage, boolean isFirstPage, boolean isEmptyPage,
+ BlockLevelEventProducer blockLevelEventProducer) {
+ return getNextPageMaster(isOddPage, isFirstPage, true, isEmptyPage);
+ }
+
/**
* Get the value of the <code>maximum-repeats</code> property.
* @return the "maximum-repeats" property
*/
private FOEventHandler foEventHandler;
+ private PageSequence lastSeq;
+
+ public void setLastSeq(PageSequence seq) {
+ lastSeq = seq;
+ }
+
+ public PageSequence getLastSeq() {
+ return lastSeq;
+ }
+
/**
* Base constructor
*
}
}
+ public SimplePageMaster getLastPageMaster(boolean isOddPage, boolean isFirstPage, boolean isBlankPage,
+ BlockLevelEventProducer blockLevelEventProducer) {
+ return getNextPageMaster(isOddPage, isFirstPage, true, isBlankPage);
+ }
+
/** {@inheritDoc} */
public void reset() {
this.state = FIRST;
package org.apache.fop.fo.pagination;
import org.apache.fop.fo.ValidationException;
+import org.apache.fop.layoutmgr.BlockLevelEventProducer;
/**
* Classes that implement this interface can be added to a {@link PageSequenceMaster},
boolean isBlankPage)
throws PageProductionException;
+ SimplePageMaster getLastPageMaster(boolean isOddPage, boolean isFirstPage, boolean isBlankPage,
+ BlockLevelEventProducer blockLevelEventProducer)
+ throws PageProductionException;
+
/**
* Called before a new page sequence is rendered so subsequences can reset
* any state they keep during the formatting process.
/** logging instance */
protected static final Log log = LogFactory.getLog(AbstractBreaker.class);
+ private LayoutManager originalRestartAtLM;
+ private Position positionAtBreak;
+ private List firstElementsForRestart;
+
/**
* A page break position.
*/
alg.setConstantLineWidth(flowBPD);
int optimalPageCount = alg.findBreakingPoints(blockList, 1, true,
BreakingAlgorithm.ALL_BREAKS);
-
+ boolean ipdChangesOnNextPage = (alg.getIPDdifference() != 0);
+ boolean onLastPageAndIPDChanges = false;
+ if (!ipdChangesOnNextPage) {
+ onLastPageAndIPDChanges = (lastPageHasIPDChange() && !thereIsANonRestartableLM(alg)
+ && (shouldRedoLayout() || (wasLayoutRedone() && optimalPageCount > 1)));
+ }
if (alg.handlingFloat()) {
nextSequenceStartsOn = handleFloatLayout(alg, optimalPageCount, blockList, childLC);
- } else if (Math.abs(alg.getIPDdifference()) > 1) {
- addAreas(alg, optimalPageCount, blockList, blockList);
- // *** redo Phase 1 ***
- log.trace("IPD changes after page " + optimalPageCount);
+ } else if (ipdChangesOnNextPage || onLastPageAndIPDChanges) {
+ boolean visitedBefore = false;
+ if (onLastPageAndIPDChanges) {
+ visitedBefore = wasLayoutRedone();
+ prepareToRedoLayout(alg, optimalPageCount, blockList, blockList);
+ }
+
+ firstElementsForRestart = null;
+ LayoutManager restartAtLM = getRestartAtLM(alg, ipdChangesOnNextPage, onLastPageAndIPDChanges,
+ visitedBefore, blockList, 1);
+ if (restartAtLM == null) {
+ firstElementsForRestart = null;
+ restartAtLM = getRestartAtLM(alg, ipdChangesOnNextPage, onLastPageAndIPDChanges,
+ visitedBefore, blockList, 0);
+ }
+ if (ipdChangesOnNextPage) {
+ addAreas(alg, optimalPageCount, blockList, blockList);
+ }
blockLists.clear();
- nextSequenceStartsOn = getNextBlockListChangedIPD(childLC, alg,
- blockList);
blockListIndex = -1;
+ nextSequenceStartsOn = getNextBlockList(childLC, Constants.EN_COLUMN, positionAtBreak,
+ restartAtLM, firstElementsForRestart);
} else {
log.debug("PLM> optimalPageCount= " + optimalPageCount
+ " pageBreaks.size()= " + alg.getPageBreaks().size());
blockLists = null;
}
+ private LayoutManager getRestartAtLM(PageBreakingAlgorithm alg, boolean ipdChangesOnNextPage,
+ boolean onLastPageAndIPDChanges, boolean visitedBefore,
+ BlockSequence blockList, int start) {
+ KnuthNode optimalBreak = ipdChangesOnNextPage ? alg.getBestNodeBeforeIPDChange() : alg
+ .getBestNodeForLastPage();
+ if (onLastPageAndIPDChanges && visitedBefore && this.originalRestartAtLM == null) {
+ optimalBreak = null;
+ }
+
+ int positionIndex = (optimalBreak != null) ? optimalBreak.position : start;
+ KnuthElement elementAtBreak = alg.getElement(positionIndex);
+ if (elementAtBreak.getPosition() == null) {
+ elementAtBreak = alg.getElement(0);
+ }
+ positionAtBreak = elementAtBreak.getPosition();
+ /* Retrieve the original position wrapped into this space position */
+ positionAtBreak = positionAtBreak.getPosition();
+ if (ipdChangesOnNextPage || (positionAtBreak != null && positionAtBreak.getIndex() > -1)) {
+ firstElementsForRestart = Collections.EMPTY_LIST;
+ if (ipdChangesOnNextPage) {
+ if (containsNonRestartableLM(positionAtBreak)) {
+ if (alg.getIPDdifference() > 0) {
+ EventBroadcaster eventBroadcaster = getCurrentChildLM().getFObj()
+ .getUserAgent().getEventBroadcaster();
+ BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Provider
+ .get(eventBroadcaster);
+ eventProducer.nonRestartableContentFlowingToNarrowerPage(this);
+ }
+ firstElementsForRestart = new LinkedList();
+ boolean boxFound = false;
+ Iterator iter = blockList.listIterator(positionIndex + 1);
+ Position position = null;
+ while (iter.hasNext()
+ && (position == null || containsNonRestartableLM(position))) {
+ positionIndex++;
+ KnuthElement element = (KnuthElement) iter.next();
+ position = element.getPosition();
+ if (element.isBox()) {
+ boxFound = true;
+ firstElementsForRestart.add(element);
+ } else if (boxFound) {
+ firstElementsForRestart.add(element);
+ }
+ }
+ if (position instanceof SpaceResolver.SpaceHandlingBreakPosition) {
+ /* Retrieve the original position wrapped into this space position */
+ positionAtBreak = position.getPosition();
+ } else {
+ positionAtBreak = null;
+ }
+ }
+ }
+ }
+ LayoutManager restartAtLM = null;
+ if (ipdChangesOnNextPage || !(positionAtBreak != null && positionAtBreak.getIndex() > -1)) {
+ if (positionAtBreak != null && positionAtBreak.getIndex() == -1) {
+ Position position;
+ Iterator iter = blockList.listIterator(positionIndex + 1);
+ do {
+ KnuthElement nextElement = (KnuthElement) iter.next();
+ position = nextElement.getPosition();
+ } while (position == null
+ || position instanceof SpaceResolver.SpaceHandlingPosition
+ || position instanceof SpaceResolver.SpaceHandlingBreakPosition
+ && position.getPosition().getIndex() == -1);
+ LayoutManager surroundingLM = positionAtBreak.getLM();
+ while (position.getLM() != surroundingLM) {
+ position = position.getPosition();
+ }
+ restartAtLM = position.getPosition().getLM();
+ }
+ if (onLastPageAndIPDChanges && restartAtLM != null) {
+ if (originalRestartAtLM == null) {
+ originalRestartAtLM = restartAtLM;
+ } else {
+ restartAtLM = originalRestartAtLM;
+ }
+ firstElementsForRestart = Collections.EMPTY_LIST;
+ }
+ }
+ if (onLastPageAndIPDChanges && !visitedBefore && positionAtBreak.getPosition() != null) {
+ restartAtLM = positionAtBreak.getPosition().getLM();
+ }
+ return restartAtLM;
+ }
+
/**
* Returns {@code true} if the given position or one of its descendants
* corresponds to a non-restartable LM.
return nextSequenceStartsOn;
}
- /**
- * @param childLC LayoutContext to use
- * @param alg the pagebreaking algorithm
- * @param effectiveList the list of Knuth elements to be reused
- * @return the page on which the next content should appear after a hard break
- */
- private int getNextBlockListChangedIPD(LayoutContext childLC, PageBreakingAlgorithm alg,
- BlockSequence effectiveList) {
- int nextSequenceStartsOn;
- KnuthNode optimalBreak = alg.getBestNodeBeforeIPDChange();
- int positionIndex = optimalBreak.position;
- log.trace("IPD changes at index " + positionIndex);
- KnuthElement elementAtBreak = alg.getElement(positionIndex);
- Position positionAtBreak = elementAtBreak.getPosition();
- if (!(positionAtBreak instanceof SpaceResolver.SpaceHandlingBreakPosition)) {
- throw new UnsupportedOperationException(
- "Don't know how to restart at position " + positionAtBreak);
- }
- /* Retrieve the original position wrapped into this space position */
- positionAtBreak = positionAtBreak.getPosition();
- LayoutManager restartAtLM = null;
- List<KnuthElement> firstElements = Collections.emptyList();
- if (containsNonRestartableLM(positionAtBreak)) {
- if (alg.getIPDdifference() > 0) {
- EventBroadcaster eventBroadcaster = getCurrentChildLM().getFObj()
- .getUserAgent().getEventBroadcaster();
- BlockLevelEventProducer eventProducer
- = BlockLevelEventProducer.Provider.get(eventBroadcaster);
- eventProducer.nonRestartableContentFlowingToNarrowerPage(this);
- }
- firstElements = new LinkedList<KnuthElement>();
- boolean boxFound = false;
- Iterator<KnuthElement> iter = effectiveList.listIterator(positionIndex + 1);
- Position position = null;
- while (iter.hasNext()
- && (position == null || containsNonRestartableLM(position))) {
- positionIndex++;
- KnuthElement element = iter.next();
- position = element.getPosition();
- if (element.isBox()) {
- boxFound = true;
- firstElements.add(element);
- } else if (boxFound) {
- firstElements.add(element);
- }
- }
- if (position instanceof SpaceResolver.SpaceHandlingBreakPosition) {
- /* Retrieve the original position wrapped into this space position */
- positionAtBreak = position.getPosition();
- } else {
- positionAtBreak = null;
+ protected boolean shouldRedoLayout() {
+ return false;
+ }
+
+ protected void prepareToRedoLayout(PageBreakingAlgorithm alg, int partCount,
+ BlockSequence originalList, BlockSequence effectiveList) {
+ return;
+ }
+
+ protected boolean wasLayoutRedone() {
+ return false;
+ }
+
+ private boolean thereIsANonRestartableLM(PageBreakingAlgorithm alg) {
+ KnuthNode optimalBreak = alg.getBestNodeForLastPage();
+ if (optimalBreak != null) {
+ int positionIndex = optimalBreak.position;
+ KnuthElement elementAtBreak = alg.getElement(positionIndex);
+ Position positionAtBreak = elementAtBreak.getPosition();
+ if (!(positionAtBreak instanceof SpaceResolver.SpaceHandlingBreakPosition)) {
+ return false;
}
- }
- if (positionAtBreak != null && positionAtBreak.getIndex() == -1) {
- /*
- * This is an indication that we are between two blocks
- * (possibly surrounded by another block), not inside a
- * paragraph.
- */
- Position position;
- Iterator<KnuthElement> iter = effectiveList.listIterator(positionIndex + 1);
- do {
- KnuthElement nextElement = iter.next();
- position = nextElement.getPosition();
- } while (position == null
- || position instanceof SpaceResolver.SpaceHandlingPosition
- || position instanceof SpaceResolver.SpaceHandlingBreakPosition
- && position.getPosition().getIndex() == -1);
- LayoutManager surroundingLM = positionAtBreak.getLM();
- while (position.getLM() != surroundingLM) {
- position = position.getPosition();
+ /* Retrieve the original position wrapped into this space position */
+ positionAtBreak = positionAtBreak.getPosition();
+ if (positionAtBreak != null && containsNonRestartableLM(positionAtBreak)) {
+ return true;
}
- restartAtLM = position.getPosition().getLM();
}
+ return false;
+ }
- nextSequenceStartsOn = getNextBlockList(childLC, Constants.EN_COLUMN,
- positionAtBreak, restartAtLM, firstElements);
- return nextSequenceStartsOn;
+ protected boolean lastPageHasIPDChange() {
+ return false;
}
protected int handleFloatLayout(PageBreakingAlgorithm alg, int optimalPageCount, BlockSequence blockList,
if (curPage != null) {
finishPage();
}
+
+ while (forcePageCount != Constants.EN_NO_FORCE && getCurrentPageNum() < getLastPageNumber()) {
+ curPage = makeNewPage(true);
+ finishPage();
+ }
}
/** {@inheritDoc} */
throw new IllegalStateException();
}
+ protected int getLastPageNumber() {
+ return currentPageNum;
+ }
}
* @event.severity WARN
*/
void nonRestartableContentFlowingToNarrowerPage(Object source);
+
+ /**
+ * A feasible layout has reached the given number of parts (columns or pages).
+ *
+ * @param source the event source
+ * @param partCount the number of parts that the layout has reached
+ * @event.severity INFO
+ */
+ void layoutHasReachedParts(Object source, int partCount);
+
+ /**
+ * Last page master reference missing.
+ *
+ * @param source the event source
+ * @event.severity WARN
+ */
+ void lastPageMasterReferenceMissing(Object source, Locator loc);
}
<message key="missingSubsequencesInPageSequenceMaster">No subsequences in page-sequence-master "{pageSequenceMasterName}".{{locator}}</message>
<message key="noMatchingPageMaster">No simple-page-master matching "{pageMasterName}" in page-sequence-master "{pageSequenceMasterName}".{{locator}}</message>
<message key="nonRestartableContentFlowingToNarrowerPage">Content that cannot handle IPD changes is flowing to a narrower page. Part of it may be clipped by the page border.</message>
+ <message key="layoutHasReachedParts">A layout has reached {partCount} part(s).</message>
+ <message key="lastPageMasterReferenceMissing">page-position="last" master reference missing.{{locator}}</message>
</catalogue>
private PageProvider pageProvider;
private Block separatorArea;
private boolean spanAllActive;
+ private boolean layoutRedone;
+ private int previousIndex;
private boolean handlingStartOfFloat;
private boolean handlingEndOfFloat;
private int floatHeight;
/** {@inheritDoc} */
protected int getNextBlockList(LayoutContext childLC, int nextSequenceStartsOn,
Position positionAtIPDChange, LayoutManager restartLM, List firstElements) {
- if (!handlingFloat()) {
+ if (!layoutRedone && !handlingFloat()) {
if (!firstPart) {
// if this is the first page that will be created by
// the current BlockSequence, it could have a break
return;
}
- boolean lastPageMasterDefined = pslm.getPageSequence().hasPagePositionLast()
- || pslm.getPageSequence().hasPagePositionOnly() && pslm.isOnFirstPage(partCount - 1);
- if (!hasMoreContent()) {
- //last part is reached
- if (lastPageMasterDefined) {
- //last-page condition
- redoLayout(alg, partCount, originalList, effectiveList);
- return;
- }
+ if (shouldRedoLayout(partCount)) {
+ redoLayout(alg, partCount, originalList, effectiveList);
+ return;
}
//nothing special: just add the areas now
addAreas(alg, partCount, originalList, effectiveList);
}
+ protected void prepareToRedoLayout(PageBreakingAlgorithm alg, int partCount,
+ BlockSequence originalList,
+ BlockSequence effectiveList) {
+ int newStartPos = 0;
+ int restartPoint = pageProvider.getStartingPartIndexForLastPage(partCount);
+ if (restartPoint > 0 && !layoutRedone) {
+ // Add definitive areas for the parts before the
+ // restarting point
+ addAreas(alg, restartPoint, originalList, effectiveList);
+ // Get page break from which we restart
+ PageBreakPosition pbp = alg.getPageBreaks().get(restartPoint - 1);
+ newStartPos = alg.par.getFirstBoxIndex(pbp.getLeafPos() + 1);
+ // Handle page break right here to avoid any side-effects
+ if (newStartPos > 0) {
+ handleBreakTrait(Constants.EN_PAGE);
+ }
+ }
+ pageBreakHandled = true;
+ // Update so the available BPD is reported correctly
+ int currentPageNum = pslm.getCurrentPageNum();
+ int currentColumn = pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex();
+ pageProvider.setStartOfNextElementList(currentPageNum, currentColumn, spanAllActive);
+
+ // Make sure we only add the areas we haven't added already
+ effectiveList.ignoreAtStart = newStartPos;
+ if (!layoutRedone) {
+ // Handle special page-master for last page
+ setLastPageIndex(currentPageNum);
+// BodyRegion lastBody = pageProvider.getPage(false, currentPageNum).getPageViewport().getBodyRegion();
+ pslm.setCurrentPage(pageProvider.getPage(false, currentPageNum));
+ previousIndex = pageProvider.getIndexOfCachedLastPage();
+ } else {
+ setLastPageIndex(currentPageNum + 1);
+// pslm.setCurrentPage(previousPage);
+ pageProvider.discardCacheStartingWith(previousIndex);
+ pslm.setCurrentPage(pageProvider.getPage(false, currentPageNum));
+ }
+ layoutRedone = true;
+ }
+
/**
* Restart the algorithm at the break corresponding to the given partCount. Used to
* re-do the part after the last break in case of either column-balancing or a last
return;
case Constants.EN_COLUMN:
case Constants.EN_AUTO:
+ case Constants.EN_PAGE:
case -1:
PageViewport pv = curPage.getPageViewport();
log.trace("Forcing new page with span");
curPage = pslm.makeNewPage(false);
curPage.getPageViewport().createSpan(true);
- } else if (pv.getCurrentSpan().hasMoreFlows()) {
- log.trace("Moving to next flow");
- pv.getCurrentSpan().moveToNextFlow();
} else {
- log.trace("Making new page");
- /*curPage = */pslm.makeNewPage(false);
+ if (breakVal == Constants.EN_PAGE) {
+ handleBreakBeforeFollowingPage(breakVal);
+ } else {
+ if (pv.getCurrentSpan().hasMoreFlows()) {
+ log.trace("Moving to next flow");
+ pv.getCurrentSpan().moveToNextFlow();
+ } else {
+ log.trace("Making new page");
+ pslm.makeNewPage(false);
+ }
+ }
}
return;
- case Constants.EN_PAGE:
default:
- log.debug("handling break-before after page " + pslm.getCurrentPageNum()
- + " breakVal=" + getBreakClassName(breakVal));
- if (needBlankPageBeforeNew(breakVal)) {
- log.trace("Inserting blank page");
- /*curPage = */pslm.makeNewPage(true);
- }
- if (needNewPage(breakVal)) {
- log.trace("Making new page");
- /*curPage = */pslm.makeNewPage(false);
- }
+ handleBreakBeforeFollowingPage(breakVal);
+ }
+ }
+
+ private void handleBreakBeforeFollowingPage(int breakVal) {
+ log.debug("handling break-before after page " + pslm.getCurrentPageNum() + " breakVal="
+ + getBreakClassName(breakVal));
+ if (needBlankPageBeforeNew(breakVal)) {
+ log.trace("Inserting blank page");
+ /* curPage = */pslm.makeNewPage(true);
+ }
+ if (needNewPage(breakVal)) {
+ log.trace("Making new page");
+ /* curPage = */pslm.makeNewPage(false);
}
}
}
}
+ protected boolean shouldRedoLayout() {
+ return shouldRedoLayout(-1);
+ }
+
+ protected boolean shouldRedoLayout(int partCount) {
+ boolean lastPageMasterDefined = pslm.getPageSequence().hasPagePositionLast();
+ if (!lastPageMasterDefined && partCount != -1) {
+ lastPageMasterDefined = pslm.getPageSequence().hasPagePositionOnly() && pslm.isOnFirstPage(partCount - 1);
+ }
+ return (!hasMoreContent() && lastPageMasterDefined && !layoutRedone);
+ }
+
+ protected boolean wasLayoutRedone() {
+ return layoutRedone;
+ }
+
+ protected boolean lastPageHasIPDChange() {
+ boolean lastPageMasterDefined = pslm.getPageSequence().hasPagePositionLast();
+ boolean onlyPageMasterDefined = pslm.getPageSequence().hasPagePositionOnly();
+ if (lastPageMasterDefined && !onlyPageMasterDefined) {
+ // code not very robust and unable to handle situations were only and last are defined
+ int currentIPD = this.pageProvider.getCurrentIPD();
+ int lastPageIPD = this.pageProvider.getLastPageIPD();
+ if (lastPageIPD != -1 && currentIPD != lastPageIPD) {
+ return true;
+ }
+ }
+ return false;
+ }
+
protected boolean handlingStartOfFloat() {
return handlingStartOfFloat;
}
private int ipdDifference;
private KnuthNode bestNodeForIPDChange;
+ public KnuthNode bestNodeForLastPage;
//Used to keep track of switches in keep-context
private int currentKeepContext = Constants.EN_AUTO;
* the IPD change. No need to do any special handling.
*/
ipdDifference = 0;
+ } else if (line > 0 /*&& (bestNodeForLastPage == null
+ || node.totalDemerits < bestNodeForLastPage.totalDemerits)*/) {
+ bestNodeForLastPage = node;
}
super.addNode(line, node);
}
return pageProvider.compareIPDs(line);
}
+ KnuthNode getBestNodeForLastPage() {
+ return bestNodeForLastPage;
+ }
+
protected boolean handlingFloat() {
return (handlingStartOfFloat || handlingEndOfFloat);
}
return 0;
} else {
Page nextPage = getPage(false, column.pageIndex + 1, RELTO_CURRENT_ELEMENT_LIST);
- return column.page.getPageViewport().getBodyRegion().getIPD()
- - nextPage.getPageViewport().getBodyRegion().getIPD();
+ return column.page.getPageViewport().getBodyRegion().getColumnIPD()
+ - nextPage.getPageViewport().getBodyRegion().getColumnIPD();
}
}
return page;
}
- private void discardCacheStartingWith(int index) {
+ protected void discardCacheStartingWith(int index) {
while (index < cachedPages.size()) {
this.cachedPages.remove(cachedPages.size() - 1);
if (!pageSeq.goToPreviousSimplePageMaster()) {
page.getPageViewport().setForeignAttributes(spm.getForeignAttributes());
page.getPageViewport().setWritingModeTraits(pageSeq);
cachedPages.add(page);
+ if (isLastPage) {
+ pageSeq.getRoot().setLastSeq(pageSeq);
+ } else if (!isFirstPage) {
+ pageSeq.getRoot().setLastSeq(null);
+ }
return page;
}
+ public int getIndexOfCachedLastPage() {
+ return indexOfCachedLastPage;
+ }
+
+ public int getLastPageIndex() {
+ return lastPageIndex;
+ }
+
+ public int getLastPageIPD() {
+ int index = this.cachedPages.size();
+ boolean isFirstPage = (startPageOfPageSequence == index);
+ SimplePageMaster spm = pageSeq.getLastSimplePageMaster(index, isFirstPage, false);
+ Page page = new Page(spm, index, "", false, false);
+ if (pageSeq.getRoot().getLastSeq() != null && pageSeq.getRoot().getLastSeq() != pageSeq) {
+ return -1;
+ }
+ return page.getPageViewport().getBodyRegion().getColumnIPD();
+ }
+
+ public int getCurrentIPD() {
+ return getPageFromColumnIndex(startColumnOfCurrentElementList).getPageViewport().getBodyRegion()
+ .getColumnIPD();
+ }
+
/**
* Indicates whether the column/page at the given index is on the first page of the page sequence.
*
return pageProvider.isOnFirstPage(partIndex);
}
+ protected int getLastPageNumber() {
+ return pageProvider.getLastPageIndex();
+ }
+
+ protected int getWidthOfCurrentPage() {
+ if (curPage != null) {
+ return (int) curPage.getPageViewport().getViewArea().getWidth();
+ }
+ return 0;
+ }
/**
* Registers the given footnotes so that they can be added to the current page, before any other footnote.
*
sb.append(")");
return sb.toString();
}
+
+ public Position getPosition() {
+ return this;
+ }
}
<checks>
<eval expected="(P2,par2)" xpath="((/areaTree/pageSequence/pageViewport)[4]//inlineparent[@internal-link])[1]/@internal-link"/>
<eval expected="(P3,par3)" xpath="((/areaTree/pageSequence/pageViewport)[4]//inlineparent[@internal-link])[2]/@internal-link"/>
- <eval expected="(P5,title)" xpath="/areaTree/bookmarkTree/bookmark/@internal-link"/>
+ <eval expected="(P6,title)" xpath="/areaTree/bookmarkTree/bookmark/@internal-link"/>
<eval expected="4" xpath="count(/areaTree/pageSequence/pageViewport)"/>
</checks>
</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ Check that an IPD change is detected when switching from single column to multi-column layout.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page1"
+ page-height="120pt" page-width="320pt" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="page2"
+ page-height="120pt" page-width="320pt" margin="10pt">
+ <fo:region-body column-count="2" column-gap="20pt"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="page"
+ page-height="120pt" page-width="320pt" margin="10pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="pages">
+ <fo:single-page-master-reference master-reference="page1"/>
+ <fo:single-page-master-reference master-reference="page2"/>
+ <fo:repeatable-page-master-reference master-reference="page"/>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="pages">
+ <fo:flow flow-name="xsl-region-body" text-align="justify">
+ <fo:block>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
+ tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et
+ accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus
+ est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
+ diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
+ voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
+ gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
+ amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
+ dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
+ et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
+ amet.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="300000" xpath="//pageViewport[1]//flow/block/@ipd"/>
+ <eval expected="140000" xpath="//pageViewport[2]//flow[1]/block/@ipd"/>
+ <eval expected="140000" xpath="//pageViewport[2]//flow[2]/block/@ipd"/>
+ <eval expected="300000" xpath="//pageViewport[3]//flow/block/@ipd"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that the definition of a special page-master for the last page with a
+ different width that the previous "rest" page causes FOP to redo the line breaking layout.
+ </p>
+ </info>
+ <fo>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="Page-Portrait" page-width="8.5in" page-height="11in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="Page_Landscape" page-width="11in" page-height="8.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="LetterPages">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference page-position="first" master-reference="Page-Portrait"/>
+ <fo:conditional-page-master-reference master-reference="Page_Landscape" page-position="rest"/>
+ <fo:conditional-page-master-reference master-reference="Page-Portrait" page-position="last"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="LetterPages">
+ <fo:flow flow-name="letterPageBody">
+ <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block>
+ <fo:block break-before="page"/>
+ <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block>
+ <fo:block break-before="page"/>
+ <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block>
+ <fo:block>Check this works!</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
+ </fo>
+ <checks>
+ <eval expected="is just some generic text to use for testing. This is just some generic text to use for testing. This is just" xpath="//pageViewport[3]//flow/block[1]/lineArea[2]//text"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that the definition of a special page-master for the last page with a
+ different width that the previous "rest" page causes FOP to redo the line breaking layout.
+ </p>
+ </info>
+ <fo>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="Page-Portrait" page-width="3in" page-height="4.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="Page_Landscape" page-width="4.5in" page-height="3in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="LetterPages">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference page-position="first" master-reference="Page-Portrait"/>
+ <fo:conditional-page-master-reference master-reference="Page_Landscape" page-position="rest"/>
+ <fo:conditional-page-master-reference master-reference="Page-Portrait" page-position="last"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="LetterPages">
+ <fo:flow flow-name="letterPageBody">
+ <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block>
+ <fo:block>Check this works!</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
+ </fo>
+ <checks>
+ <eval expected="is just some generic text" xpath="//pageViewport[3]//flow/block[1]/lineArea[2]//text"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that the definition of a special page-master for the last page with a
+ different width that the previous "rest" page causes FOP to redo the line breaking layout.
+ </p>
+ </info>
+ <fo>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="Page-Portrait" page-width="3in" page-height="4.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="Page_Landscape" page-width="4.5in" page-height="3in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="LetterPages">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference page-position="first" master-reference="Page-Portrait"/>
+ <fo:conditional-page-master-reference master-reference="Page_Landscape" page-position="rest"/>
+ <fo:conditional-page-master-reference master-reference="Page-Portrait" page-position="last"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="LetterPages">
+ <fo:flow flow-name="letterPageBody">
+ <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing.</fo:block>
+ <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing.</fo:block>
+ <fo:block>Check this works!</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
+ </fo>
+ <checks>
+ <eval expected="text to use for testing. This" xpath="//pageViewport[3]//flow/block[1]/lineArea[2]//text"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that the definition of a special page-master for the last page with a
+ different width that the previous "rest" page causes FOP to redo the line breaking layout.
+ </p>
+ </info>
+ <fo>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="Page-First" page-width="3.5in" page-height="3.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body background-color="yellow" margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="Page-Rest" page-width="3.5in" page-height="3.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body background-color="orange" margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="Page-Last" page-width="4.0in" page-height="3.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body background-color="pink" margin-bottom="1.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="LetterPages">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference page-position="first" master-reference="Page-First"/>
+ <fo:conditional-page-master-reference master-reference="Page-Rest" page-position="rest"/>
+ <fo:conditional-page-master-reference master-reference="Page-Last" page-position="last"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="LetterPages">
+ <fo:flow flow-name="letterPageBody">
+ <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing.</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
+ </fo>
+ <checks>
+ <eval expected="testing. This is just some generic text to" xpath="//pageViewport[3]//flow/block[1]/lineArea[2]//text"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that the definition of a special page-master for the last page with a
+ different width that the previous "rest" page causes FOP to redo the line breaking layout.
+ </p>
+ </info>
+ <fo>
+
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:svg="http://www.w3.org/2000/svg" xmlns:th="http://www.thunderhead.com/XSL/Extensions" xmlns:rx="http://www.renderx.com/XSL/Extensions" xmlns:ps="http://xmlgraphics.apache.org/fop/postscript">
+ <fo:layout-master-set>
+ <fo:simple-page-master margin-left="0mm" master-name="PageOneFront" page-width="210mm" page-height="297mm" margin-bottom="6mm" margin-right="10mm" margin-top="0mm">
+
+ <fo:region-body margin-right="60mm" margin-left="25mm" margin-bottom="15mm" margin-top="44mm" region-name="letterPageBody"/>
+
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="PageRest" page-width="210mm" page-height="297mm" margin-bottom="6mm" margin-right="25mm" margin-top="0mm" margin-left="25mm">
+ <fo:region-body margin-top="44mm" margin-bottom="15mm" margin-right="0mm" margin-left="0mm" region-name="letterPageBody"/>
+
+ </fo:simple-page-master>
+
+ <fo:page-sequence-master master-name="LetterPages">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference page-position="first" master-reference="PageOneFront"/>
+ <fo:conditional-page-master-reference page-position="rest" master-reference="PageRest"/>
+ <fo:conditional-page-master-reference blank-or-not-blank="not-blank" page-position="last" master-reference="PageRest"/>
+ <fo:conditional-page-master-reference blank-or-not-blank="blank" page-position="last" master-reference="PageRest"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+
+
+ </fo:layout-master-set>
+ <fo:page-sequence format="1" id="th_default_sequence1" initial-page-number="auto" force-page-count="auto" master-reference="LetterPages">
+
+ <fo:flow flow-name="letterPageBody">
+ <fo:block-container min-height="50mm">
+ <fo:block>
+
+ </fo:block>
+ </fo:block-container>
+ </fo:flow>
+ </fo:page-sequence>
+ <fo:page-sequence format="1" id="th_default_sequence2" initial-page-number="auto" force-page-count="auto" master-reference="LetterPages">
+
+ <fo:flow flow-name="letterPageBody">
+ <fo:block-container min-height="50mm">
+ <fo:block>
+ <fo:table table-layout="fixed" width="100%">
+ <fo:table-column column-width="98%" column-number="1"/>
+ <fo:table-column column-width="1%" column-number="2"/>
+ <fo:table-column column-width="1%" column-number="3"/>
+ <fo:table-body>
+ <fo:table-row height="10mm">
+ <fo:table-cell number-columns-spanned="3">
+ <fo:block>test</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row height="29.5mm">
+ <fo:table-cell column-number="1">
+ <fo:block/>
+ </fo:table-cell>
+ <fo:table-cell column-number="2">
+ <fo:block/>
+ </fo:table-cell>
+ <fo:table-cell column-number="3">
+ <fo:block/>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:block>
+ </fo:block-container>
+
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="test" xpath="//word"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that the definition of a special page-master for the last page with a
+ different width that the previous "rest" page causes FOP to redo the line breaking layout.
+ </p>
+ </info>
+ <fo>
+
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:svg="http://www.w3.org/2000/svg" xmlns:th="http://www.thunderhead.com/XSL/Extensions" xmlns:rx="http://www.renderx.com/XSL/Extensions">
+ <fo:layout-master-set>
+ <fo:simple-page-master margin-right="10mm" margin-left="0mm" margin-bottom="6mm" master-name="PageFront" page-width="210mm" page-height="297mm" margin-top="0mm">
+ <fo:region-body background-color="blue" margin-right="60mm" margin-left="25mm" margin-top="44mm" margin-bottom="15mm" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master margin-right="25mm" margin-left="25mm" margin-bottom="6mm" master-name="PageRest" page-width="210mm" page-height="297mm" margin-top="0mm">
+ <fo:region-body background-color="red" margin-top="44mm" margin-bottom="15mm" margin-right="0mm" margin-left="0mm" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master margin-right="25mm" margin-left="25mm" margin-bottom="6mm" master-name="PageLast" page-width="210mm" page-height="297mm" margin-top="0mm">
+ <fo:region-body background-color="green" margin-top="44mm" margin-bottom="15mm" margin-right="0mm" margin-left="0mm" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="LetterPages">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference page-position="first" master-reference="PageFront"/>
+ <fo:conditional-page-master-reference blank-or-not-blank="not-blank" page-position="rest" master-reference="PageRest"/>
+ <fo:conditional-page-master-reference blank-or-not-blank="not-blank" page-position="last" master-reference="PageLast"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence format="1" id="th_default_sequence1" initial-page-number="auto" force-page-count="auto" master-reference="LetterPages">
+ <fo:flow flow-name="letterPageBody">
+ <fo:block>page 1</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ <fo:page-sequence format="1" id="th_default_sequence2" initial-page-number="auto" force-page-count="auto" master-reference="LetterPages">
+ <fo:flow flow-name="letterPageBody">
+ <fo:block>page 2</fo:block>
+ <fo:block break-before="page">page 3</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
+
+ </fo>
+ <checks>
+ <eval expected="color=#008000" xpath="/areaTree/pageSequence[2]/pageViewport[2]/page/regionViewport[1]/@background"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that the definition of a special page-master for the last page with a
+ different width that the previous "rest" page causes FOP to redo the line breaking layout.
+ </p>
+ </info>
+ <fo>
+
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master margin-left="0mm" margin-right="10mm" margin-bottom="6mm" master-name="PageFront" page-width="210mm" page-height="297mm" margin-top="0mm">
+ <fo:region-body margin-right="60mm" margin-left="25mm" margin-top="44mm" margin-bottom="15mm" region-name="letterPageBody"/>
+
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="PageRest" page-width="210mm" page-height="297mm" margin-bottom="6mm" margin-right="25mm" margin-top="0mm" margin-left="25mm">
+ <fo:region-body margin-top="44mm" margin-bottom="15mm" margin-right="0mm" margin-left="0mm" region-name="letterPageBody"/>
+
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="PageFrontLogoRight" margin-right="10mm" margin-left="25mm" margin-bottom="6mm" page-width="210mm" page-height="297mm" margin-top="0mm">
+ <fo:region-body margin-right="60mm" margin-top="44mm" margin-left="0" margin-bottom="15mm" region-name="letterPageBody"/>
+
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="PageFrontRestMediaType" margin-left="0mm" margin-right="10mm" margin-bottom="6mm" page-width="210mm" page-height="297mm" margin-top="0mm">
+ <fo:region-body margin-right="60mm" margin-top="44mm" margin-left="25mm" margin-bottom="15mm" region-name="letterPageBody"/>
+
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="LetterPages">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference page-position="first" master-reference="PageFront"/>
+ <fo:conditional-page-master-reference page-position="rest" master-reference="PageRest"/>
+ <fo:conditional-page-master-reference page-position="last" master-reference="PageRest"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ <fo:page-sequence-master master-name="LetterPagesMYLocal">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference master-reference="PageFrontRestMediaType" page-position="first"/>
+ <fo:conditional-page-master-reference page-position="rest" master-reference="PageRest"/>
+ <fo:conditional-page-master-reference page-position="last" master-reference="PageRest"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+
+ <fo:page-sequence format="1" id="th_default_sequence1" initial-page-number="auto" force-page-count="auto" master-reference="LetterPages">
+
+ <fo:flow flow-name="letterPageBody">
+ <fo:block>
+
+ <fo:block page-break-after="always">
+ <fo:leader/>
+ </fo:block>
+
+ <fo:block>
+ test
+ </fo:block>
+
+ </fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+ <fo:page-sequence format="1" id="th_default_sequence4" master-reference="LetterPagesMYLocal" initial-page-number="auto" force-page-count="auto">
+
+ <fo:flow flow-name="letterPageBody">
+
+ <fo:block>
+
+ <fo:block page-break-after="always">
+ <fo:leader/>
+ </fo:block>
+ <fo:block page-break-after="always">
+ <fo:leader/>
+ </fo:block>
+ <fo:table table-layout="fixed" width="100%">
+ <fo:table-column column-width="proportional-column-width(100)" column-number="1"/>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell>
+ <fo:block>
+ <fo:table table-layout="fixed" width="100%">
+ <fo:table-column column-width="proportional-column-width(1)" column-number="1"/>
+ <fo:table-column column-width="proportional-column-width(28.49)" column-number="2"/>
+ <fo:table-column column-width="proportional-column-width(21.55)" column-number="3"/>
+ <fo:table-column column-width="proportional-column-width(47.96)" column-number="4"/>
+ <fo:table-column column-width="proportional-column-width(1)" column-number="5"/>
+ <fo:table-body>
+ <fo:table-row height="16px">
+ <fo:table-cell>
+ <fo:block>
+ <fo:block>
+ <fo:leader/>
+ </fo:block>
+ </fo:block>
+ </fo:table-cell>
+ <fo:table-cell number-columns-spanned="3">
+ <fo:block>
+ test
+ </fo:block>
+ </fo:table-cell>
+ <fo:table-cell>
+ <fo:block>
+ <fo:block>
+ <fo:leader/>
+ </fo:block>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell>
+ <fo:block>
+ <fo:block>
+ <fo:leader/>
+ </fo:block>
+ </fo:block>
+ </fo:table-cell>
+
+ </fo:table-row>
+
+
+ </fo:table-body>
+ </fo:table>
+
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:block>
+
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+
+ </fo>
+ <checks>
+ <eval expected="test" xpath="//word"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that the definition of a special page-master for the last page with a
+ different width that the previous "rest" page causes FOP to redo the line breaking layout.
+ </p>
+ </info>
+ <fo>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="Page-Portrait" page-width="8.5in" page-height="11in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="Page_Landscape" page-width="11in" page-height="8.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="LetterPages">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference page-position="first" master-reference="Page-Portrait"/>
+ <fo:conditional-page-master-reference master-reference="Page_Landscape" page-position="rest"/>
+ <fo:conditional-page-master-reference master-reference="Page-Portrait" page-position="last"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="LetterPages">
+ <fo:flow flow-name="letterPageBody">
+ <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block>
+ <fo:block break-before="page"/>
+ <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block>
+ <fo:block break-before="page"/>
+ <fo:table>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell>
+ <fo:block></fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell>
+ <fo:block>A table with first row empty after change in IPD and forced break before page...</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
+ </fo>
+ <checks>
+ <eval expected="A table with first row empty after change in IPD and forced break before page..." xpath="//pageViewport[3]//lineArea"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that the definition of a special page-master for the last page with a
+ different width that the previous "rest" page causes FOP to redo the line breaking layout.
+ </p>
+ </info>
+ <fo>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="Page-Portrait" page-width="8.5in" page-height="11in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="Page_Landscape" page-width="11in" page-height="8.5in" margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in">
+ <fo:region-body margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="LetterPages">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference page-position="first" master-reference="Page-Portrait"/>
+ <fo:conditional-page-master-reference master-reference="Page_Landscape" page-position="rest"/>
+ <fo:conditional-page-master-reference master-reference="Page-Portrait" page-position="last"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence master-reference="LetterPages">
+ <fo:flow flow-name="letterPageBody">
+ <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block>
+ <fo:block break-before="page"/>
+ <fo:block>This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. This is just some generic text to use for testing. </fo:block>
+ <fo:block break-after="page"/>
+ <fo:table>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell>
+ <fo:block></fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell>
+ <fo:block>A table with first row empty after change in IPD and forced break after page...</fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
+ </fo>
+ <checks>
+ <eval expected="A table with first row empty after change in IPD and forced break after page..." xpath="//pageViewport[3]//lineArea"/>
+ </checks>
+</testcase>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+ <info>
+ <p>
+ This test checks that the definition of a special page-master for the last page does not
+ interfere with the changing IPD code.
+ </p>
+ </info>
+ <fo>
+ <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
+ <fo:layout-master-set>
+ <fo:simple-page-master margin-right="0mm" margin-top="4mm" margin-left="7mm" margin-bottom="8mm" master-name="PageFront" page-width="210mm" page-height="297mm">
+ <fo:region-body margin-right="20mm" region-name="letterPageBody" margin-top="46mm" margin-left="26mm" margin-bottom="10mm"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master margin-right="0mm" margin-top="4mm" margin-left="7mm" master-name="PageRest" page-width="210mm" page-height="297mm" margin-bottom="8mm">
+ <fo:region-body margin-right="20mm" margin-top="35mm" margin-left="13mm" region-name="letterPageBody" margin-bottom="10mm"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master margin-right="0mm" master-name="PageBlank" margin-top="4mm" margin-left="7mm" page-width="210mm" page-height="297mm" margin-bottom="8mm">
+ <fo:region-body margin-right="20mm" margin-top="38mm" margin-bottom="12mm" margin-left="26mm" region-name="letterPageBody"/>
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="LetterPages">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference page-position="first" master-reference="PageFront"/>
+ <fo:conditional-page-master-reference page-position="rest" master-reference="PageRest"/>
+ <fo:conditional-page-master-reference blank-or-not-blank="not-blank" odd-or-even="even" page-position="last" master-reference="PageRest"/>
+ <fo:conditional-page-master-reference blank-or-not-blank="blank" odd-or-even="even" page-position="last" master-reference="PageBlank"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence format="1" id="th_default_sequence1" initial-page-number="auto" force-page-count="end-on-even" master-reference="LetterPages">
+
+ <fo:flow flow-name="letterPageBody">
+ <fo:block>
+ <fo:table table-layout="fixed">
+ <fo:table-body>
+ <fo:table-row height="30mm">
+ <fo:table-cell width="157mm">
+ <fo:block/>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row height="199mm" display-align="after">
+ <fo:table-cell width="157mm">
+ <fo:block margin-bottom="0mm"/>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:block>
+ <fo:block>
+ <fo:block font-size="9pt">
+ <fo:leader/>
+ <fo:block break-before="page"/>
+ </fo:block>
+ </fo:block>
+
+ </fo:flow>
+ </fo:page-sequence>
+ </fo:root>
+ </fo>
+ <checks>
+ <eval expected="" xpath="//pageViewport[1]//flow/block[2]//text"/>
+ <eval expected="" xpath="//pageViewport[2]//flow/block[1]//text"/>
+ </checks>
+</testcase>