diff options
-rw-r--r-- | src/Editor.cxx | 4 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 996d540db..bf94fb8ed 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5070,7 +5070,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b NotifyHotSpotClicked(newPos, shift, ctrl, alt); } if (!shift) { - inDragDrop = PointInSelection(pt); + inDragDrop = PointInSelection(pt) && !SelectionEmpty(); } if (inDragDrop) { SetMouseCapture(false); @@ -5223,7 +5223,7 @@ void Editor::ButtonMove(Point pt) { } } // Display regular (drag) cursor over selection - if (PointInSelection(pt)) { + if (PointInSelection(pt) && !SelectionEmpty()) { DisplayCursor(Window::cursorArrow); } else if (PointIsHotspot(pt)) { DisplayCursor(Window::cursorHand); diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 5b54e75fe..6d51445e6 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -672,7 +672,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam ::ScreenToClient(MainHWND(), &pt); if (PointInSelMargin(Point(pt.x, pt.y))) { DisplayCursor(Window::cursorReverseArrow); - } else if (PointInSelection(Point(pt.x, pt.y))) { + } else if (PointInSelection(Point(pt.x, pt.y)) && !SelectionEmpty()) { DisplayCursor(Window::cursorArrow); } else if (PointIsHotspot(Point(pt.x, pt.y))) { DisplayCursor(Window::cursorHand); @@ -1709,7 +1709,7 @@ void ScintillaWin::AddCharBytes(char b0, char b1) { unsigned int len = UTF8Length(wcs, 1); UTF8FromUCS2(wcs, 1, utfval, len); utfval[len] = '\0'; - AddCharUTF(utfval,len); + AddCharUTF(utfval, len ? len : 1); } else if (b0) { char dbcsChars[3]; dbcsChars[0] = b0; @@ -2096,7 +2096,7 @@ STDMETHODIMP ScintillaWin::GetData(FORMATETC *pFEIn, STGMEDIUM *pSTM) { memcpy(static_cast<char *>(text.ptr), drag.s, drag.len); } } - pSTM->hGlobal = text.Unlock(); + pSTM->hGlobal = text ? text.Unlock() : 0; pSTM->pUnkForRelease = 0; return S_OK; } |