/[gzz]/gzz/gzz/view/LinebrokenCellContentView.java
ViewVC logotype

Diff of /gzz/gzz/view/LinebrokenCellContentView.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by tjl, Tue Oct 8 07:34:54 2002 UTC revision 1.10 by benja, Tue Oct 8 22:55:18 2002 UTC
# Line 108  public static final String rcsid = "$Id$ Line 108  public static final String rcsid = "$Id$
108          Object key = new Integer(start+1472);          Object key = new Integer(start+1472);
109          s = s.substring(start, end);          s = s.substring(start, end);
110    
         /**  
         (Benja:) Ouch. The following line makes a great difference, even though  
         that should really not be so.  
           
         Without this line, on *my* system (though not Tuomas'!), the text vobs  
         added by this method extend from 'start' till 's.length()'-- 'end'  
         seems to be ignored. That is, if 's' is "Foo bar baz", 'start' is 4  
         and 'end' is 8, the text shown on the screen is not "bar ", as intended,  
         but "bar baz". (The width used in linebreaking is "bar ", though.)  
           
         This means two things, apparently:  
         o  My JVM handles substring() virtually, so 's.substring(start, end)'  
            is not a copy of a part of 's', but a subrange of the memory range  
            occupied by 's', starting at 'start' and spanning 'end-start'  
            characters. '""+s', on the other hand, creates a copy of 's'.  
         o  Something on the C++ side does not respect the string length passed  
            to it by the JVM (it presumably thinks the string is  
            NUL-terminated). So, it displays all the text starting at 'start'  
            till the end of 's'.  
             
         Therefore, please don't remove the following line until you can be sure  
         the bug explained above has been fixed...  
         **/  
         s = ""+s;  
   
111          if(dbg) pa("addVobs: "+start+" "+end+" '"+s+"'");          if(dbg) pa("addVobs: "+start+" "+end+" '"+s+"'");
112          TextVob vob = new TextVob(style, s, true, key);          TextVob vob = new TextVob(style, s, true, key);
113          ch.addBox(vob);          ch.addBox(vob);

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26