cvs commit: jakarta-poi/src/scratchpad/src/org/apache/poi/hslf/model Sheet.java TextRun.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

cvs commit: jakarta-poi/src/scratchpad/src/org/apache/poi/hslf/model Sheet.java TextRun.java

Nick Burch-8
nick        2005/06/09 08:08:58

  Modified:    src/scratchpad/src/org/apache/poi/hslf/model Sheet.java
                        TextRun.java
  Log:
  Improved handling of byte position sensitive records
 
  Revision  Changes    Path
  1.2       +10 -3     jakarta-poi/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java
 
  Index: Sheet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Sheet.java 28 May 2005 05:36:00 -0000 1.1
  +++ Sheet.java 9 Jun 2005 15:08:57 -0000 1.2
  @@ -77,14 +77,21 @@
    } else if(records[i+1] instanceof TextBytesAtom) {
    TextBytesAtom tba = (TextBytesAtom)records[i+1];
    trun = new TextRun(tha,tba);
  + } else if(records[i+1].getRecordType() == 4001l) {
  + // StyleTextPropAtom - Safe to ignore
    } else if(records[i+1].getRecordType() == 4010l) {
  - // Safe to ignore
  + // TextSpecInfoAtom - Safe to ignore
    } else {
    System.err.println("Found a TextHeaderAtom not followed by a TextBytesAtom or TextCharsAtom: Followed by " + records[i+1].getRecordType());
    continue;
    }
  - found.add(trun);
  - i++;
  +
  + if(trun != null) {
  + found.add(trun);
  + i++;
  + } else {
  + // Not a valid one, so skip on to next and look again
  + }
    }
    }
     }
 
 
 
  1.2       +1 -1      jakarta-poi/src/scratchpad/src/org/apache/poi/hslf/model/TextRun.java
 
  Index: TextRun.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/scratchpad/src/org/apache/poi/hslf/model/TextRun.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TextRun.java 28 May 2005 05:36:00 -0000 1.1
  +++ TextRun.java 9 Jun 2005 15:08:57 -0000 1.2
  @@ -99,7 +99,7 @@
    public void setText(String s) {
    // If size changed, warn
    if(s.length() != getText().length()) {
  - System.err.println("Warning: Your powerpoint file is probably no longer readable by powerpoint, as the text run has changed size!");
  + System.err.println("Warning: Your powerpoint file may no longer readable by powerpoint, as the text run has changed size!");
    }
   
    if(_isUnicode) {
 
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/