]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/ScintillaWX.cpp
add #if wxUSE_AUI to get VC6 with no wxUSE_AUI to compile
[wxWidgets.git] / src / stc / ScintillaWX.cpp
index a27fe5126b5596560b89fa1f094997f5dc41e690..93893a4541d6286bff729a6db39928c81631295a 100644 (file)
@@ -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,11 +483,14 @@ 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);
+#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);
         SetEmptySelection(currentPos + len);
     }