CVS: jfor/src/org/jfor/jfor/rtflib/rtfdoc RtfPage.java,1.2,1.3

Marra Roberto <[email protected]> Tue, 18 Feb 2003 08:09:24 -0800
Newsgroups gmane.text.xml.jfor.cvs
Message-ID <[email protected]>
Update of /cvsroot/jfor/jfor/src/org/jfor/jfor/rtflib/rtfdoc
In directory sc8-pr-cvs1:/tmp/cvs-serv28934/src/org/jfor/jfor/rtflib/rtfdoc

Modified Files:
	RtfPage.java 
Log Message:
Contributions Bob Hablutzel 
Fixed to emit "landscape" control work if page width is greater than page height.

Index: RtfPage.java
===================================================================
RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/rtflib/rtfdoc/RtfPage.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RtfPage.java	12 Jul 2002 08:08:31 -0000	1.2
--- RtfPage.java	18 Feb 2003 16:09:20 -0000	1.3
***************
*** 66,69 ****
--- 66,73 ----
  // $Id$
  // $Log$
+ // Revision 1.3  2003/02/18 16:09:20  rmarra
+ // Contributions Bob Hablutzel 
+ // Fixed to emit "landscape" control work if page width is greater than page height.
+ //
  // Revision 1.2  2002/07/12 08:08:31  bdelacretaz
  // License changed to jfor Apache-style license
***************
*** 102,107 ****
  	/** RtfPage writes the attributes the attributes contained in the string
  		PAGE_ATTR, if not null */
! 	protected void writeRtfContent() throws IOException {
  		writeAttributes(m_attrib, PAGE_ATTR);
  	}
  	
--- 106,123 ----
  	/** RtfPage writes the attributes the attributes contained in the string
  		PAGE_ATTR, if not null */
! 		protected void writeRtfContent() throws IOException {
  		writeAttributes(m_attrib, PAGE_ATTR);
+         
+         if (m_attrib != null)
+         {
+             Object widthRaw = m_attrib.getValue( PAGE_WIDTH );
+             Object heightRaw = m_attrib.getValue( PAGE_HEIGHT );
+             
+             if ((widthRaw instanceof Integer) && (heightRaw instanceof Integer) &&
+                 ((Integer) widthRaw).intValue() > ((Integer) heightRaw).intValue())
+             {
+                 writeControlWord( "landscape" );
+             }
+         }   
  	}
  	



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf