/[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.30 by rabbit78, Thu Nov 3 14:09:22 2005 UTC revision 1.31 by audriusa, Thu Nov 3 19:29:00 2005 UTC
# Line 330  public class PlainView extends View impl Line 330  public class PlainView extends View impl
330      int start = line.getStartOffset();      int start = line.getStartOffset();
331      int end = line.getEndOffset();      int end = line.getEndOffset();
332      try      try
333      {        {
334        doc.getText(start, end - start, s);          doc.getText(start, end - start, s);
335      }          
336            // The end of line symbol (0xA), if being the last member in the
337            // obtained text, should not be counted.
338            if (s.last()==0xA && end>start)
339              s.count--;
340          }
341      catch (BadLocationException ble)      catch (BadLocationException ble)
342      {        {
343        AssertionError ae = new AssertionError("Unexpected bad location");          AssertionError ae = new AssertionError("Unexpected bad location");
344        ae.initCause(ble);          ae.initCause(ble);
345        throw ae;          throw ae;
346      }        }
347            
348      int pos = Utilities.getTabbedTextOffset(s, metrics, rec.x, (int)x, this, start);      int pos = Utilities.getTabbedTextOffset(s, metrics, rec.x, (int)x, this, start);
349      return Math.max (0, pos);      return Math.max (0, pos);

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

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