logo       

CVS: jfor/src/org/jfor/jfor/rtflib/rtfdoc RtfHeader.java,1.5,1.6 RtfTemplat: msg#00010

Subject: CVS: jfor/src/org/jfor/jfor/rtflib/rtfdoc RtfHeader.java,1.5,1.6 RtfTemplate.java,1.1,1.2
Update of /cvsroot/jfor/jfor/src/org/jfor/jfor/rtflib/rtfdoc
In directory usw-pr-cvs1:/tmp/cvs-serv10530/src/org/jfor/jfor/rtflib/rtfdoc

Modified Files:
        RtfHeader.java RtfTemplate.java 
Log Message:
RtfTemplate does not check for template existence

Index: RtfHeader.java
===================================================================
RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/rtflib/rtfdoc/RtfHeader.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** RtfHeader.java      5 Jun 2002 14:17:40 -0000       1.5
--- RtfHeader.java      5 Jun 2002 16:40:29 -0000       1.6
***************
*** 38,41 ****
--- 38,44 ----
  // $Id$
  // $Log$
+ // Revision 1.6  2002/06/05 16:40:29  bdelacretaz
+ // RtfTemplate does not check for template existence
+ //
  // Revision 1.5  2002/06/05 14:17:40  rmarra
  // write template
***************
*** 113,116 ****
--- 116,124 ----
      void write(String toWrite) throws IOException {
          m_writer.write(toWrite);
+     }
+     
+     /** write to our Writer using an RtfStringConverter */
+     void writeRtfString(String toWrite) throws IOException {
+           RtfStringConverter.getInstance().writeRtfString(m_writer,toWrite);
      }
  }

Index: RtfTemplate.java
===================================================================
RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/rtflib/rtfdoc/RtfTemplate.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RtfTemplate.java    5 Jun 2002 14:16:05 -0000       1.1
--- RtfTemplate.java    5 Jun 2002 16:40:29 -0000       1.2
***************
*** 73,100 ****
         **/
        public void setTemplateFilePath(String templateFilePath) throws 
IOException {
!               
!               if(templateFilePath==null) throw new IOException("Error 
template file is null");
!               
!               File f = new File(templateFilePath);
!               if(!f.exists()) throw new IOException("Error template file not 
found: "+templateFilePath);
!               
!                               
!               StringTokenizer st = new 
StringTokenizer(templateFilePath,File.separator,false);
!               
!               StringBuffer sb = new StringBuffer();
!               while(st.hasMoreTokens()) {
!                       sb.append(st.nextToken());      
!                       if (st.hasMoreTokens()) {
!                               sb.append(File.separator);
!                               sb.append(File.separator);
!                       }
                }
-               
-               this.templateFilePath = sb.toString();  
        }
  
- 
- 
- 
        /**
         * Write the rtf template
--- 73,84 ----
         **/
        public void setTemplateFilePath(String templateFilePath) throws 
IOException {
!               // no validity checks here - leave this to the RTF client
!               if(templateFilePath == null) {
!                       this.templateFilePath = null;
!               } else {
!                       this.templateFilePath = templateFilePath.trim();
                }
        }
  
        /**
         * Write the rtf template
***************
*** 104,112 ****
        public void writeTemplate (RtfHeader header) throws IOException
        {
!               if (templateFilePath == null) return;
                
                header.writeGroupMark (true);
                header.writeControlWord ("template");
!               header.write(this.templateFilePath);
                header.writeGroupMark (false);
                
--- 88,96 ----
        public void writeTemplate (RtfHeader header) throws IOException
        {
!               if (templateFilePath == null || templateFilePath.length() == 0) 
return;
                
                header.writeGroupMark (true);
                header.writeControlWord ("template");
!               header.writeRtfString(this.templateFilePath);
                header.writeGroupMark (false);
                
***************
*** 115,120 ****
                header.writeGroupMark (false);
        }
-  
- 
  }
  
--- 99,102 ----


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.drivers.b...    security.firewa...    mathematics.lps...    web.zope.plone....    x25/2005-12/msg...    culture.tv.sout...    pld.user.polish...    qplus.devel/200...    version-control...    openbsd.bugs/20...    distributions.g...    gnu.chess.bugs/...    redhat.release....    emacs.bugs/2002...    java.bio.genera...    ataraid/2005-01...    finance.moneyda...    hardware.microc...    netbsd.ports.xe...    bug-tracking.gn...    text.xml.saxon....    kde.linux/2002-...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo