aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOezguer Emir <oezguer@3mir.de>2013-07-26 00:34:20 +0200
committerOezguer Emir <oezguer@3mir.de>2013-07-26 00:34:20 +0200
commit9bbd190705d5a5f781693165cff257208268cffc (patch)
tree1b39941abe9b52491763b614e932fc19e4eedc52
parent74dcff026f71bcac92e9c75e07f30bf95cac5425 (diff)
downloadscintilla-mirror-9bbd190705d5a5f781693165cff257208268cffc.tar.gz
Support rectangular selected text in clipboard from and to Borland Delphi IDE
-rw-r--r--win32/ScintillaWin.cxx15
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) {