cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr LineLayoutManager.java

2004-11-15 Thread spepping
spepping2004/11/15 12:58:20

  Modified:src/java/org/apache/fop/layoutmgr LineLayoutManager.java
  Log:
  A quick and dirty hack to prevent the IndexOutOfBoundsException
  reported in bug 32174.
  
  Revision  ChangesPath
  1.34  +6 -0  
xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
  
  Index: LineLayoutManager.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- LineLayoutManager.java13 Nov 2004 20:37:17 -  1.33
  +++ LineLayoutManager.java15 Nov 2004 20:58:20 -  1.34
  @@ -480,6 +480,12 @@
   }
   knuthPar.endParagraph();
   
  +// emergency patch
  +if (knuthParagraphs.size() == 0) {
  +setFinished(true);
  +return null;
  +}
  +
   // find the optimal line breaking points for each paragraph
   ListIterator paragraphsIterator
   = knuthParagraphs.listIterator(knuthParagraphs.size());
  
  
  

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



cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr RetrieveMarkerLayoutManager.java

2004-11-15 Thread spepping
spepping2004/11/15 13:01:40

  Modified:src/java/org/apache/fop/layoutmgr
RetrieveMarkerLayoutManager.java
  Log:
  Made RetrieveMarkerLM implement InlineLevelLM.
  
  Revision  ChangesPath
  1.16  +66 -1 
xml-fop/src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java
  
  Index: RetrieveMarkerLayoutManager.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- RetrieveMarkerLayoutManager.java  13 Nov 2004 20:37:17 -  1.15
  +++ RetrieveMarkerLayoutManager.java  15 Nov 2004 21:01:40 -  1.16
  @@ -30,7 +30,9 @@
   /**
* LayoutManager for a block FO.
*/
  -public class RetrieveMarkerLayoutManager extends AbstractLayoutManager {
  +public class RetrieveMarkerLayoutManager extends AbstractLayoutManager 
  +implements InlineLevelLayoutManager {
  +
   private RetrieveMarker fobj;
   
   private LayoutManager replaceLM = null;
  @@ -67,6 +69,9 @@
   return replaceLM.getNextBreakPoss(context);
   }
   
  +/**
  + * @see 
org.apache.fop.layoutmgr.InlineLevelLayoutManager#getNextKnuthElements
  + */
   public LinkedList getNextKnuthElements(LayoutContext context,
   int alignment) {
   loadLM();
  @@ -75,6 +80,66 @@
   }
   return ((InlineLevelLayoutManager) replaceLM)
  .getNextKnuthElements(context, alignment);
  +}
  +
  +/**
  + * @see 
org.apache.fop.layoutmgr.InlineLevelLayoutManager#addALetterSpaceTo
  + */
  +public KnuthElement addALetterSpaceTo(KnuthElement element) {
  +loadLM();
  +if (replaceLM == null) {
  +return null;
  +}
  +return ((InlineLevelLayoutManager) replaceLM)
  +.addALetterSpaceTo(element);
  +}
  +
  +/**
  + * @see org.apache.fop.layoutmgr.InlineLevelLayoutManager#getWordChars
  + */
  +public void getWordChars(StringBuffer sbChars, Position pos) {
  +loadLM();
  +if (replaceLM != null) {
  +((InlineLevelLayoutManager) replaceLM)
  +.getWordChars(sbChars, pos);
  +}
  +}
  +
  +/**
  + * @see org.apache.fop.layoutmgr.InlineLevelLayoutManager#hyphenate
  + */
  +public void hyphenate(Position pos, HyphContext hc) {
  +loadLM();
  +if (replaceLM != null) {
  +((InlineLevelLayoutManager) replaceLM).hyphenate(pos, hc);
  +}
  +}
  +
  +/**
  + * @see org.apache.fop.layoutmgr.InlineLevelLayoutManager#applyChanges
  + */
  +public boolean applyChanges(List oldList) {
  +loadLM();
  +if (replaceLM == null) {
  +return false;
  +}
  +return ((InlineLevelLayoutManager) replaceLM)
  +.applyChanges(oldList);
  +}
  +
  +/**
  + * @see 
org.apache.fop.layoutmgr.InlineLevelLayoutManager#getChangedKnuthElements
  + */
  +public LinkedList getChangedKnuthElements(List oldList,
  +  int flaggedPenalty,
  +  int alignment) {
  +loadLM();
  +if (replaceLM == null) {
  +return null;
  +}
  +return ((InlineLevelLayoutManager) replaceLM)
  +   .getChangedKnuthElements(oldList, flaggedPenalty,
  +alignment);
   }
   
   public void addAreas(PositionIterator parentIter,
  
  
  

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