| 716 | } |
| 717 | |
| 718 | void PiuCodeSelect(PiuCode* self, int32_t selectionOffset, uint32_t selectionLength) |
| 719 | { |
| 720 | xsMachine* the = (*self)->the; |
| 721 | xsStringValue string = PiuToString((*self)->string); |
| 722 | int32_t from = selectionOffset; |
| 723 | int32_t to = selectionOffset + selectionLength; |
| 724 | int32_t offset; |
| 725 | if (from < 0) |
| 726 | from = 0; |
| 727 | else if (from > (int32_t)(*self)->length) |
| 728 | from = (*self)->length; |
| 729 | if (to < 0) |
| 730 | to = 0; |
| 731 | else if (to > (int32_t)(*self)->length) |
| 732 | to = (*self)->length; |
| 733 | (*self)->from = from; |
| 734 | (*self)->to = to; |
| 735 | offset = fxUnicodeToUTF8Offset(string, from); |
| 736 | PiuCodeOffsetToColumnLine(self, offset, &(*self)->fromColumn, &(*self)->fromLine); |
| 737 | if (to == from) { |
| 738 | (*self)->toColumn = (*self)->fromColumn; |
| 739 | (*self)->toLine = (*self)->fromLine; |
| 740 | } |
| 741 | else { |
| 742 | offset = fxUnicodeToUTF8Offset(string, (*self)->to); |
| 743 | PiuCodeOffsetToColumnLine(self, offset, &(*self)->toColumn, &(*self)->toLine); |
| 744 | } |
| 745 | PiuCodeInvalidate(self, NULL); |
| 746 | } |
| 747 | |
| 748 | void PiuCodeUnbind(void* it, PiuApplication* application, PiuView* view) |
| 749 | { |
no test coverage detected