X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d02625ccfecc288c28517d07c35edd9cbfaeb11..6d7b547184bfdcdf67790755deb0122050b1d728:/src/stc/ScintillaWX.cpp diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 2d793a9157..764048fbc2 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -328,17 +328,16 @@ void ScintillaWX::SetTicking(bool on) { void ScintillaWX::SetMouseCapture(bool on) { if (mouseDownCaptures) { - if (on && !stc->HasCapture()) + if (on && !capturedMouse) stc->CaptureMouse(); - else if (!on && stc->HasCapture()) + else if (!on && capturedMouse && stc->HasCapture()) stc->ReleaseMouse(); - capturedMouse = stc->HasCapture(); + capturedMouse = on; } } bool ScintillaWX::HaveMouseCapture() { - capturedMouse = stc->HasCapture(); return capturedMouse; } @@ -484,7 +483,10 @@ void ScintillaWX::Paste() { 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);