diff options
| author | nyamatongwe <devnull@localhost> | 2001-12-23 01:02:34 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2001-12-23 01:02:34 +0000 | 
| commit | 07e775f70b5ebeb25a45cfa53e14291e59205a3e (patch) | |
| tree | 1c1277c7c225a5490060c31013dc4de7f9a34f99 /src/ContractionState.cxx | |
| parent | 2ffc7f07f4594cc2a6bc11b9e7a9e65c13cbbcc9 (diff) | |
| download | scintilla-mirror-07e775f70b5ebeb25a45cfa53e14291e59205a3e.tar.gz | |
Optimisation that avoids creating the lines and docLines arrays unless
needed because a line has been folded or has a height greater than 1.
Diffstat (limited to 'src/ContractionState.cxx')
| -rw-r--r-- | src/ContractionState.cxx | 10 | 
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ContractionState.cxx b/src/ContractionState.cxx index 362dc1ed8..3d2dde3c6 100644 --- a/src/ContractionState.cxx +++ b/src/ContractionState.cxx @@ -225,6 +225,11 @@ bool ContractionState::GetExpanded(int lineDoc) const {  bool ContractionState::SetExpanded(int lineDoc, bool expanded) {  	if (size == 0) { +		if (expanded) { +			// If in completely expanded state then setting +			// one line to expanded has no effect. +			return false; +		}  		Grow(linesInDoc + growSize);  	}  	if ((lineDoc >= 0) && (lineDoc < linesInDoc)) { @@ -252,6 +257,11 @@ bool ContractionState::SetHeight(int lineDoc, int height) {  	if (lineDoc > linesInDoc)  		return false;  	if (size == 0) { +		if (height == 1) { +			// If in completely expanded state then all lines +			// assumed to have height of one so no effect here. +			return false; +		}  		Grow(linesInDoc + growSize);  	}  	if (lines[lineDoc].height != height) {  | 
