aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/area
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/fop/area')
-rw-r--r--src/java/org/apache/fop/area/AreaTreeParser.java9
-rw-r--r--src/java/org/apache/fop/area/PageViewport.java13
2 files changed, 12 insertions, 10 deletions
diff --git a/src/java/org/apache/fop/area/AreaTreeParser.java b/src/java/org/apache/fop/area/AreaTreeParser.java
index d2af24a01..25d110086 100644
--- a/src/java/org/apache/fop/area/AreaTreeParser.java
+++ b/src/java/org/apache/fop/area/AreaTreeParser.java
@@ -20,6 +20,7 @@
package org.apache.fop.area;
import java.awt.Color;
+import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -38,9 +39,10 @@ import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.sax.TransformerHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
-
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
@@ -48,9 +50,6 @@ import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.DefaultHandler;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import org.apache.xmlgraphics.image.loader.ImageException;
import org.apache.xmlgraphics.image.loader.ImageInfo;
import org.apache.xmlgraphics.image.loader.ImageManager;
@@ -404,7 +403,7 @@ public class AreaTreeParser {
if (currentPageViewport != null) {
throw new IllegalStateException("currentPageViewport must be null");
}
- Rectangle2D viewArea = XMLUtil.getAttributeAsRectangle2D(attributes, "bounds");
+ Rectangle viewArea = XMLUtil.getAttributeAsRectangle(attributes, "bounds");
int pageNumber = XMLUtil.getAttributeAsInt(attributes, "nr", -1);
String key = attributes.getValue("key");
String pageNumberString = attributes.getValue("formatted-nr");
diff --git a/src/java/org/apache/fop/area/PageViewport.java b/src/java/org/apache/fop/area/PageViewport.java
index 321ca4c03..63740386e 100644
--- a/src/java/org/apache/fop/area/PageViewport.java
+++ b/src/java/org/apache/fop/area/PageViewport.java
@@ -20,7 +20,6 @@
package org.apache.fop.area;
import java.awt.Rectangle;
-import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
@@ -48,7 +47,7 @@ import org.apache.fop.fo.pagination.SimplePageMaster;
public class PageViewport extends AreaTreeObject implements Resolvable, Cloneable {
private Page page;
- private Rectangle2D viewArea;
+ private Rectangle viewArea;
private String simplePageMasterName;
/**
@@ -100,6 +99,7 @@ public class PageViewport extends AreaTreeObject implements Resolvable, Cloneabl
public PageViewport(SimplePageMaster spm, int pageNumber, String pageStr, boolean blank) {
this.simplePageMasterName = spm.getMasterName();
setExtensionAttachments(spm.getExtensionAttachments());
+ setForeignAttributes(spm.getForeignAttributes());
this.blank = blank;
int pageWidth = spm.getPageWidth().getValue();
int pageHeight = spm.getPageHeight().getValue();
@@ -118,11 +118,14 @@ public class PageViewport extends AreaTreeObject implements Resolvable, Cloneabl
if (original.extensionAttachments != null) {
setExtensionAttachments(original.extensionAttachments);
}
+ if (original.foreignAttributes != null) {
+ setForeignAttributes(original.foreignAttributes);
+ }
this.pageIndex = original.pageIndex;
this.pageNumber = original.pageNumber;
this.pageNumberString = original.pageNumberString;
this.page = (Page)original.page.clone();
- this.viewArea = (Rectangle2D)original.viewArea.clone();
+ this.viewArea = new Rectangle(original.viewArea);
this.simplePageMasterName = original.simplePageMasterName;
this.blank = original.blank;
}
@@ -135,7 +138,7 @@ public class PageViewport extends AreaTreeObject implements Resolvable, Cloneabl
* @param simplePageMasterName name of the original simple-page-master that generated this page
* @param blank true if this is a blank page
*/
- public PageViewport(Rectangle2D viewArea, int pageNumber, String pageStr,
+ public PageViewport(Rectangle viewArea, int pageNumber, String pageStr,
String simplePageMasterName, boolean blank) {
this.viewArea = viewArea;
this.pageNumber = pageNumber;
@@ -161,7 +164,7 @@ public class PageViewport extends AreaTreeObject implements Resolvable, Cloneabl
* Get the view area rectangle of this viewport.
* @return the rectangle for this viewport
*/
- public Rectangle2D getViewArea() {
+ public Rectangle getViewArea() {
return viewArea;
}