if (gotData) {
wxString text = wxTextBuffer::Translate(data.GetText(),
wxConvertEOLMode(pdoc->eolMode));
+ data.SetText(wxEmptyString); // free the data object content
wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
+ text = wxEmptyString; // free text
+
int len = strlen(buf);
pdoc->InsertString(currentPos, buf, len);
SetEmptySelection(currentPos + len);
}
void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) {
- PLATFORM_ASSERT(useCount == 0);
+// PLATFORM_ASSERT(useCount == 0);
int lengthForLevel = 0;
if (level == llcCaret) {
lengthForLevel = 1;
}
void LineLayoutCache::Deallocate() {
- PLATFORM_ASSERT(useCount == 0);
+// PLATFORM_ASSERT(useCount == 0);
for (int i = 0; i < length; i++)
delete cache[i];
delete []cache;
size_t length) {
if(!text) return;
- // The unicode conversion MUST have a null byte to terminate the
- // string so move it into a buffer first and give it one.
- wxMemoryBuffer buf(length+1);
- buf.AppendData((void*)text, length);
- buf.AppendByte(0);
- evt.SetText(stc2wx(buf));
+ evt.SetText(stc2wx(text, length));
}
size_t length) {
if(!text) return;
- // The unicode conversion MUST have a null byte to terminate the
- // string so move it into a buffer first and give it one.
- wxMemoryBuffer buf(length+1);
- buf.AppendData((void*)text, length);
- buf.AppendByte(0);
- evt.SetText(stc2wx(buf));
+ evt.SetText(stc2wx(text, length));
}
if (gotData) {
wxString text = wxTextBuffer::Translate(data.GetText(),
wxConvertEOLMode(pdoc->eolMode));
+ data.SetText(wxEmptyString); // free the data object content
wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
+ text = wxEmptyString; // free text
+
int len = strlen(buf);
pdoc->InsertString(currentPos, buf, len);
SetEmptySelection(currentPos + len);
}
void LineLayoutCache::AllocateForLevel(int linesOnScreen, int linesInDoc) {
- PLATFORM_ASSERT(useCount == 0);
+// PLATFORM_ASSERT(useCount == 0);
int lengthForLevel = 0;
if (level == llcCaret) {
lengthForLevel = 1;
}
void LineLayoutCache::Deallocate() {
- PLATFORM_ASSERT(useCount == 0);
+// PLATFORM_ASSERT(useCount == 0);
for (int i = 0; i < length; i++)
delete cache[i];
delete []cache;
size_t length) {
if(!text) return;
- // The unicode conversion MUST have a null byte to terminate the
- // string so move it into a buffer first and give it one.
- wxMemoryBuffer buf(length+1);
- buf.AppendData((void*)text, length);
- buf.AppendByte(0);
- evt.SetText(stc2wx(buf));
+ evt.SetText(stc2wx(text, length));
}
size_t length) {
if(!text) return;
- // The unicode conversion MUST have a null byte to terminate the
- // string so move it into a buffer first and give it one.
- wxMemoryBuffer buf(length+1);
- buf.AppendData((void*)text, length);
- buf.AppendByte(0);
- evt.SetText(stc2wx(buf));
+ evt.SetText(stc2wx(text, length));
}