aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/area
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2008-02-06 14:07:03 +0000
committerJeremias Maerki <jeremias@apache.org>2008-02-06 14:07:03 +0000
commit448befc115b005dc2a07391182179c686a91d25f (patch)
treeb658d79ef2bbd433580a089758d5ecb945c52166 /src/java/org/apache/fop/area
parent36c62fb27612261f81eb8de02f1754a3d662cea4 (diff)
downloadxmlgraphics-fop-448befc115b005dc2a07391182179c686a91d25f.tar.gz
xmlgraphics-fop-448befc115b005dc2a07391182179c686a91d25f.zip
Bugzilla #36391:
Fixed problem with positioning of content when reference-orientation="180" is used. CTM is now correct. It is updated after the height of the content is known. Instead of somehow inverting the element list, I've simply declared this case non-breakable, i.e. I generate one box. Fixed a few other problems mostly occurring when rotating block-container content by 90 or 270 degrees plus a few remaining auto-height handling problems. This involved switching off some sometimes unwanted side-effects from auto-updating the BPD in some area classes. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@618992 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/area')
-rw-r--r--src/java/org/apache/fop/area/Block.java15
-rw-r--r--src/java/org/apache/fop/area/BlockViewport.java9
-rw-r--r--src/java/org/apache/fop/area/NormalFlow.java4
3 files changed, 24 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/area/Block.java b/src/java/org/apache/fop/area/Block.java
index 264a9e690..21fa7c49d 100644
--- a/src/java/org/apache/fop/area/Block.java
+++ b/src/java/org/apache/fop/area/Block.java
@@ -19,7 +19,6 @@
package org.apache.fop.area;
-import java.util.ArrayList;
// block areas hold either more block areas or line
// areas can also be used as a block spacer
@@ -59,6 +58,8 @@ public class Block extends BlockParent {
private int stacking = TB;
private int positioning = STACK;
+ protected transient boolean allowBPDUpdate = true;
+
// a block with may contain the dominant styling info in
// terms of most lines or blocks with info
@@ -78,7 +79,7 @@ public class Block extends BlockParent {
* @param autoHeight increase the height of the block.
*/
public void addBlock(Block block, boolean autoHeight) {
- if (autoHeight) {
+ if (autoHeight && allowBPDUpdate) {
bpd += block.getAllocBPD();
}
addChildArea(block);
@@ -113,12 +114,20 @@ public class Block extends BlockParent {
}
/**
+ * Indicates whether this block is stacked, rather than absolutely positioned.
+ * @return true if it is stacked
+ */
+ public boolean isStacked() {
+ return (getPositioning() == Block.STACK || getPositioning() == Block.RELATIVE);
+ }
+
+ /**
* @return the start-indent trait
*/
public int getStartIndent() {
Integer startIndent = (Integer)getTrait(Trait.START_INDENT);
return (startIndent != null ? startIndent.intValue() : 0);
}
-
+
}
diff --git a/src/java/org/apache/fop/area/BlockViewport.java b/src/java/org/apache/fop/area/BlockViewport.java
index af994afd4..167e7c5b3 100644
--- a/src/java/org/apache/fop/area/BlockViewport.java
+++ b/src/java/org/apache/fop/area/BlockViewport.java
@@ -34,6 +34,15 @@ public class BlockViewport extends Block {
* Create a new block viewport area.
*/
public BlockViewport() {
+ this(false);
+ }
+
+ /**
+ * Create a new block viewport area.
+ * @param allowBPDUpdate true allows the BPD to be updated when children are added
+ */
+ public BlockViewport(boolean allowBPDUpdate) {
+ this.allowBPDUpdate = allowBPDUpdate;
}
/**
diff --git a/src/java/org/apache/fop/area/NormalFlow.java b/src/java/org/apache/fop/area/NormalFlow.java
index 715a61cb0..c9fc8380a 100644
--- a/src/java/org/apache/fop/area/NormalFlow.java
+++ b/src/java/org/apache/fop/area/NormalFlow.java
@@ -37,7 +37,9 @@ public class NormalFlow extends BlockParent {
/** {@inheritDoc} */
public void addBlock(Block block) {
super.addBlock(block);
- bpd += block.getAllocBPD();
+ if (block.isStacked()) {
+ bpd += block.getAllocBPD();
+ }
}
}