|
1 | | -/** |
| 1 | +/** |
2 | 2 | * File: text_edit.c |
3 | 3 | * Author: AWTK Develop Team |
4 | 4 | * Brief: text_edit |
@@ -1676,35 +1676,6 @@ const uint32_t* text_edit_get_lines_of_each_row(text_edit_t* text_edit) { |
1676 | 1676 | return lines_of_each_row; |
1677 | 1677 | } |
1678 | 1678 |
|
1679 | | -static uint32_t text_edit_get_line_break_offset(text_edit_t* text_edit, uint32_t num) { |
1680 | | - uint32_t offset = 0; |
1681 | | - uint32_t i = 0; |
1682 | | - wstr_t* text = NULL; |
1683 | | - DECL_IMPL(text_edit); |
1684 | | - return_value_if_fail(text_edit != NULL && text_edit->widget != NULL, -1); |
1685 | | - return_value_if_fail(0 < num && num < impl->rows->capacity, -1); |
1686 | | - |
1687 | | - if (num >= impl->rows->size) { |
1688 | | - return -1; |
1689 | | - } |
1690 | | - |
1691 | | - text = &text_edit->widget->text; |
1692 | | - |
1693 | | - for (i = 0; i < num; i++) { |
1694 | | - offset += impl->rows->row[i].length; |
1695 | | - } |
1696 | | - |
1697 | | - if (offset >= 2 && TWINS_WCHAR_IS_LINE_BREAK(text->str[offset - 2], text->str[offset - 1])) { |
1698 | | - offset -= 2; |
1699 | | - } else if (offset >= 1 && WCHAR_IS_LINE_BREAK(text->str[offset - 1])) { |
1700 | | - offset--; |
1701 | | - } else { |
1702 | | - offset = -1; |
1703 | | - } |
1704 | | - |
1705 | | - return offset; |
1706 | | -} |
1707 | | - |
1708 | 1679 | ret_t text_edit_set_canvas(text_edit_t* text_edit, canvas_t* canvas) { |
1709 | 1680 | return_value_if_fail(text_edit != NULL && canvas != NULL, RET_BAD_PARAMS); |
1710 | 1681 |
|
@@ -2102,8 +2073,6 @@ ret_t text_edit_key_down(text_edit_t* text_edit, key_event_t* evt) { |
2102 | 2073 | stb_textedit_key(text_edit, state, STB_TEXTEDIT_K_LINEEND); |
2103 | 2074 | } |
2104 | 2075 | goto layout; |
2105 | | - |
2106 | | - return RET_OK; |
2107 | 2076 | } |
2108 | 2077 | break; |
2109 | 2078 | } |
@@ -2295,12 +2264,12 @@ inline static bool_t text_edit_str_is_delete_key(const wchar_t* str, uint32_t si |
2295 | 2264 | *key = STB_TEXTEDIT_K_BACKSPACE; |
2296 | 2265 | *type = DELETE_BY_KEY_BACKSPACE; |
2297 | 2266 | return TRUE; |
2298 | | - } break; |
| 2267 | + } |
2299 | 2268 | case TK_KEY_DELETE: { |
2300 | 2269 | *key = STB_TEXTEDIT_K_DELETE; |
2301 | 2270 | *type = DELETE_BY_KEY_DELETE; |
2302 | 2271 | return TRUE; |
2303 | | - } break; |
| 2272 | + } |
2304 | 2273 | default: { |
2305 | 2274 | } break; |
2306 | 2275 | } |
|
0 commit comments