diff options
| author | nyamatongwe <unknown> | 2006-06-15 01:32:23 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2006-06-15 01:32:23 +0000 | 
| commit | 37022d57a00cd6079466cb4d92a76dd591d25dde (patch) | |
| tree | 161fe00a2d05d9844c63b8e3c63a35a15779e702 /src | |
| parent | b33f5cd85d7b7630233d883f69397d0b29bfa975 (diff) | |
| download | scintilla-mirror-37022d57a00cd6079466cb4d92a76dd591d25dde.tar.gz | |
Only allow setting the code page to valid values.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Editor.cxx | 6 | ||||
| -rw-r--r-- | src/Editor.h | 1 | 
2 files changed, 5 insertions, 2 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index 6fd4c44af..87a0391b4 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -6509,8 +6509,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {  		return pdoc->LineEnd(wParam);  	case SCI_SETCODEPAGE: -		pdoc->dbcsCodePage = wParam; -		InvalidateStyleRedraw(); +		if (ValidCodePage(wParam)) { +			pdoc->dbcsCodePage = wParam; +			InvalidateStyleRedraw(); +		}  		break;  	case SCI_GETCODEPAGE: diff --git a/src/Editor.h b/src/Editor.h index 5799b4110..fe7be268a 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -525,6 +525,7 @@ protected:	// ScintillaBase subclass needs access to much of Editor  	void GetHotSpotRange(int& hsStart, int& hsEnd);  	int CodePage() const; +	virtual bool ValidCodePage(int /* codePage */) const { return true; }  	int WrapCount(int line);  	virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0; | 
