Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr AbstractBreaker.java PageSequenceLayoutManager.java

2005-04-27 Thread Glen Mazza
Looks good!
Glen
[EMAIL PROTECTED] wrote:
lfurini 2005/04/27 08:59:59
 Modified:src/java/org/apache/fop/layoutmgr Tag:
   Temp_KnuthStylePageBreaking AbstractBreaker.java
   PageSequenceLayoutManager.java
 Log:
 Using a more clear boolean instead of an int, as suggested by Glen and Andreas
 
 Revision  ChangesPath
 No   revision
 No   revision
 1.1.2.6   +3 -3  xml-fop/src/java/org/apache/fop/layoutmgr/Attic/AbstractBreaker.java
 
 Index: AbstractBreaker.java
 ===
 RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/Attic/AbstractBreaker.java,v
 retrieving revision 1.1.2.5
 retrieving revision 1.1.2.6
 diff -u -r1.1.2.5 -r1.1.2.6
 --- AbstractBreaker.java	26 Apr 2005 16:39:12 -	1.1.2.5
 +++ AbstractBreaker.java	27 Apr 2005 15:59:59 -	1.1.2.6
 @@ -96,7 +96,7 @@
  return (blockLists.size() == 0);
  }
  
 -protected void startPart(BlockSequence list, int localPageNumber) {
 +protected void startPart(BlockSequence list, boolean bIsFirstPage) {
  //nop
  }
  
 @@ -202,7 +202,7 @@
  System.out.println(PLM part:  + (p + 1)
  + , break at position  + endElementIndex);
  
 -startPart(effectiveList, p+1);
 +startPart(effectiveList, (p == 0));
  
  int displayAlign = getCurrentDisplayAlign();
  
 
 
 
 1.50.2.18 +8 -12 xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
 
 Index: PageSequenceLayoutManager.java
 ===
 RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java,v
 retrieving revision 1.50.2.17
 retrieving revision 1.50.2.18
 diff -u -r1.50.2.17 -r1.50.2.18
 --- PageSequenceLayoutManager.java	26 Apr 2005 16:39:12 -	1.50.2.17
 +++ PageSequenceLayoutManager.java	27 Apr 2005 15:59:59 -	1.50.2.18
 @@ -193,7 +193,7 @@
  addAreas(alg, partCount, originalList, effectiveList);
  }
  
 -protected void startPart(BlockSequence list, int localPageNumber) {
 +protected void startPart(BlockSequence list, boolean bIsFirstPage) {
  if (curPage == null) {
  throw new IllegalStateException(curPage must not be null);
  } else {
 @@ -203,16 +203,12 @@
  if (!firstPart) {
  if (curFlowIdx  curPage.getCurrentSpan().getColumnCount()-1) {
  curFlowIdx++;
 -} else if (localPageNumber == 1) {
 -// this is the first page that will be created by
 -// the current BlockSequence: it could have a break
 -// condition that must be satisfied
 -handleBreak(list.getStartOn());
 -} else {
 -// this is NOT the first page that will be created by
 -// the current BlockSequence: we simply need a new
 -// page
 -handleBreak(Constants.EN_PAGE);
 +} else  {
 +// if this is the first page that will be created by
 +// the current BlockSequence, it could have a break
 +// condition that must be satisfied;
 +// otherwise, we simply need a new page
 +handleBreak(bIsFirstPage ? list.getStartOn() : Constants.EN_PAGE);
  }
  }
  }
 
 
 

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




Re: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr AbstractBreaker.java PageSequenceLayoutManager.java

2005-04-26 Thread Glen Mazza
Oops...

--- Glen Mazza [EMAIL PROTECTED] wrote:
 --- [EMAIL PROTECTED] wrote:
 
-protected void startPart(BlockSequence
 list)
  {
+protected void startPart(BlockSequence
 list,
  int localPageNumber) {
 
 boolean isFirstPageByBlock is probably better.
 
 The meaning of localPageNumber to indicate the
 first
 page created by a particular block I think will
 cause
 confusion, 

will cause confusion I think...

Glen



RE: cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr AbstractBreaker.java PageSequenceLayoutManager.java

2005-04-26 Thread Andreas L. Delmelle
 -Original Message-
 From: Glen Mazza [mailto:[EMAIL PROTECTED]

 --- [EMAIL PROTECTED] wrote:
 
-protected void startPart(BlockSequence list)
  {
+protected void startPart(BlockSequence list,
  int localPageNumber) {

 boolean isFirstPageByBlock is probably better.

 The meaning of localPageNumber to indicate the first
 page created by a particular block I think will cause
 confusion, especially when read within PSLM.  Also,
 since the logic only cares about whether or not the
 page is the *first* page being rendered by the block,
 a boolean would appear to better capture the usage of
 this variable.

I agree with this reasoning, and can't seem to come up with situations where
the actual page-count for a given BlockSequence *would* be needed... (could
be that I'm overlooking something)

Along these same lines, the modifications to the code in PSLM would yield
the more compact:

...
} else {
// (comment on the following line of code)
handleBreak(isFirstByBlock ? list.getStartOn() : Constants.EN_PAGE);
}
...


Cheers,

Andreas