You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by lb...@apache.org on 2014/11/26 14:30:11 UTC

svn commit: r1641813 - in /xmlgraphics/fop/branches/Temp_BasicSideFloats: src/java/org/apache/fop/layoutmgr/list/ test/layoutengine/standard-testcases/

Author: lbernardo
Date: Wed Nov 26 13:30:11 2014
New Revision: 1641813

URL: http://svn.apache.org/r1641813
Log:
handle lists when ipd changes across pages

Added:
    xmlgraphics/fop/branches/Temp_BasicSideFloats/test/layoutengine/standard-testcases/flow_changing-ipd_5.xml   (with props)
Modified:
    xmlgraphics/fop/branches/Temp_BasicSideFloats/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
    xmlgraphics/fop/branches/Temp_BasicSideFloats/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
    xmlgraphics/fop/branches/Temp_BasicSideFloats/test/layoutengine/standard-testcases/flow_changing-ipd_4.xml

Modified: xmlgraphics/fop/branches/Temp_BasicSideFloats/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_BasicSideFloats/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java?rev=1641813&r1=1641812&r2=1641813&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_BasicSideFloats/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_BasicSideFloats/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java Wed Nov 26 13:30:11 2014
@@ -277,5 +277,9 @@ public class ListBlockLayoutManager exte
         return getListBlockFO().getKeepWithNext();
     }
 
+    /** {@inheritDoc} */
+    public boolean isRestartable() {
+        return true;
+    }
 }
 

Modified: xmlgraphics/fop/branches/Temp_BasicSideFloats/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_BasicSideFloats/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java?rev=1641813&r1=1641812&r2=1641813&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_BasicSideFloats/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_BasicSideFloats/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java Wed Nov 26 13:30:11 2014
@@ -786,5 +786,10 @@ public class ListItemLayoutManager exten
         breakBefore = BreakUtil.compareBreakClasses(breakBefore, body.getBreakBefore());
         return breakBefore;
     }
+
+    /** {@inheritDoc} */
+    public boolean isRestartable() {
+        return true;
+    }
 }
 

Modified: xmlgraphics/fop/branches/Temp_BasicSideFloats/test/layoutengine/standard-testcases/flow_changing-ipd_4.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_BasicSideFloats/test/layoutengine/standard-testcases/flow_changing-ipd_4.xml?rev=1641813&r1=1641812&r2=1641813&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_BasicSideFloats/test/layoutengine/standard-testcases/flow_changing-ipd_4.xml (original)
+++ xmlgraphics/fop/branches/Temp_BasicSideFloats/test/layoutengine/standard-testcases/flow_changing-ipd_4.xml Wed Nov 26 13:30:11 2014
@@ -19,8 +19,7 @@
 <testcase>
   <info>
     <p>
-      This test checks that non-restartable elements still show up at IPD change, even if not 
-      re-laid out.
+      This test checks that a list can be relaid out when a change in ipd happens across pages.
     </p>
   </info>
   <fo>
@@ -140,13 +139,13 @@
     <eval expected="olden"  xpath="//pageSequence[1]/pageViewport[2]//flow/block[2]//lineArea[1]/text/word[2]"/>
 
     <!-- Second page sequence – list -->
-    <eval expected="300000" xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/@ipd"/>
+    <eval expected="500000" xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/@ipd"/>
     <eval expected="b2_4"   xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/block/block[2]/block/@prod-id"/>
     <eval expected="In"     xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/block/block[2]/block/lineArea[1]/text/word[1]"/>
     <eval expected="olden"  xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/block/block[2]/block/lineArea[1]/text/word[2]"/>
-    <eval expected="was"    xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/block/block[2]/block/lineArea[4]/text/word[position()=last()-1]"/>
+    <eval expected="was"    xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/block/block[2]/block/lineArea[3]/text/word[position()=last()-1]"/>
     <eval expected="astonished…"
-                            xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/block/block[2]/block/lineArea[4]/text/word[position()=last()]"/>
+                            xpath="//pageSequence[2]/pageViewport[2]//flow/block[1]/block/block[2]/block/lineArea[3]/text/word[position()=last()]"/>
 
     <eval expected="b2_5"   xpath="//pageSequence[2]/pageViewport[2]//flow/block[2]/@prod-id"/>
     <eval expected="500000" xpath="//pageSequence[2]/pageViewport[2]//flow/block[2]/@ipd"/>

