diff options
-rw-r--r-- | win32/ScintillaWin.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 8d7be0629..340dcd86d 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -197,6 +197,7 @@ class ScintillaWin : bool hasOKText; CLIPFORMAT cfColumnSelect; + CLIPFORMAT cfColumnSelectBorland; CLIPFORMAT cfLineSelect; HRESULT hrOle; @@ -315,7 +316,7 @@ public: friend class DataObject; friend class DropTarget; bool DragIsRectangularOK(CLIPFORMAT fmt) const { - return drag.rectangular && (fmt == cfColumnSelect); + return drag.rectangular && ((fmt == cfColumnSelect) || (fmt == cfColumnSelectBorland)); } private: @@ -347,9 +348,11 @@ ScintillaWin::ScintillaWin(HWND hwnd) { hasOKText = false; // There does not seem to be a real standard for indicating that the clipboard - // contains a rectangular selection, so copy Developer Studio. + // contains a rectangular selection, so copy Developer Studio and Borland Delphi. cfColumnSelect = static_cast<CLIPFORMAT>( ::RegisterClipboardFormat(TEXT("MSDEVColumnSelect"))); + cfColumnSelectBorland = static_cast<CLIPFORMAT>( + ::RegisterClipboardFormat(TEXT("Borland IDE Block Type"))); // Likewise for line-copy (copies a full line when no text is selected) cfLineSelect = static_cast<CLIPFORMAT>( @@ -1697,7 +1700,7 @@ void ScintillaWin::Paste() { SelectionPosition selStart = sel.IsRectangular() ? sel.Rectangular().Start() : sel.Range(sel.Main()).Start(); - bool isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect) != 0; + bool isRectangular = ((::IsClipboardFormatAvailable(cfColumnSelect) != 0) || (::IsClipboardFormatAvailable(cfColumnSelectBorland) != 0)); // Always use CF_UNICODETEXT if available GlobalMemory memUSelection(::GetClipboardData(CF_UNICODETEXT)); @@ -2244,6 +2247,12 @@ void ScintillaWin::CopyToClipboard(const SelectionText &selectedText) { if (selectedText.rectangular) { ::SetClipboardData(cfColumnSelect, 0); + GlobalMemory borlandColumn; + borlandColumn.Allocate(1); + if (borlandColumn) { + static_cast<BYTE *>(borlandColumn.ptr)[0] = 0x02; + borlandColumn.SetClip(cfColumnSelectBorland); + } } if (selectedText.lineCopy) { |