aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/area/RegionViewport.java
diff options
context:
space:
mode:
authorGlenn Adams <gadams@apache.org>2012-04-08 23:48:11 +0000
committerGlenn Adams <gadams@apache.org>2012-04-08 23:48:11 +0000
commit279a59e164a87e527e89b283424c394adb254a65 (patch)
treef67ff7f24de2b48399988f6d0408f4992e3aee29 /src/java/org/apache/fop/area/RegionViewport.java
parent92ca968f8c1bb90a6b6110c589c0484e08323ca4 (diff)
downloadxmlgraphics-fop-279a59e164a87e527e89b283424c394adb254a65.tar.gz
xmlgraphics-fop-279a59e164a87e527e89b283424c394adb254a65.zip
Bugzilla #49754: Bring clone() in line with the recommendations in Object.clone().
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1311120 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/area/RegionViewport.java')
-rw-r--r--src/java/org/apache/fop/area/RegionViewport.java23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/java/org/apache/fop/area/RegionViewport.java b/src/java/org/apache/fop/area/RegionViewport.java
index 093b891bc..1b1c5ae7d 100644
--- a/src/java/org/apache/fop/area/RegionViewport.java
+++ b/src/java/org/apache/fop/area/RegionViewport.java
@@ -22,7 +22,6 @@ package org.apache.fop.area;
import java.awt.Rectangle;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
-import java.util.HashMap;
import java.util.TreeMap;
import org.apache.fop.traits.WritingModeTraitsGetter;
@@ -33,7 +32,7 @@ import org.apache.fop.traits.WritingModeTraitsGetter;
* region-reference-area as its child. These areas are described
* in the fo:region-body description in the XSL Recommendation.
*/
-public class RegionViewport extends Area implements Cloneable, Viewport {
+public class RegionViewport extends Area implements Viewport {
private static final long serialVersionUID = 505781815165102572L;
@@ -122,21 +121,11 @@ public class RegionViewport extends Area implements Cloneable, Viewport {
setRegionReference((RegionReference) in.readObject());
}
- /**
- * Clone this region viewport.
- * Used when creating a copy from the page master.
- *
- * @return a new copy of this region viewport
- */
- public Object clone() {
- RegionViewport rv = new RegionViewport((Rectangle2D)viewArea.clone());
- rv.regionReference = (RegionReference)regionReference.clone();
- if (traits != null) {
- rv.traits = new TreeMap(traits);
- }
- if (foreignAttributes != null) {
- rv.foreignAttributes = new HashMap(foreignAttributes);
- }
+ /** {@inheritDoc} */
+ public Object clone() throws CloneNotSupportedException {
+ RegionViewport rv = (RegionViewport) super.clone();
+ rv.regionReference = (RegionReference) regionReference.clone();
+ rv.viewArea = (Rectangle2D) viewArea.clone();
return rv;
}