View | Details | Raw Unified | Return to bug 46315
Collapse All | Expand All

(-)src/java/org/apache/fop/layoutmgr/PageBreaker.java (-1 / +2 lines)
Lines 108-114 Link Here
108
        if (childLC.getNextSpan() != Constants.NOT_SET) {
108
        if (childLC.getNextSpan() != Constants.NOT_SET) {
109
            //Next block list will have a different span.
109
            //Next block list will have a different span.
110
            nextSequenceStartsOn = childLC.getNextSpan();
110
            nextSequenceStartsOn = childLC.getNextSpan();
111
            needColumnBalancing = (childLC.getNextSpan() == Constants.EN_ALL);
111
            needColumnBalancing = (childLC.getNextSpan() == Constants.EN_ALL)
112
                    && childLC.getFoxNeedsBalancing();
112
        }
113
        }
113
        if (needColumnBalancing) {
114
        if (needColumnBalancing) {
114
            AbstractBreaker.log.debug(
115
            AbstractBreaker.log.debug(
(-)src/java/org/apache/fop/fo/flow/Block.java (+8 lines)
Lines 80-85 Link Here
80
    private int whiteSpaceCollapse;
80
    private int whiteSpaceCollapse;
81
    private Numeric widows;
81
    private Numeric widows;
82
    private int wrapOption;
82
    private int wrapOption;
83
    private int foxNeedsBalancing;
83
    // Unused but valid items, commented out for performance:
84
    // Unused but valid items, commented out for performance:
84
    //     private CommonAccessibility commonAccessibility;
85
    //     private CommonAccessibility commonAccessibility;
85
    //     private CommonAural commonAural;
86
    //     private CommonAural commonAural;
Lines 130-135 Link Here
130
        whiteSpaceCollapse = pList.get(PR_WHITE_SPACE_COLLAPSE).getEnum();
131
        whiteSpaceCollapse = pList.get(PR_WHITE_SPACE_COLLAPSE).getEnum();
131
        widows = pList.get(PR_WIDOWS).getNumeric();
132
        widows = pList.get(PR_WIDOWS).getNumeric();
132
        wrapOption = pList.get(PR_WRAP_OPTION).getEnum();
133
        wrapOption = pList.get(PR_WRAP_OPTION).getEnum();
134
        foxNeedsBalancing = pList.get(PR_X_NEEDS_BALANCING).getEnum();
133
    }
135
    }
134
136
135
    /** {@inheritDoc} */
137
    /** {@inheritDoc} */
Lines 318-323 Link Here
318
        return this.lineHeightShiftAdjustment;
320
        return this.lineHeightShiftAdjustment;
319
    }
321
    }
320
322
323
     /** @return the "foxNeedsBalancing" property */
324
     public int getFoxNeedsBalancing() {
325
         return foxNeedsBalancing;
326
     }
327
328
321
    /** {@inheritDoc} */
329
    /** {@inheritDoc} */
322
    public CharIterator charIterator() {
330
    public CharIterator charIterator() {
323
        return NullCharIterator.getInstance();
331
        return NullCharIterator.getInstance();
(-)src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java (+1 lines)
Lines 117-122 Link Here
117
            // set space after for each LM, in order to implement
117
            // set space after for each LM, in order to implement
118
            // display-align = distribute
118
            // display-align = distribute
119
            lc.setSpaceAfter(layoutContext.getSpaceAfter());
119
            lc.setSpaceAfter(layoutContext.getSpaceAfter());
120
            lc.setFoxNeedsBalancing(layoutContext.getFoxNeedsBalancing());
120
            lc.setStackLimitsFrom(layoutContext);
121
            lc.setStackLimitsFrom(layoutContext);
121
            childLM.addAreas(childPosIter, lc);
122
            childLM.addAreas(childPosIter, lc);
122
        }
123
        }
(-)src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java (-1 / +1 lines)
Lines 247-253 Link Here
247
            lc.setSpaceAfter(layoutContext.getSpaceAfter());
247
            lc.setSpaceAfter(layoutContext.getSpaceAfter());
248
        }
248
        }
249
        PositionIterator childPosIter;
249
        PositionIterator childPosIter;
