Only do Armel Asselin's memory reduction patch in Paste in the Unicode
build because in the ansi build wxWX2MBbuf is just a char* pointing into the text wxString's buffer git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40358 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -483,11 +483,14 @@ void ScintillaWX::Paste() {
|
|||||||
if (gotData) {
|
if (gotData) {
|
||||||
wxString text = wxTextBuffer::Translate(data.GetText(),
|
wxString text = wxTextBuffer::Translate(data.GetText(),
|
||||||
wxConvertEOLMode(pdoc->eolMode));
|
wxConvertEOLMode(pdoc->eolMode));
|
||||||
data.SetText(wxEmptyString); // free the data object content
|
|
||||||
wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
|
wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
|
||||||
text = wxEmptyString; // free text
|
|
||||||
|
|
||||||
int len = strlen(buf);
|
#if wxUSE_UNICODE
|
||||||
|
// free up the old character buffer in case the text is real big
|
||||||
|
data.SetText(wxEmptyString);
|
||||||
|
text = wxEmptyString;
|
||||||
|
#endif
|
||||||
|
int len = strlen(buf);
|
||||||
pdoc->InsertString(currentPos, buf, len);
|
pdoc->InsertString(currentPos, buf, len);
|
||||||
SetEmptySelection(currentPos + len);
|
SetEmptySelection(currentPos + len);
|
||||||
}
|
}
|
||||||
|
@@ -483,11 +483,14 @@ void ScintillaWX::Paste() {
|
|||||||
if (gotData) {
|
if (gotData) {
|
||||||
wxString text = wxTextBuffer::Translate(data.GetText(),
|
wxString text = wxTextBuffer::Translate(data.GetText(),
|
||||||
wxConvertEOLMode(pdoc->eolMode));
|
wxConvertEOLMode(pdoc->eolMode));
|
||||||
data.SetText(wxEmptyString); // free the data object content
|
|
||||||
wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
|
wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
|
||||||
text = wxEmptyString; // free text
|
|
||||||
|
|
||||||
int len = strlen(buf);
|
#if wxUSE_UNICODE
|
||||||
|
// free up the old character buffer in case the text is real big
|
||||||
|
data.SetText(wxEmptyString);
|
||||||
|
text = wxEmptyString;
|
||||||
|
#endif
|
||||||
|
int len = strlen(buf);
|
||||||
pdoc->InsertString(currentPos, buf, len);
|
pdoc->InsertString(currentPos, buf, len);
|
||||||
SetEmptySelection(currentPos + len);
|
SetEmptySelection(currentPos + len);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user