diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Editor.cxx | 14 | ||||
| -rw-r--r-- | src/Editor.h | 17 | 
2 files changed, 22 insertions, 9 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 4b1c6691d..7bafb3fff 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4631,7 +4631,8 @@ char *Editor::CopyRange(int start, int end) {  }  void Editor::CopySelectionFromRange(SelectionText *ss, int start, int end) { -	ss->Set(CopyRange(start, end), end - start + 1, pdoc->dbcsCodePage, false); +	ss->Set(CopyRange(start, end), end - start + 1,  +		pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false);  }  void Editor::CopySelectionRange(SelectionText *ss) { @@ -4673,7 +4674,8 @@ void Editor::CopySelectionRange(SelectionText *ss) {  				text[size] = '\0';  			}  		} - 		ss->Set(text, size + 1, pdoc->dbcsCodePage, selType == selRectangle); + 		ss->Set(text, size + 1, pdoc->dbcsCodePage,  +			vs.styles[STYLE_DEFAULT].characterSet, selType == selRectangle);  	}  } @@ -4681,13 +4683,15 @@ 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, pdoc->dbcsCodePage); +	selectedText.Set(CopyRange(start, end), end - start + 1,  +		pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false);  	CopyToClipboard(selectedText);  }  void Editor::CopyText(int length, const char *text) {  	SelectionText selectedText; -	selectedText.Copy(text, length, pdoc->dbcsCodePage); +	selectedText.Copy(text, length,  +		pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false);  	CopyToClipboard(selectedText);  } @@ -5161,7 +5165,7 @@ void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {  					} else {  						SetEmptySelection(newPos);  					} -					drag.Set(0, 0, 0); +					drag.Free();  				}  				selectionType = selChar;  			} diff --git a/src/Editor.h b/src/Editor.h index 76635e658..9e9af0ec1 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -134,22 +134,27 @@ public:  	char *s;  	int len;  	bool rectangular; +	int codePage;  	int characterSet; -	SelectionText() : s(0), len(0), rectangular(false), characterSet(0) {} +	SelectionText() : s(0), len(0), rectangular(false), codePage(0), characterSet(0) {}  	~SelectionText() { -		Set(0, 0, 0); +		Free();  	} -	void Set(char *s_, int len_, int characterSet_, bool rectangular_=false) { +	void Free() { +		Set(0, 0, 0, 0, false); +	} +	void Set(char *s_, int len_, int codePage_, int characterSet_, bool rectangular_) {  		delete []s;  		s = s_;  		if (s)  			len = len_;  		else  			len = 0; +		codePage = codePage_;  		characterSet = characterSet_;  		rectangular = rectangular_;  	} -	void Copy(const char *s_, int len_, int characterSet_, bool rectangular_=false) { +	void Copy(const char *s_, int len_, int codePage_, int characterSet_, bool rectangular_) {  		delete []s;  		s = new char[len_];  		if (s) { @@ -160,9 +165,13 @@ public:  		} else {  			len = 0;  		} +		codePage = codePage_;  		characterSet = characterSet_;  		rectangular = rectangular_;  	} +	void Copy(const SelectionText &other) { +		Copy(other.s, other.len, other.codePage, other.characterSet, other.rectangular); +	}  };  /**  | 
