diff options
author | Vivian De Smedt <vivian@vdesmedt.com> | 2013-01-08 10:16:10 +0100 |
---|---|---|
committer | Vivian De Smedt <vivian@vdesmedt.com> | 2013-01-08 10:16:10 +0100 |
commit | efd427703915aa15292971515aef1ad6f7fe4864 (patch) | |
tree | f4092ced89e1a429ffd80ee01fe1fe2d6b40ff91 /src | |
parent | 0b52fe75ae0a5a4e237314d2b14cf629282a0423 (diff) | |
download | scintilla-mirror-efd427703915aa15292971515aef1ad6f7fe4864.tar.gz |
Bug: [#1289]. Replace null characters by spaces in the clipboard to avoid that
its content is truncated in the paste operation.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Editor.h b/src/Editor.h index e040bdb47..5a32b5aad 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -95,6 +95,7 @@ public: characterSet = characterSet_; rectangular = rectangular_; lineCopy = lineCopy_; + FixSelectionForClipboard(); } void Copy(const char *s_, int len_, int codePage_, int characterSet_, bool rectangular_, bool lineCopy_) { delete []s; @@ -108,10 +109,22 @@ public: characterSet = characterSet_; rectangular = rectangular_; lineCopy = lineCopy_; + FixSelectionForClipboard(); } void Copy(const SelectionText &other) { Copy(other.s, other.len, other.codePage, other.characterSet, other.rectangular, other.lineCopy); } + +private: + void FixSelectionForClipboard() { + // Replace null characters by spaces. + // To avoid that the content of the clipboard is truncated in the paste operation + // when the clipboard contains null characters. + for (int i = 0; i < len - 1; ++i) { + if (s[i] == '\0') + s[i] = ' '; + } + } }; /** |