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

Function ExtendLine

GUI/RichTextarea.cpp:79–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77ObjectBlockPool<AreaLine, 32>* AreaLine::pool = NULL;
78
79void ExtendLine(AreaLine *line, unsigned int size)
80{
81 // If there isn't enough space
82 if(size > line->maxLength)
83 {
84 AreaChar *nChars = new AreaChar[size + size / 2];
85 line->maxLength = size + size / 2;
86 // Clear memory
87 memset(nChars, 0, sizeof(AreaChar) * line->maxLength);
88 // Copy old data
89 memcpy(nChars, line->data, line->length * sizeof(AreaChar));
90 // Delete old data if it's not an internal buffer
91 if(line->data != line->startBuf)
92 delete[] line->data;
93 line->data = nChars;
94 }
95}
96
97AreaLine* InsertLineAfter(AreaLine *curr)
98{

Callers 6

TakeSnapshotMethod · 0.85
HistoryStepMethod · 0.85
InputCharMethod · 0.85
InputEnterMethod · 0.85
DeleteSelectionMethod · 0.85
DeletePreviousCharMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected