diff options
author | nyamatongwe <unknown> | 2004-04-16 23:54:01 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2004-04-16 23:54:01 +0000 |
commit | 0c3f842c61b1d0c23247385bead7a577c8a54b1c (patch) | |
tree | 87e24a0602f7aff6508cfc3a570ca84278b462e7 /src | |
parent | 5305dc49182acef1574427bb57ad24025967738d (diff) | |
download | scintilla-mirror-0c3f842c61b1d0c23247385bead7a577c8a54b1c.tar.gz |
Patch from John Ehresman to add character set to selections.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 10 | ||||
-rw-r--r-- | src/Editor.h | 11 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index e4205b861..351ff86d8 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4489,7 +4489,7 @@ char *Editor::CopyRange(int start, int end) { } void Editor::CopySelectionFromRange(SelectionText *ss, int start, int end) { - ss->Set(CopyRange(start, end), end - start + 1, false); + ss->Set(CopyRange(start, end), end - start + 1, pdoc->dbcsCodePage, false); } void Editor::CopySelectionRange(SelectionText *ss) { @@ -4531,7 +4531,7 @@ void Editor::CopySelectionRange(SelectionText *ss) { text[size] = '\0'; } } - ss->Set(text, size + 1, selType == selRectangle); + ss->Set(text, size + 1, pdoc->dbcsCodePage, selType == selRectangle); } } @@ -4539,13 +4539,13 @@ void Editor::CopyRangeToClipboard(int start, int end) { start = pdoc->ClampPositionIntoDocument(start); end = pdoc->ClampPositionIntoDocument(end); SelectionText selectedText; - selectedText.Set(CopyRange(start, end), end - start + 1); + selectedText.Set(CopyRange(start, end), end - start + 1, pdoc->dbcsCodePage); CopyToClipboard(selectedText); } void Editor::CopyText(int length, const char *text) { SelectionText selectedText; - selectedText.Copy(text, length); + selectedText.Copy(text, length, pdoc->dbcsCodePage); CopyToClipboard(selectedText); } @@ -5019,7 +5019,7 @@ void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) { } else { SetEmptySelection(newPos); } - drag.Set(0, 0); + drag.Set(0, 0, 0); } selectionType = selChar; } diff --git a/src/Editor.h b/src/Editor.h index 08c56f7a4..c9c4c26e1 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -134,20 +134,22 @@ public: char *s; int len; bool rectangular; - SelectionText() : s(0), len(0), rectangular(false) {} + int characterSet; + SelectionText() : s(0), len(0), rectangular(false), characterSet(0) {} ~SelectionText() { - Set(0, 0); + Set(0, 0, 0); } - void Set(char *s_, int len_, bool rectangular_=false) { + void Set(char *s_, int len_, int characterSet_, bool rectangular_=false) { delete []s; s = s_; if (s) len = len_; else len = 0; + characterSet = characterSet_; rectangular = rectangular_; } - void Copy(const char *s_, int len_, bool rectangular_=false) { + void Copy(const char *s_, int len_, int characterSet_, bool rectangular_=false) { delete []s; s = new char[len_]; if (s) { @@ -158,6 +160,7 @@ public: } else { len = 0; } + characterSet = characterSet_; rectangular = rectangular_; } }; |