diff options
| author | Neil <nyamatongwe@gmail.com> | 2013-06-29 20:32:52 +1000 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2013-06-29 20:32:52 +1000 | 
| commit | 1a05a259558efd7dffb118ca9b12257a1346d2ea (patch) | |
| tree | ba1add8f0a55423febdb76ee76814d3c78d62fb3 /lexlib/LexAccessor.h | |
| parent | 557cf43ce45fff3d9af697bc19754428f1b5a6a6 (diff) | |
| download | scintilla-mirror-1a05a259558efd7dffb118ca9b12257a1346d2ea.tar.gz | |
Bug: [#1483]. Split GetRelativePosition into 2 calls one for moving between character
positions and the other for retrieving a character and width.
Diffstat (limited to 'lexlib/LexAccessor.h')
| -rw-r--r-- | lexlib/LexAccessor.h | 21 | 
1 files changed, 6 insertions, 15 deletions
| diff --git a/lexlib/LexAccessor.h b/lexlib/LexAccessor.h index 92e719360..e29bbc923 100644 --- a/lexlib/LexAccessor.h +++ b/lexlib/LexAccessor.h @@ -79,6 +79,12 @@ public:  		}  		return buf[position - startPos];  	} +	IDocumentWithLineEnd *MultiByteAccess() const { +		if (documentVersion >= dvLineEnd) { +			return static_cast<IDocumentWithLineEnd *>(pAccess); +		} +		return 0; +	}  	/** Safe version of operator[], returning a defined value for invalid position. */  	char SafeGetCharAt(int position, char chDefault=' ') {  		if (position < startPos || position >= endPos) { @@ -126,21 +132,6 @@ public:  				return startNext - 1;  		}  	} -	int GetRelativePosition(int start, int characterOffset, int *character, int *width) { -		if (documentVersion >= dvLineEnd) { -			return (static_cast<IDocumentWithLineEnd *>(pAccess))->GetRelativePosition( -				start, characterOffset, character, width); -		} else { -			// Old version -> byte-oriented only -			// Handle doc range overflow -			int posNew = start + characterOffset; -			if ((posNew < 0) || (posNew > Length())) -				return -1; -			*character = SafeGetCharAt(posNew, 0); -			*width = 1; -			return start + characterOffset; -		} -	}  	int LevelAt(int line) const {  		return pAccess->GetLevel(line);  	} | 
