Mercurial > projects > dwt2
comparison org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/custom/DefaultContent.d @ 43:b98647bc0aef
swt win compiles for d2+phobos
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 25 Mar 2009 17:08:05 +0100 |
parents | d46287db17ed |
children | 9f4c18c268b2 |
comparison
equal
deleted
inserted
replaced
42:63aa48e5430f | 43:b98647bc0aef |
---|---|
491 if (!gapExists() || (end < gapStart) || (start >= gapEnd)) { | 491 if (!gapExists() || (end < gapStart) || (start >= gapEnd)) { |
492 // line is before or after the gap | 492 // line is before or after the gap |
493 while ((length_ - 1 >= 0) && isDelimiter(textStore[start+length_-1])) { | 493 while ((length_ - 1 >= 0) && isDelimiter(textStore[start+length_-1])) { |
494 length_--; | 494 length_--; |
495 } | 495 } |
496 return textStore[ start .. start + length_].dup; | 496 return textStore[ start .. start + length_]._idup(); |
497 } else { | 497 } else { |
498 // gap is in the specified range, strip out the gap | 498 // gap is in the specified range, strip out the gap |
499 StringBuffer buf = new StringBuffer(); | 499 StringBuffer buf = new StringBuffer(); |
500 int gapLength = gapEnd - gapStart; | 500 int gapLength = gapEnd - gapStart; |
501 buf.append(textStore, start, gapStart - start); | 501 buf.append(textStore, start, gapStart - start); |
529 int start = lines[index][0]; | 529 int start = lines[index][0]; |
530 int length_ = lines[index][1]; | 530 int length_ = lines[index][1]; |
531 int end = start + length_ - 1; | 531 int end = start + length_ - 1; |
532 if (!gapExists() || (end < gapStart) || (start >= gapEnd)) { | 532 if (!gapExists() || (end < gapStart) || (start >= gapEnd)) { |
533 // line is before or after the gap | 533 // line is before or after the gap |
534 return textStore[ start .. start + length_ ].dup; | 534 return textStore[ start .. start + length_ ]._idup(); |
535 } else { | 535 } else { |
536 // gap is in the specified range, strip out the gap | 536 // gap is in the specified range, strip out the gap |
537 StringBuffer buffer = new StringBuffer(); | 537 StringBuffer buffer = new StringBuffer(); |
538 int gapLength = gapEnd - gapStart; | 538 int gapLength = gapEnd - gapStart; |
539 buffer.append(textStore[ start .. gapStart ]); | 539 buffer.append(textStore[ start .. gapStart ]); |
540 buffer.append(textStore[ gapEnd .. gapEnd + length_ - gapLength - (gapStart - start) ]); | 540 buffer.append(textStore[ gapEnd .. gapEnd + length_ - gapLength - (gapStart - start) ]); |
541 return buffer.toString().dup; | 541 return buffer.toString()._idup(); |
542 } | 542 } |
543 } | 543 } |
544 /** | 544 /** |
545 * Returns the physical line at the given index (i.e., with delimiters and the gap). | 545 * Returns the physical line at the given index (i.e., with delimiters and the gap). |
546 * <p> | 546 * <p> |
695 * @param start the physical start offset of the text to return | 695 * @param start the physical start offset of the text to return |
696 * @param length the physical length of the text to return | 696 * @param length the physical length of the text to return |
697 * @return the text | 697 * @return the text |
698 */ | 698 */ |
699 String getPhysicalText(int start, int length_) { | 699 String getPhysicalText(int start, int length_) { |
700 return textStore[ start .. start + length_ ].dup; | 700 return textStore[ start .. start + length_ ]._idup(); |
701 } | 701 } |
702 /** | 702 /** |
703 * Returns a string representing the logical content of | 703 * Returns a string representing the logical content of |
704 * the text store (i.e., gap stripped out). | 704 * the text store (i.e., gap stripped out). |
705 * <p> | 705 * <p> |
713 return ""; | 713 return ""; |
714 if (length_ is 0) | 714 if (length_ is 0) |
715 return ""; | 715 return ""; |
716 int end= start + length_; | 716 int end= start + length_; |
717 if (!gapExists() || (end < gapStart)) | 717 if (!gapExists() || (end < gapStart)) |
718 return textStore[ start .. start + length_].dup; | 718 return textStore[ start .. start + length_]._idup(); |
719 if (gapStart < start) { | 719 if (gapStart < start) { |
720 int gapLength= gapEnd - gapStart; | 720 int gapLength= gapEnd - gapStart; |
721 return textStore[ start + gapLength .. start + gapLength + length_ ].dup; | 721 return textStore[ start + gapLength .. start + gapLength + length_ ]._idup(); |
722 } | 722 } |
723 StringBuffer buf = new StringBuffer(); | 723 StringBuffer buf = new StringBuffer(); |
724 buf.append(textStore[ start .. start + gapStart - start ] ); | 724 buf.append(textStore[ start .. start + gapStart - start ] ); |
725 buf.append(textStore[ gapEnd .. gapEnd + end - gapStart ] ); | 725 buf.append(textStore[ gapEnd .. gapEnd + end - gapStart ] ); |
726 return buf.toString().dup; | 726 return buf.toString()._idup(); |
727 } | 727 } |
728 /** | 728 /** |
729 * Removes the specified <code>TextChangeListener</code>. | 729 * Removes the specified <code>TextChangeListener</code>. |
730 * <p> | 730 * <p> |
731 * | 731 * |