250
250
        lc.setFoxNeedsBalancing(layoutContext.getFoxNeedsBalancing());
251
        // "unwrap" the NonLeafPositions stored in parentIter
251
        // "unwrap" the NonLeafPositions stored in parentIter
252
        // and put them in a new list;
252
        // and put them in a new list;
253
        LinkedList positionList = new LinkedList();
253
        LinkedList positionList = new LinkedList();
(-)src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java (+1 lines)
Lines 731-736 Link Here
731
        if (layoutContext.getSpaceAfter() > 0) {
731
        if (layoutContext.getSpaceAfter() > 0) {
732
            lc.setSpaceAfter(layoutContext.getSpaceAfter());
732
            lc.setSpaceAfter(layoutContext.getSpaceAfter());
733
        }
733
        }
734
        lc.setFoxNeedsBalancing(layoutContext.getFoxNeedsBalancing());
734
        BlockContainerPosition bcpos = null;
735
        BlockContainerPosition bcpos = null;
735
        PositionIterator childPosIter;
736
        PositionIterator childPosIter;
736
737
(-)src/java/org/apache/fop/fo/Constants.java (-1 / +3 lines)
Lines 766-773 Link Here
766
    int PR_X_WIDOW_CONTENT_LIMIT = 271;
766
    int PR_X_WIDOW_CONTENT_LIMIT = 271;
767
    /** Property constant - FOP proprietary: limit for orphan content in lists and tables */
767
    /** Property constant - FOP proprietary: limit for orphan content in lists and tables */
768
    int PR_X_ORPHAN_CONTENT_LIMIT = 272;
768
    int PR_X_ORPHAN_CONTENT_LIMIT = 272;
769
    /** Property constant - FOP proprietary: Balancing needed */
770
    int PR_X_NEEDS_BALANCING = 273;
769
    /** Number of property constants defined */
771
    /** Number of property constants defined */
770
    int PROPERTY_COUNT = 272;
772
    int PROPERTY_COUNT = 273;
771
773
772
    // compound property constants
774
    // compound property constants
773
775
(-)src/java/org/apache/fop/fo/pagination/Flow.java (+9 lines)
Lines 35-40 Link Here
35
public class Flow extends FObj {
35
public class Flow extends FObj {
36
    // The value of properties relevant for fo:flow.
36
    // The value of properties relevant for fo:flow.
37
    private String flowName;
37
    private String flowName;
38
    private int foxNeedsBalancing;
38
    // End of property values
39
    // End of property values
39
40
40
    /** used for FO validation */
41
    /** used for FO validation */
Lines 52-57 Link Here
52
    public void bind(PropertyList pList) throws FOPException {
53
    public void bind(PropertyList pList) throws FOPException {
53
        super.bind(pList);
54
        super.bind(pList);
54
        flowName = pList.get(PR_FLOW_NAME).getString();
55
        flowName = pList.get(PR_FLOW_NAME).getString();
56
        foxNeedsBalancing = pList.get(PR_X_NEEDS_BALANCING).getEnum();
55
    }
57
    }
56
58
57
    /** {@inheritDoc} */
59
    /** {@inheritDoc} */
Lines 120-125 Link Here
120
        return flowName;
122
        return flowName;
121
    }
123
    }
122
124
125
    /** @return "fox-needs-balancing" property. */
126
    public int getFoxNeedsBalancing() {
127
        return foxNeedsBalancing;
128
    }
129
    public boolean hasFoxNeedsBalancing() {
130
        return EN_TRUE == foxNeedsBalancing;
131
    }
123
    /** {@inheritDoc} */
132
    /** {@inheritDoc} */
124
    public String getLocalName() {
133
    public String getLocalName() {
125
        return "flow";
134
        return "flow";
(-)src/java/org/apache/fop/layoutmgr/LayoutContext.java (-2 / +10 lines)
Lines 170-175 Link Here
170
        this.pendingKeepWithNext = parentLC.pendingKeepWithNext;
170
        this.pendingKeepWithNext = parentLC.pendingKeepWithNext;
171
        this.pendingKeepWithPrevious = parentLC.pendingKeepWithPrevious;
171
        this.pendingKeepWithPrevious = parentLC.pendingKeepWithPrevious;
172
        // Copy other fields as necessary.
172
        // Copy other fields as necessary.
173
        this.foxNeedsBalancing = parentLC.foxNeedsBalancing;
173
    }
174
    }
