cbowditch 2004/05/20 01:11:31
Modified: src/java/org/apache/fop/layoutmgr BlockLayoutManager.java
Log:
fixed problem with top/bottom borders on regular blocks
Revision Changes Path
1.18 +17 -13
xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
Index: BlockLayoutManager.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- BlockLayoutManager.java 15 May 2004 21:51:59 -0000 1.17
+++ BlockLayoutManager.java 20 May 2004 08:11:31 -0000 1.18
@@ -1,12 +1,12 @@
/*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -49,9 +49,9 @@
private CommonMarginBlock marginProps;
/* holds the (one-time use) fo:block space-before
- and -after properties. Large fo:blocks are split
+ and -after properties. Large fo:blocks are split
into multiple Area.Blocks to accomodate the subsequent
- regions (pages) they are placed on. space-before
+ regions (pages) they are placed on. space-before
is applied at the beginning of the first
Block and space-after at the end of the last Block
used in rendering the fo:block.
@@ -156,7 +156,7 @@
LayoutManager curLM; // currently active LM
int ipd = context.getRefIPD();
- int iIndents = marginProps.startIndent + marginProps.endIndent;
+ int iIndents = marginProps.startIndent + marginProps.endIndent;
int bIndents = borderProps.getBPPaddingAndBorder(false);
ipd -= iIndents;
@@ -178,7 +178,7 @@
// Set context for percentage property values.
fobj.setLayoutDimension(PercentBase.BLOCK_IPD, ipd);
fobj.setLayoutDimension(PercentBase.BLOCK_BPD, -1);
-
+
while ((curLM = getChildLM()) != null) {
// Make break positions and return blocks!
// Set up a LayoutContext
@@ -260,7 +260,7 @@
double adjust = layoutContext.getSpaceAdjust();
addBlockSpacing(adjust, foBlockSpaceBefore);
foBlockSpaceBefore = null;
-
+
addID();
addMarkers(true, true);
@@ -323,13 +323,17 @@
// Get reference IPD from parentArea
int referenceIPD = parentArea.getIPD();
curBlockArea.setIPD(referenceIPD);
-
+
// Set the width of the block based on the parent block
+ // Need to be careful though, if parent is BC then width may not be set
+ int parentwidth = 0;
if (parentArea instanceof BlockParent) {
- curBlockArea.setWidth(((BlockParent) parentArea).getWidth());
- } else {
- curBlockArea.setWidth(referenceIPD);
+ parentwidth = ((BlockParent) parentArea).getWidth();
+ }
+ if (parentwidth == 0) {
+ parentwidth = referenceIPD;
}
+ curBlockArea.setWidth(parentwidth);
setCurrentArea(curBlockArea); // ??? for generic operations
}
return curBlockArea;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]