Miller, Iain wrote:
Hi,

Some thoughts on the problems with leader processing.
[..]

Here's some ideas:

If there's a leader in a line, then make the InlineSpaces non resizable, and make the WordArea that was generated by the leader resizable (or expand LeaderArea to cover all leaders, not just the rules).
Thanks for your analysis!
I managed to workaround bug #15936 with making all InlineSpaces non resizable if a LineArea contains a leader. This renders leader.fo a bit different (but IMHO barely recognizable).
(ugly hack attached)

I hope someone else will have a look at this, if not I will commit it and do the release.

Christian
? lib/jimi-1.0.jar
Index: src/org/apache/fop/layout/LineArea.java
===================================================================
RCS file: /home/cvspublic/xml-fop/src/org/apache/fop/layout/Attic/LineArea.java,v
retrieving revision 1.53.2.12
diff -u -r1.53.2.12 LineArea.java
--- src/org/apache/fop/layout/LineArea.java     11 Jan 2003 18:43:04 -0000      
1.53.2.12
+++ src/org/apache/fop/layout/LineArea.java     28 Jan 2003 20:37:29 -0000
@@ -100,11 +100,17 @@
     protected boolean prevOlState = false;
     protected boolean prevLTState = false;
 
+    // workaround for bug #15936
+    private boolean containsLeader = false;
+
     public LineArea(FontState fontState, int lineHeight, int halfLeading,
                     int allocationWidth, int startIndent, int endIndent,
                     LineArea prevLineArea) {
         super(fontState);
 
+        // workaround for bug #15936
+        containsLeader = false;
+        
         this.currentFontState = fontState;
         this.lineHeight = lineHeight;
         this.nominalFontSize = fontState.getFontSize();
@@ -574,6 +580,19 @@
                           int leaderLengthOptimum, int leaderLengthMaximum,
                           int ruleStyle, int ruleThickness,
                           int leaderPatternWidth, int leaderAlignment) {
+
+            // workaround for bug #15936
+            containsLeader = true;
+            // make InlineSpaces non-resizeable if Linearea contains a leader
+            for (int i = 0; i < children.size(); i++ ) {
+                Box b = (Box)children.get(i);
+                if (b instanceof InlineSpace) {
+                    InlineSpace space = (InlineSpace)b;
+                    space.setResizeable(false);
+                }
+            }
+
+                              
         WordArea leaderPatternArea;
         int leaderLength = 0;
         char dot = '.';
@@ -1065,6 +1084,13 @@
     }
 
     public void addInlineSpace(InlineSpace is, int spaceWidth) {
+
+        // workaround for bug #15936
+        // make InlineSpaces non-resizeable if Linearea contains a leader
+        if (containsLeader) {
+            is.setResizeable(false);
+        }
+        
         addChild(is);
         finalWidth += spaceWidth;
         // spaceWidth = 0;

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to