174
175
175
    /**
176
    /**
Lines 412-418 Link Here
412
413
413
    /**
414
    /**
414
     * Sets (Copies) the stack limits in both directions from another layout context.
415
     * Sets (Copies) the stack limits in both directions from another layout context.
415
     * @param context the layout context to taje the values from
416
     * @param context the layout context to take the values from
416
     */
417
     */
417
    public void setStackLimitsFrom(LayoutContext context) {
418
    public void setStackLimitsFrom(LayoutContext context) {
418
        setStackLimitBP(context.getStackLimitBP());
419
        setStackLimitBP(context.getStackLimitBP());
Lines 681-685 Link Here
681
        + (breakAfter != Constants.EN_AUTO ? "break-after" : "") + "]";
682
        + (breakAfter != Constants.EN_AUTO ? "break-after" : "") + "]";
682
    }
683
    }
683
684
684
}
685
    private boolean foxNeedsBalancing;
686
    public boolean getFoxNeedsBalancing() {
687
        return foxNeedsBalancing;
688
    }
689
    public void setFoxNeedsBalancing(boolean foxNeedsBalancing) {
690
        this.foxNeedsBalancing=foxNeedsBalancing;
691
    }
692
}
685
693
(-)src/java/org/apache/fop/fo/FOPropertyMapping.java (-1 / +19 lines)
Lines 1648-1653 Link Here
1648
        m.setDefault("wrap");
1648
        m.setDefault("wrap");
1649
        m.addShorthand(s_generics[PR_WHITE_SPACE]);
1649
        m.addShorthand(s_generics[PR_WHITE_SPACE]);
1650
        addPropertyMaker("wrap-option", m);
1650
        addPropertyMaker("wrap-option", m);
1651
1652
        // fox-needs-balancing
1653
        m  = new EnumProperty.Maker(PR_X_NEEDS_BALANCING);
1654
        m.setInherited(true);
1655
        m.addEnum("true", getEnumProperty(EN_TRUE, "TRUE"));
1656
        m.addEnum("false", getEnumProperty(EN_FALSE, "FALSE"));
1657
        m.setDefault("inherit");
1658
        addPropertyMaker("fox-needs-balancing", m);
1659
1651
    }
1660
    }
1652
1661
1653
    private void createCharacterProperties() {
1662
    private void createCharacterProperties() {
Lines 1859-1865 Link Here
1859
        m  = new LengthProperty.Maker(PR_X_ORPHAN_CONTENT_LIMIT);
1868
        m  = new LengthProperty.Maker(PR_X_ORPHAN_CONTENT_LIMIT);
1860
        m.setInherited(true);
1869
        m.setInherited(true);
1861
        m.setDefault("0pt");
1870
        m.setDefault("0pt");
1862
        addPropertyMaker("fox:orphan-content-limit", m);
1871
        addPropertyMaker("fox:orphan-content-limit", m);     
1863
    }
1872
    }
1864
1873
1865
    private void createLayoutProperties() {
1874
    private void createLayoutProperties() {
Lines 2286-2291 Link Here
2286
        m.setInherited(false);
2295
        m.setInherited(false);
2287
        m.setDefault("");
2296
        m.setDefault("");
2288
        addPropertyMaker("region-name", m);
2297
        addPropertyMaker("region-name", m);
2298
2299
        // fox-needs-balancing
2300
        m  = new EnumProperty.Maker(PR_X_NEEDS_BALANCING);
2301
        m.setInherited(true);
2302
        m.addEnum("true", getEnumProperty(EN_TRUE, "TRUE"));
2303
        m.addEnum("false", getEnumProperty(EN_FALSE, "FALSE"));
2304
        m.setDefault("true");
2305
        addPropertyMaker("fox-needs-balancing", m);
2306
2289
    }
2307
    }
2290
2308
2291
    private void createTableProperties() {
2309
    private void createTableProperties() {

Return to bug 46315