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 ad...@apache.org on 2008/07/03 20:25:02 UTC

svn commit: r673750 - in /xmlgraphics/fop/branches/fop-0_95: src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java test/layoutengine/standard-testcases/marker_page-number-citation_bugzilla45295.xml

Author: adelmelle
Date: Thu Jul  3 11:25:01 2008
New Revision: 673750

URL: http://svn.apache.org/viewvc?rev=673750&view=rev
Log:
Fix for Bugzilla 45295 (already committed to the trunk with r672010, r672495 and r672496)

Added:
    xmlgraphics/fop/branches/fop-0_95/test/layoutengine/standard-testcases/marker_page-number-citation_bugzilla45295.xml   (with props)
Modified:
    xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java

Modified: xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java?rev=673750&r1=673749&r2=673750&view=diff
==============================================================================
--- xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java (original)
+++ xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java Thu Jul  3 11:25:01 2008
@@ -21,6 +21,7 @@
 
 import java.awt.Color;
 
+import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
 
 import org.apache.fop.apps.FOPException;
@@ -101,9 +102,9 @@
     }
 
     /** {@inheritDoc} */
-    protected void startOfNode() throws FOPException {
-        super.startOfNode();
-        if (refId.equals("")) {
+    public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList pList) throws FOPException {
+        super.processNode(elementName, locator, attlist, pList);
+        if (!inMarker() && (refId == null || "".equals(refId))) {
             missingPropertyError("ref-id");
         }
     }

Added: xmlgraphics/fop/branches/fop-0_95/test/layoutengine/standard-testcases/marker_page-number-citation_bugzilla45295.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/fop-0_95/test/layoutengine/standard-testcases/marker_page-number-citation_bugzilla45295.xml?rev=673750&view=auto
==============================================================================
--- xmlgraphics/fop/branches/fop-0_95/test/layoutengine/standard-testcases/marker_page-number-citation_bugzilla45295.xml (added)
+++ xmlgraphics/fop/branches/fop-0_95/test/layoutengine/standard-testcases/marker_page-number-citation_bugzilla45295.xml Thu Jul  3 11:25:01 2008
@@ -0,0 +1,95 @@
+<?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 for resolution of forward references in 
+      fo:markers, as reported in Bugzilla 45295.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="first"
+              margin-right="1.5cm"
+              margin-left="1.5cm"
+              margin-bottom="2cm"
+              margin-top="1cm"
+              page-width="21cm"
+              page-height="29.7cm">
+          <fo:region-body margin-top="1cm"/>
+          <fo:region-before extent="1cm"/>
+          <fo:region-after extent="1.5cm"/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="first" initial-page-number="1">
+        <fo:static-content flow-name="xsl-region-before">
+          <fo:block-container height="1cm" width="15cm" top="0cm" left="0cm" position="absolute">
+            <fo:block>
+              <fo:retrieve-marker retrieve-class-name="message"
+                                  retrieve-boundary="page"
+                                  retrieve-position="first-starting-within-page"/>
+            </fo:block>
+          </fo:block-container>
+          <fo:block-container height="1cm" width="15cm" top="0cm" left="0cm" position="absolute">
+            <fo:block>
+              <fo:retrieve-marker retrieve-class-name="term"
+                                  retrieve-boundary="page"
+                                  retrieve-position="last-ending-within-page"/>
+            </fo:block>
+          </fo:block-container>
+        </fo:static-content>
+        <fo:static-content flow-name="xsl-region-after">
+          <fo:block text-align="start" font-size="10pt" font-family="serif" line-height="1em + 2pt">
+            Page (<fo:page-number/> / <fo:page-number-citation ref-id="end-of-document"/>)
+          </fo:block>
+        </fo:static-content>
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block>
+            <fo:marker marker-class-name="message">
+              <fo:block>
+                WARNING: Page sequence contains:  <fo:page-number-citation id="pnc1" ref-id="end-of-document"/> pages.
+              </fo:block>
+            </fo:marker>
+          </fo:block>
+          <fo:block text-align="start" font-size="12pt" font-family="sans-serif">
+            This page sequence has more than one page so you will see the message only at the top of the first page.
+          </fo:block>
+          <fo:block break-before="page" text-align="start" font-size="12pt" font-family="sans-serif">
+            Some text.
+          </fo:block>
+          <fo:block break-before="page" text-align="start" font-size="12pt" font-family="sans-serif">
+            Some text.
+          </fo:block>
+          <fo:block break-before="page" text-align="start" font-size="12pt" font-family="sans-serif">
+            Some more text on last page.
+          </fo:block>
+          <fo:block id="end-of-document">
+            <fo:marker marker-class-name="term">
+                [marker content]
+            </fo:marker>
+          </fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <true xpath="//text[@prod-id='pnc1'][1]/word = '4'" />
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/branches/fop-0_95/test/layoutengine/standard-testcases/marker_page-number-citation_bugzilla45295.xml
------------------------------------------------------------------------------
    svn:keywords = Id



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