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); |