MCPcopy Create free account
hub / github.com/WheretIB/nullc / GetAreaText

Method GetAreaText

GUI/RichTextarea.cpp:951–978  ·  view source on GitHub ↗

Function that returns text with line ending in linear buffer

Source from the content-addressed store, hash-verified

949
950// Function that returns text with line ending in linear buffer
951const 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
980const char* RichTextarea::GetCachedAreaText(HWND wnd)
981{

Callers

nothing calls this directly

Calls 2

GetDataFunction · 0.70

Tested by

no test coverage detected