Added: xmlgraphics/fop/branches/Temp_BasicSideFloats/test/layoutengine/standard-testcases/flow_changing-ipd_5.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_BasicSideFloats/test/layoutengine/standard-testcases/flow_changing-ipd_5.xml?rev=1641813&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_BasicSideFloats/test/layoutengine/standard-testcases/flow_changing-ipd_5.xml (added)
+++ xmlgraphics/fop/branches/Temp_BasicSideFloats/test/layoutengine/standard-testcases/flow_changing-ipd_5.xml Wed Nov 26 13:30:11 2014
@@ -0,0 +1,142 @@
+<?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 that a list can be relaid out when a change in ipd happens across pages.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="narrow" page-height="200pt" page-width="400pt" margin="50pt">
+          <fo:region-body background-color="#F0F0F0"/>
+        </fo:simple-page-master>
+        <fo:simple-page-master master-name="wide" page-height="200pt" page-width="600pt" margin="50pt">
+          <fo:region-body background-color="#F0F0F0"/>
+        </fo:simple-page-master>
+        <fo:page-sequence-master master-name="pages">
+          <fo:single-page-master-reference master-reference="narrow"/>
+          <fo:repeatable-page-master-reference master-reference="wide"/>
+        </fo:page-sequence-master>
+        <fo:page-sequence-master master-name="alternate">
+          <fo:repeatable-page-master-alternatives>
+            <fo:conditional-page-master-reference odd-or-even="odd" master-reference="wide"/>
+            <fo:conditional-page-master-reference odd-or-even="even" master-reference="narrow"/>
+          </fo:repeatable-page-master-alternatives>
+        </fo:page-sequence-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="alternate">
+        <fo:flow flow-name="xsl-region-body">
+      <fo:block widows="1" orphans="1">
+        <fo:list-block>
+          <fo:list-item>
+            <fo:list-item-label end-indent="label-end()">
+              <fo:block>(a)</fo:block>
+            </fo:list-item-label>
+            <fo:list-item-body start-indent="body-start()">
+              <fo:block>
+In olden times when wishing still helped one, there lived a king whose daughters were all beautiful, but the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face.
+              </fo:block>
+            </fo:list-item-body>
+          </fo:list-item>
+          <fo:list-item>
+            <fo:list-item-label end-indent="label-end()">
+              <fo:block>(a)</fo:block>
+            </fo:list-item-label>
+            <fo:list-item-body start-indent="body-start()">
+              <fo:block>
+In olden times when wishing still helped one, there lived a king whose daughters were all beautiful, but the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face.
+              </fo:block>
+            </fo:list-item-body>
+          </fo:list-item>
+          <fo:list-item>
+            <fo:list-item-label end-indent="label-end()">
+              <fo:block>(a)</fo:block>
+            </fo:list-item-label>
+            <fo:list-item-body start-indent="body-start()">
+              <fo:block>
+In olden times when wishing still helped one, there lived a king whose daughters were all beautiful, but the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face.
+              </fo:block>
+            </fo:list-item-body>
+          </fo:list-item>
+          <fo:list-item>
+            <fo:list-item-label end-indent="label-end()">
+              <fo:block>(a)</fo:block>
+            </fo:list-item-label>
+            <fo:list-item-body start-indent="body-start()">
+              <fo:block>
+In olden times when wishing still helped one, there lived a king whose daughters were all beautiful, but the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face.
+              </fo:block>
+            </fo:list-item-body>
+          </fo:list-item>
+          <fo:list-item>
+            <fo:list-item-label end-indent="label-end()">
+              <fo:block>(a)</fo:block>
+            </fo:list-item-label>
+            <fo:list-item-body start-indent="body-start()">
+              <fo:block>
+In olden times when wishing still helped one, there lived a king whose daughters were all beautiful, but the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face.
+              </fo:block>
+            </fo:list-item-body>
+          </fo:list-item>
+          <fo:list-item>
+            <fo:list-item-label end-indent="label-end()">
+              <fo:block>(a)</fo:block>
+            </fo:list-item-label>
+            <fo:list-item-body start-indent="body-start()">
+              <fo:block>
+In olden times when wishing still helped one, there lived a king whose daughters were all beautiful, but the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face.
+              </fo:block>
+            </fo:list-item-body>
+          </fo:list-item>
+          <fo:list-item>
+            <fo:list-item-label end-indent="label-end()">
+              <fo:block>(a)</fo:block>
+            </fo:list-item-label>
+            <fo:list-item-body start-indent="body-start()">
+              <fo:block>
+In olden times when wishing still helped one, there lived a king whose daughters were all beautiful, but the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face.
+              </fo:block>
+            </fo:list-item-body>
+          </fo:list-item>
+          <fo:list-item>
+            <fo:list-item-label end-indent="label-end()">
+              <fo:block>(a)</fo:block>
+            </fo:list-item-label>
+            <fo:list-item-body start-indent="body-start()">
+              <fo:block>
+In olden times when wishing still helped one, there lived a king whose daughters were all beautiful, but the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face.
+              </fo:block>
+            </fo:list-item-body>
+          </fo:list-item>
+        </fo:list-block>
+      </fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <eval expected="In olden times when wishing still helped one, there lived a king whose daughters were all" xpath="//pageViewport[1]/page/regionViewport[1]//flow[1]/block[1]/block[1]/block[1]/block[2]/block[1]/lineArea[1]" />
+    <eval expected="In olden times when wishing still helped one, there" xpath="//pageViewport[2]/page/regionViewport[1]//flow[1]/block[1]/block[1]/block[1]/block[2]/block[1]/lineArea[1]" />
+    <eval expected="lived a king whose daughters were all beautiful, but the youngest was so beautiful that" xpath="//pageViewport[3]/page/regionViewport[1]//flow[1]/block[1]/block[1]/block[1]/block[1]/block[1]/lineArea[1]" />
+    <eval expected="beautiful, but the youngest was so beautiful that the" xpath="//pageViewport[4]/page/regionViewport[1]//flow[1]/block[1]/block[1]/block[1]/block[1]/block[1]/lineArea[1]" />
+    <eval expected="itself, which has seen so much, was astonished whenever it shone in her face." xpath="//pageViewport[5]/page/regionViewport[1]//flow[1]/block[1]/block[1]/block[1]/block[1]/block[1]/lineArea[1]" />
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/branches/Temp_BasicSideFloats/test/layoutengine/standard-testcases/flow_changing-ipd_5.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain



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