ASF Bugzilla – Attachment 22970 Details for
Bug 46315
fox:needs-balancing extension
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Version 1
fox_needs-balancing_incomplete.patch (text/plain), 8.84 KB, created by
Georg Datterl
on 2008-12-01 02:37:55 UTC
(
hide
)
Description:
Version 1
Filename:
MIME Type:
Creator:
Georg Datterl
Created:
2008-12-01 02:37:55 UTC
Size:
8.84 KB
patch
obsolete
>Index: src/java/org/apache/fop/layoutmgr/PageBreaker.java >=================================================================== >--- src/java/org/apache/fop/layoutmgr/PageBreaker.java (revision 721992) >+++ src/java/org/apache/fop/layoutmgr/PageBreaker.java Wed Nov 26 13:40:07 CET 2008 >@@ -108,7 +108,8 @@ > if (childLC.getNextSpan() != Constants.NOT_SET) { > //Next block list will have a different span. > nextSequenceStartsOn = childLC.getNextSpan(); >- needColumnBalancing = (childLC.getNextSpan() == Constants.EN_ALL); >+ needColumnBalancing = (childLC.getNextSpan() == Constants.EN_ALL) >+ && childLC.getFoxNeedsBalancing(); > } > if (needColumnBalancing) { > AbstractBreaker.log.debug( >Index: src/java/org/apache/fop/fo/flow/Block.java >=================================================================== >--- src/java/org/apache/fop/fo/flow/Block.java (revision 721992) >+++ src/java/org/apache/fop/fo/flow/Block.java Wed Nov 26 11:18:09 CET 2008 >@@ -80,6 +80,7 @@ > private int whiteSpaceCollapse; > private Numeric widows; > private int wrapOption; >+ private int foxNeedsBalancing; > // Unused but valid items, commented out for performance: > // private CommonAccessibility commonAccessibility; > // private CommonAural commonAural; >@@ -130,6 +131,7 @@ > whiteSpaceCollapse = pList.get(PR_WHITE_SPACE_COLLAPSE).getEnum(); > widows = pList.get(PR_WIDOWS).getNumeric(); > wrapOption = pList.get(PR_WRAP_OPTION).getEnum(); >+ foxNeedsBalancing = pList.get(PR_X_NEEDS_BALANCING).getEnum(); > } > > /** {@inheritDoc} */ >@@ -318,6 +320,12 @@ > return this.lineHeightShiftAdjustment; > } > >+ /** @return the "foxNeedsBalancing" property */ >+ public int getFoxNeedsBalancing() { >+ return foxNeedsBalancing; >+ } >+ >+ > /** {@inheritDoc} */ > public CharIterator charIterator() { > return NullCharIterator.getInstance(); >Index: src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java >=================================================================== >--- src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java (revision 721992) >+++ src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java Wed Nov 26 12:05:16 CET 2008 >@@ -117,6 +117,7 @@ > // set space after for each LM, in order to implement > // display-align = distribute > lc.setSpaceAfter(layoutContext.getSpaceAfter()); >+ lc.setFoxNeedsBalancing(layoutContext.getFoxNeedsBalancing()); > lc.setStackLimitsFrom(layoutContext); > childLM.addAreas(childPosIter, lc); > } >Index: src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java >=================================================================== >--- src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java (revision 721992) >+++ src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java Wed Nov 26 12:05:16 CET 2008 >@@ -247,7 +247,7 @@ > lc.setSpaceAfter(layoutContext.getSpaceAfter()); > } > PositionIterator childPosIter; >- >+ lc.setFoxNeedsBalancing(layoutContext.getFoxNeedsBalancing()); > // "unwrap" the NonLeafPositions stored in parentIter > // and put them in a new list; > LinkedList positionList = new LinkedList(); >Index: src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java >=================================================================== >--- src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java (revision 721992) >+++ src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java Wed Nov 26 12:05:16 CET 2008 >@@ -731,6 +731,7 @@ > if (layoutContext.getSpaceAfter() > 0) { > lc.setSpaceAfter(layoutContext.getSpaceAfter()); > } >+ lc.setFoxNeedsBalancing(layoutContext.getFoxNeedsBalancing()); > BlockContainerPosition bcpos = null; > PositionIterator childPosIter; > >Index: src/java/org/apache/fop/fo/Constants.java >=================================================================== >--- src/java/org/apache/fop/fo/Constants.java (revision 721992) >+++ src/java/org/apache/fop/fo/Constants.java Wed Nov 26 15:24:59 CET 2008 >@@ -766,8 +766,10 @@ > int PR_X_WIDOW_CONTENT_LIMIT = 271; > /** Property constant - FOP proprietary: limit for orphan content in lists and tables */ > int PR_X_ORPHAN_CONTENT_LIMIT = 272; >+ /** Property constant - FOP proprietary: Balancing needed */ >+ int PR_X_NEEDS_BALANCING = 273; > /** Number of property constants defined */ >- int PROPERTY_COUNT = 272; >+ int PROPERTY_COUNT = 273; > > // compound property constants > >Index: src/java/org/apache/fop/fo/pagination/Flow.java >=================================================================== >--- src/java/org/apache/fop/fo/pagination/Flow.java (revision 721992) >+++ src/java/org/apache/fop/fo/pagination/Flow.java Mon Dec 01 08:56:31 CET 2008 >@@ -35,6 +35,7 @@ > public class Flow extends FObj { > // The value of properties relevant for fo:flow. > private String flowName; >+ private int foxNeedsBalancing; > // End of property values > > /** used for FO validation */ >@@ -52,6 +53,7 @@ > public void bind(PropertyList pList) throws FOPException { > super.bind(pList); > flowName = pList.get(PR_FLOW_NAME).getString(); >+ foxNeedsBalancing = pList.get(PR_X_NEEDS_BALANCING).getEnum(); > } > > /** {@inheritDoc} */ >@@ -120,6 +122,13 @@ > return flowName; > } > >+ /** @return "fox-needs-balancing" property. */ >+ public int getFoxNeedsBalancing() { >+ return foxNeedsBalancing; >+ } >+ public boolean hasFoxNeedsBalancing() { >+ return EN_TRUE == foxNeedsBalancing; >+ } > /** {@inheritDoc} */ > public String getLocalName() { > return "flow"; >Index: src/java/org/apache/fop/layoutmgr/LayoutContext.java >=================================================================== >--- src/java/org/apache/fop/layoutmgr/LayoutContext.java (revision 721992) >+++ src/java/org/apache/fop/layoutmgr/LayoutContext.java Wed Nov 26 16:21:42 CET 2008 >@@ -170,6 +170,7 @@ > this.pendingKeepWithNext = parentLC.pendingKeepWithNext; > this.pendingKeepWithPrevious = parentLC.pendingKeepWithPrevious; > // Copy other fields as necessary. >+ this.foxNeedsBalancing = parentLC.foxNeedsBalancing; > } > > /** >@@ -412,7 +413,7 @@ > > /** > * Sets (Copies) the stack limits in both directions from another layout context. >- * @param context the layout context to taje the values from >+ * @param context the layout context to take the values from > */ > public void setStackLimitsFrom(LayoutContext context) { > setStackLimitBP(context.getStackLimitBP()); >@@ -681,5 +682,12 @@ > + (breakAfter != Constants.EN_AUTO ? "break-after" : "") + "]"; > } > >+ private boolean foxNeedsBalancing; >+ public boolean getFoxNeedsBalancing() { >+ return foxNeedsBalancing; >-} >+ } >+ public void setFoxNeedsBalancing(boolean foxNeedsBalancing) { >+ this.foxNeedsBalancing=foxNeedsBalancing; >+ } >+} > >Index: src/java/org/apache/fop/fo/FOPropertyMapping.java >=================================================================== >--- src/java/org/apache/fop/fo/FOPropertyMapping.java (revision 721992) >+++ src/java/org/apache/fop/fo/FOPropertyMapping.java Mon Dec 01 11:00:02 CET 2008 >@@ -1648,6 +1648,15 @@ > m.setDefault("wrap"); > m.addShorthand(s_generics[PR_WHITE_SPACE]); > addPropertyMaker("wrap-option", m); >+ >+ // fox-needs-balancing >+ m = new EnumProperty.Maker(PR_X_NEEDS_BALANCING); >+ m.setInherited(true); >+ m.addEnum("true", getEnumProperty(EN_TRUE, "TRUE")); >+ m.addEnum("false", getEnumProperty(EN_FALSE, "FALSE")); >+ m.setDefault("inherit"); >+ addPropertyMaker("fox-needs-balancing", m); >+ > } > > private void createCharacterProperties() { >@@ -1859,7 +1868,7 @@ > m = new LengthProperty.Maker(PR_X_ORPHAN_CONTENT_LIMIT); > m.setInherited(true); > m.setDefault("0pt"); >- addPropertyMaker("fox:orphan-content-limit", m); >+ addPropertyMaker("fox:orphan-content-limit", m); > } > > private void createLayoutProperties() { >@@ -2286,6 +2295,15 @@ > m.setInherited(false); > m.setDefault(""); > addPropertyMaker("region-name", m); >+ >+ // fox-needs-balancing >+ m = new EnumProperty.Maker(PR_X_NEEDS_BALANCING); >+ m.setInherited(true); >+ m.addEnum("true", getEnumProperty(EN_TRUE, "TRUE")); >+ m.addEnum("false", getEnumProperty(EN_FALSE, "FALSE")); >+ m.setDefault("true"); >+ addPropertyMaker("fox-needs-balancing", m); >+ > } > > private void createTableProperties() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 46315
:
22970
|
22971
|
23098