src/java/org/apache/fop/layoutmgr/PageBreaker.java
private void handleBreakTrait(int breakVal) {
        Page curPage = pslm.getCurrentPage();
        switch (breakVal) {
        case Constants.EN_ALL:
            //break due to span change in multi-column layout
            curPage.getPageViewport().createSpan(true);
            this.spanAllActive = true;
            return;
        case Constants.EN_NONE:
            curPage.getPageViewport().createSpan(false);
            this.spanAllActive = false;
            return;
        case Constants.EN_COLUMN:
        case Constants.EN_AUTO:
        case Constants.EN_PAGE:
        case -1:
            PageViewport pv = curPage.getPageViewport();

            //Check if previous page was spanned
            boolean forceNewPageWithSpan = false;
            RegionBody rb = (RegionBody)curPage.getSimplePageMaster().getRegion(
                    Constants.FO_REGION_BODY);
            forceNewPageWithSpan
                    = (rb.getColumnCount() > 1
                        && pv.getCurrentSpan().getColumnCount() == 1);

            if (forceNewPageWithSpan) {
                log.trace("Forcing new page with span");
                curPage = pslm.makeNewPage(false);
                curPage.getPageViewport().createSpan(true);
            } else {
                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;
        default:
            handleBreakBeforeFollowingPage(breakVal);
        }
    }
/**
     * Depending on the kind of break condition, move to next column
     * or page. May need to make an empty page if next page would
     * not have the desired "handedness".
     * @param breakVal - value of break-before or break-after trait.
     */
Depending on the kind of break condition, move to next column
or page. May need to make an empty page if next page would
not have the desired "handedness".
@param breakVal - value of break-before or break-after trait.
Depending on the kind of break condition move to next column or page . May need to make an empty page if next page would not have the desired " handedness " . @param breakVal - value of break - before or break - after trait .
private void handleBreakTrait(int breakVal) {
        Page curPage = pslm.getCurrentPage();
        switch (breakVal) {
        case Constants.EN_ALL:
            curPage.getPageViewport().createSpan(true);
            this.spanAllActive = true;
            return;
        case Constants.EN_NONE:
            curPage.getPageViewport().createSpan(false);
            this.spanAllActive = false;
            return;
        case Constants.EN_COLUMN:
        case Constants.EN_AUTO:
        case Constants.EN_PAGE:
        case -1:
            PageViewport pv = curPage.getPageViewport();
            boolean forceNewPageWithSpan = false;
            RegionBody rb = (RegionBody)curPage.getSimplePageMaster().getRegion(
                    Constants.FO_REGION_BODY);
            forceNewPageWithSpan
                    = (rb.getColumnCount() > 1
                        && pv.getCurrentSpan().getColumnCount() == 1);
            if (forceNewPageWithSpan) {
                log.trace("Forcing new page with span");
                curPage = pslm.makeNewPage(false);
                curPage.getPageViewport().createSpan(true);
            } else {
                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;
        default:
            handleBreakBeforeFollowingPage(breakVal);
        }
    }
private void handleBreakTrait ( int breakVal ) { Page curPage = pslm . getCurrentPage ( ) ; switch ( breakVal ) { case Constants . EN_ALL : curPage . getPageViewport ( ) . createSpan ( true ) ; this . spanAllActive = true ; return ; case Constants . EN_NONE : curPage . getPageViewport ( ) . createSpan ( false ) ; this . spanAllActive = false ; return ; case Constants . EN_COLUMN : case Constants . EN_AUTO : case Constants . EN_PAGE : case - 1 : PageViewport pv = curPage . getPageViewport ( ) ; boolean forceNewPageWithSpan = false ; RegionBody rb = ( RegionBody ) curPage . getSimplePageMaster ( ) . getRegion ( Constants . FO_REGION_BODY ) ; forceNewPageWithSpan = ( rb . getColumnCount ( ) > 1 && pv . getCurrentSpan ( ) . getColumnCount ( ) == 1 ) ; if ( forceNewPageWithSpan ) { log . trace ( "Forcing new page with span" ) ; curPage = pslm . makeNewPage ( false ) ; curPage . getPageViewport ( ) . createSpan ( true ) ; } else { 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 ; default : handleBreakBeforeFollowingPage ( breakVal ) ; } }
Depending on the kind of break condition, move to next column
 or page.
Depending on the kind of break condition move to next column or page .
//break due to span change in multi-column layout //Check if previous page was spanned