Function that returns text with line ending in linear buffer
| 949 | |
| 950 | // Function that returns text with line ending in linear buffer |
| 951 | const char* RichTextarea::GetAreaText(HWND wnd) |
| 952 | { |
| 953 | TextareaData *data = GetData(wnd); |
| 954 | |
| 955 | // Reserve size of all text |
| 956 | data->ExtendLinearTextBuffer(); |
| 957 | |
| 958 | char *currChar = data->areaText; |
| 959 | AreaLine *curr = data->firstLine; |
| 960 | // For every line |
| 961 | while(curr) |
| 962 | { |
| 963 | // Append line contents to the buffer |
| 964 | for(unsigned int i = 0; i < curr->length; i++, currChar++) |
| 965 | *currChar = curr->data[i].ch; |
| 966 | // Move to the next line |
| 967 | curr = curr->next; |
| 968 | if(curr) |
| 969 | { |
| 970 | // Append line ending |
| 971 | *currChar++ = '\r'; |
| 972 | *currChar++ = '\n'; |
| 973 | } |
| 974 | } |
| 975 | // Terminate buffer at the end |
| 976 | *currChar = 0; |
| 977 | return data->areaText; |
| 978 | } |
| 979 | |
| 980 | const char* RichTextarea::GetCachedAreaText(HWND wnd) |
| 981 | { |
nothing calls this directly
no test coverage detected