diff options
Diffstat (limited to 'src/Document.cxx')
| -rw-r--r-- | src/Document.cxx | 24 | 
1 files changed, 23 insertions, 1 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 4ce62c45b..1938149e7 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -69,6 +69,7 @@ void LexInterface::Colourise(int start, int end) {  Document::Document() {  	refCount = 0; +	pcf = NULL;  #ifdef _WIN32  	eolMode = SC_EOL_CRLF;  #else @@ -123,6 +124,8 @@ Document::~Document() {  	regex = 0;  	delete pli;  	pli = 0; +	delete pcf; +	pcf = 0;  }  void Document::Init() { @@ -132,6 +135,16 @@ void Document::Init() {  	}  } +bool Document::SetDBCSCodePage(int dbcsCodePage_) { +	if (dbcsCodePage != dbcsCodePage_) { +		dbcsCodePage = dbcsCodePage_; +		SetCaseFolder(NULL); +		return true; +	} else { +		return false; +	} +} +  void Document::InsertLine(int line) {  	for (int j=0; j<ldSize; j++) {  		if (perLineData[j]) @@ -1419,6 +1432,15 @@ bool Document::MatchesWordOptions(bool word, bool wordStart, int pos, int length  			(wordStart && IsWordStartAt(pos));  } +bool Document::HasCaseFolder(void) const { +	return pcf != 0; +} + +void Document::SetCaseFolder(CaseFolder *pcf_) { +	delete pcf; +	pcf = pcf_; +} +  /**   * Find text in document, supporting both forward and backward   * searches (just pass minPos > maxPos to do a backward search) @@ -1426,7 +1448,7 @@ bool Document::MatchesWordOptions(bool word, bool wordStart, int pos, int length   */  long Document::FindText(int minPos, int maxPos, const char *search,                          bool caseSensitive, bool word, bool wordStart, bool regExp, int flags, -                        int *length, CaseFolder *pcf) { +                        int *length) {  	if (*length <= 0)  		return minPos;  	if (regExp) {  | 
