xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lfur...@apache.org
Subject svn commit: r674489 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java status.xml test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml
Date Mon, 07 Jul 2008 13:52:36 GMT
Author: lfurini
Date: Mon Jul  7 06:52:36 2008
New Revision: 674489

URL: http://svn.apache.org/viewvc?rev=674489&view=rev
Log:
Fixing absolute positioning of block-containers: bottom and right distances were not taken
into account

Added:
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml
  (with props)
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
    xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java?rev=674489&r1=674488&r2=674489&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
Mon Jul  7 06:52:36 2008
@@ -694,9 +694,17 @@
         int y = 0;
         if (abProps.left.getEnum() != EN_AUTO) {
             x = abProps.left.getValue(this);
+        } else if (abProps.right.getEnum() != EN_AUTO
+                && width.getEnum() != EN_AUTO) {
+            x = getReferenceAreaIPD() 
+                - abProps.right.getValue(this) - width.getValue(this);
         }
         if (abProps.top.getEnum() != EN_AUTO) {
             y = abProps.top.getValue(this);
+        } else if (abProps.bottom.getEnum() != EN_AUTO
+                && height.getEnum() != EN_AUTO) {
+            y = getReferenceAreaBPD()
+                - abProps.bottom.getValue(this) - height.getValue(this);
         }
         return new Point(x, y);
     }
@@ -1085,3 +1093,4 @@
 
 }
 
+

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=674489&r1=674488&r2=674489&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Mon Jul  7 06:52:36 2008
@@ -53,6 +53,10 @@
   
   <changes>
     <release version="FOP Trunk" date="TBD">
+      <action context="Layout" dev="LF" type="fix">
+        Fixed absolute positioning of block-containers when specified
+        using right and bottom instead of left and top.
+      </action>
       <action context="Renderers" dev="AC" type="add">
         Added PDF encryption parameter support in configuration.
       </action>

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml?rev=674489&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml
(added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml
Mon Jul  7 06:52:36 2008
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks absolutely positioned block-containers using top, bottom, left and
right distances
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="simple" page-width="6in" page-height="5in"
margin="0.5in">
+          <fo:region-body margin="0.5in"/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="simple">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block font-size="48pt">position</fo:block>
+          <fo:block font-size="48pt" text-align="right"><fo:inline>NOT</fo:inline>
ok!</fo:block>
+          <fo:block-container absolute-position="absolute" width="51pt" height="30pt"
background-color="red" top="57pt" left="109pt">
+            <!-- nested container -->
+            <fo:block-container absolute-position="absolute" width="5pt" height="5pt"
background-color="white" bottom="20pt" right="41pt">
+              <fo:block></fo:block>
+            </fo:block-container>
+          </fo:block-container>
+          <fo:block-container absolute-position="absolute" width="51pt" height="30pt"
background-color="yellow" top="57pt" right="77pt">
+            <fo:block/>
+          </fo:block-container>
+          <fo:block-container absolute-position="absolute" width="51pt" height="30pt"
background-color="blue" bottom="99pt" left="109pt">
+            <fo:block/>
+          </fo:block-container>
+          <fo:block-container absolute-position="absolute" width="51pt" height="30pt"
background-color="green" bottom="99pt" right="77pt">
+            <fo:block/>
+          </fo:block-container>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <!-- *** first block-container *** -->
+    <true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/@is-viewport-area"/>
+    <eval expected="absolute" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/@positioning"/>
+    <eval expected="109000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/@left-position"/>
+    <eval expected="57000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/@top-position"/>
+
+    <!-- *** nested block-container *** -->
+    <true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/block[1]/block[1]/@is-viewport-area"/>
+    <eval expected="absolute" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/block[1]/block[1]/@positioning"/>
+    <eval expected="5000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/block[1]/block[1]/@left-position"/>
+    <eval expected="5000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[3]/block[1]/block[1]/@top-position"/>
+
+    <!-- *** second block-container *** -->
+    <true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@is-viewport-area"/>
+    <eval expected="absolute" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@positioning"/>
+    <eval expected="160000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@left-position"/>
+    <eval expected="57000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[4]/@top-position"/>
+
+    <!-- *** third block-container *** -->
+    <true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[5]/@is-viewport-area"/>
+    <eval expected="absolute" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[5]/@positioning"/>
+    <eval expected="109000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[5]/@left-position"/>
+    <eval expected="87000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[5]/@top-position"/>
+
+    <!-- *** fourth block-container *** -->
+    <true xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[6]/@is-viewport-area"/>
+    <eval expected="absolute" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[6]/@positioning"/>
+    <eval expected="160000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[6]/@left-position"/>
+    <eval expected="87000" xpath="/areaTree/pageSequence/pageViewport/page[1]/regionViewport/regionBody/mainReference/span/flow/block[6]/@top-position"/>
+
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/block-container_absolute-position_tblr.xml
------------------------------------------------------------------------------
    svn:keywords = Revision Id



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message