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 je...@apache.org on 2006/01/20 13:53:00 UTC

svn commit: r370798 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/render/rtf/PageAttributesConverter.java src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java status.xml

Author: jeremias
Date: Fri Jan 20 04:52:50 2006
New Revision: 370798

URL: http://svn.apache.org/viewcvs?rev=370798&view=rev
Log:
RTF output did not generate the "\landscape" tag when necessary.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java
    xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java?rev=370798&r1=370797&r2=370798&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java Fri Jan 20 04:52:50 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2004,2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -53,6 +53,13 @@
             attrib.setTwips(RtfPage.PAGE_WIDTH, pagemaster.getPageWidth());
             attrib.setTwips(RtfPage.PAGE_HEIGHT, pagemaster.getPageHeight());
             
+            Object widthRaw = attrib.getValue(RtfPage.PAGE_WIDTH);
+            Object heightRaw = attrib.getValue(RtfPage.PAGE_HEIGHT);
+            if ((widthRaw instanceof Integer) && (heightRaw instanceof Integer)
+                    && ((Integer) widthRaw).intValue() > ((Integer) heightRaw).intValue()) {
+                attrib.set(RtfPage.LANDSCAPE);
+            }
+
             Length pageTop = pagemaster.getCommonMarginBlock().marginTop;
             Length pageBottom = pagemaster.getCommonMarginBlock().marginBottom;
             Length pageLeft = pagemaster.getCommonMarginBlock().marginLeft;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java?rev=370798&r1=370797&r2=370798&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPage.java Fri Jan 20 04:52:50 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2004,2006 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -44,6 +44,9 @@
     /** constant for page height */
     public static final String PAGE_HEIGHT = "paperh";
 
+    /** constant for landscape format */
+    public static final String LANDSCAPE = "landscape";
+
     /** constant for top margin */
     public static final String MARGIN_TOP = "margt";
     /** constant for bottom margin */
@@ -60,7 +63,7 @@
 
     /** String array of RtfPage attributes */
     public static final String[] PAGE_ATTR = new String[]{
-        PAGE_WIDTH, PAGE_HEIGHT, MARGIN_TOP, MARGIN_BOTTOM,
+        PAGE_WIDTH, PAGE_HEIGHT, LANDSCAPE, MARGIN_TOP, MARGIN_BOTTOM,
         MARGIN_LEFT, MARGIN_RIGHT, HEADERY, FOOTERY
     };
 
@@ -71,12 +74,12 @@
         attrib = attrs;
     }
 
-        /**
-         * RtfPage writes the attributes the attributes contained in the string
-         * PAGE_ATTR, if not null
-         * @throws IOException for I/O problems
-         */
-        protected void writeRtfContent() throws IOException {
+    /**
+     * RtfPage writes the attributes the attributes contained in the string
+     * PAGE_ATTR, if not null
+     * @throws IOException for I/O problems
+     */
+    protected void writeRtfContent() throws IOException {
         writeAttributes(attrib, PAGE_ATTR);
 
         if (attrib != null) {
@@ -85,7 +88,7 @@
 
             if ((widthRaw instanceof Integer) && (heightRaw instanceof Integer)
                     && ((Integer) widthRaw).intValue() > ((Integer) heightRaw).intValue()) {
-                writeControlWord("landscape");
+                writeControlWord(LANDSCAPE);
             }
         }
     }

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/status.xml?rev=370798&r1=370797&r2=370798&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Fri Jan 20 04:52:50 2006
@@ -28,6 +28,10 @@
   <changes>
     <release version="FOP Trunk">
       <action context="Code" dev="JM" type="fix">
+        The RTF output now properly generates the "\landscape" flag for documents in 
+        landscape orientation.
+      </action>
+      <action context="Code" dev="JM" type="fix">
         Following a clarification by the XSL FO SG, space traits are only set on the 
         first and last area generated by an FO, and not on every area anymore.
       </action>



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