/[classpath]/classpath/javax/swing/text/PlainView.java
ViewVC logotype

Diff of /classpath/javax/swing/text/PlainView.java

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

revision 1.31 by audriusa, Thu Nov 3 19:29:00 2005 UTC revision 1.32 by rabbit78, Thu Nov 3 23:19:34 2005 UTC
# Line 326  public class PlainView extends View impl Line 326  public class PlainView extends View impl
326            
327      Element line = root.getElement(lineClicked);      Element line = root.getElement(lineClicked);
328      Segment s = getLineBuffer();      Segment s = getLineBuffer();
   
329      int start = line.getStartOffset();      int start = line.getStartOffset();
330      int end = line.getEndOffset();      // We don't want the \n at the end of the line.
331        int end = line.getEndOffset() - 1;
332      try      try
333        {        {
334          doc.getText(start, end - start, s);          doc.getText(start, end - start, s);
           
         // The end of line symbol (0xA), if being the last member in the  
         // obtained text, should not be counted.  
         if (s.last()==0xA && end>start)  
           s.count--;  
335        }        }
336      catch (BadLocationException ble)      catch (BadLocationException ble)
337        {        {

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

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