diff options
| author | nyamatongwe <unknown> | 2010-03-13 21:22:03 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2010-03-13 21:22:03 +0000 | 
| commit | 1b2967ee84232e3053eb6d7299f11982b91d6d81 (patch) | |
| tree | a506a530b0e449bbf814f6f98c2d19c2e13dcb76 /src | |
| parent | 0f626757c6c63c22943ad7e86650b9ad8787584f (diff) | |
| download | scintilla-mirror-1b2967ee84232e3053eb6d7299f11982b91d6d81.tar.gz | |
Adding const to methods where possible.
Diffstat (limited to 'src')
| -rw-r--r-- | src/AutoComplete.cxx | 6 | ||||
| -rw-r--r-- | src/AutoComplete.h | 6 | ||||
| -rw-r--r-- | src/CallTip.cxx | 2 | ||||
| -rw-r--r-- | src/CallTip.h | 2 | ||||
| -rw-r--r-- | src/CellBuffer.cxx | 4 | ||||
| -rw-r--r-- | src/CellBuffer.h | 4 | ||||
| -rw-r--r-- | src/Decoration.h | 4 | ||||
| -rw-r--r-- | src/PositionCache.cxx | 4 | ||||
| -rw-r--r-- | src/PositionCache.h | 8 | ||||
| -rw-r--r-- | src/StyleContext.h | 6 | ||||
| -rw-r--r-- | src/XPM.h | 6 | 
11 files changed, 26 insertions, 26 deletions
| diff --git a/src/AutoComplete.cxx b/src/AutoComplete.cxx index dd52410d4..cd58f6172 100644 --- a/src/AutoComplete.cxx +++ b/src/AutoComplete.cxx @@ -43,7 +43,7 @@ AutoComplete::~AutoComplete() {  	}  } -bool AutoComplete::Active() { +bool AutoComplete::Active() const {  	return active;  } @@ -82,7 +82,7 @@ void AutoComplete::SetSeparator(char separator_) {  	separator = separator_;  } -char AutoComplete::GetSeparator() { +char AutoComplete::GetSeparator() const {  	return separator;  } @@ -90,7 +90,7 @@ void AutoComplete::SetTypesep(char separator_) {  	typesep = separator_;  } -char AutoComplete::GetTypesep() { +char AutoComplete::GetTypesep() const {  	return typesep;  } diff --git a/src/AutoComplete.h b/src/AutoComplete.h index b10cdce82..f48cb0551 100644 --- a/src/AutoComplete.h +++ b/src/AutoComplete.h @@ -36,7 +36,7 @@ public:  	~AutoComplete();  	/// Is the auto completion list displayed? -	bool Active(); +	bool Active() const;  	/// Display the auto completion list positioned to be near a character position  	void Start(Window &parent, int ctrlID, int position, Point location, @@ -52,11 +52,11 @@ public:  	/// The separator character is used when interpreting the list in SetList  	void SetSeparator(char separator_); -	char GetSeparator(); +	char GetSeparator() const;  	/// The typesep character is used for seperating the word from the type  	void SetTypesep(char separator_); -	char GetTypesep(); +	char GetTypesep() const;  	/// The list string contains a sequence of words separated by the separator character  	void SetList(const char *list); diff --git a/src/CallTip.cxx b/src/CallTip.cxx index 126428213..18a524752 100644 --- a/src/CallTip.cxx +++ b/src/CallTip.cxx @@ -68,7 +68,7 @@ static bool IsArrowCharacter(char ch) {  }  // We ignore tabs unless a tab width has been set. -bool CallTip::IsTabCharacter(char ch) { +bool CallTip::IsTabCharacter(char ch) const {  	return (tabSize > 0) && (ch == '\t');  } diff --git a/src/CallTip.h b/src/CallTip.h index e5a657940..a9ba82eb8 100644 --- a/src/CallTip.h +++ b/src/CallTip.h @@ -33,7 +33,7 @@ class CallTip {  		int posStart, int posEnd, int ytext, PRectangle rcClient,  		bool highlight, bool draw);  	int PaintContents(Surface *surfaceWindow, bool draw); -	bool IsTabCharacter(char c); +	bool IsTabCharacter(char c) const;  	int NextTabPos(int x);  public: diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index ac327dfad..de499ad68 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -455,7 +455,7 @@ int CellBuffer::LineStart(int line) const {  		return lv.LineStart(line);  } -bool CellBuffer::IsReadOnly() { +bool CellBuffer::IsReadOnly() const {  	return readOnly;  } @@ -586,7 +586,7 @@ bool CellBuffer::SetUndoCollection(bool collectUndo) {  	return collectingUndo;  } -bool CellBuffer::IsCollectingUndo() { +bool CellBuffer::IsCollectingUndo() const {  	return collectingUndo;  } diff --git a/src/CellBuffer.h b/src/CellBuffer.h index 3381c19c2..93202c9b5 100644 --- a/src/CellBuffer.h +++ b/src/CellBuffer.h @@ -170,7 +170,7 @@ public:  	const char *DeleteChars(int position, int deleteLength, bool &startSequence); -	bool IsReadOnly(); +	bool IsReadOnly() const;  	void SetReadOnly(bool set);  	/// The save point is a marker in the undo stack where the container has stated that @@ -183,7 +183,7 @@ public:  	void BasicDeleteChars(int position, int deleteLength);  	bool SetUndoCollection(bool collectUndo); -	bool IsCollectingUndo(); +	bool IsCollectingUndo() const;  	void BeginUndoAction();  	void EndUndoAction();  	void AddUndoAction(int token, bool mayCoalesce); diff --git a/src/Decoration.h b/src/Decoration.h index 2809641af..fedff9773 100644 --- a/src/Decoration.h +++ b/src/Decoration.h @@ -40,10 +40,10 @@ public:  	~DecorationList();  	void SetCurrentIndicator(int indicator); -	int GetCurrentIndicator() { return currentIndicator; } +	int GetCurrentIndicator() const { return currentIndicator; }  	void SetCurrentValue(int value); -	int GetCurrentValue() { return currentValue; } +	int GetCurrentValue() const { return currentValue; }  	// Returns true if some values may have changed  	bool FillRange(int &position, int value, int &fillLength); diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index b2c2c2ede..6b48f1859 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -448,7 +448,7 @@ BreakFinder::~BreakFinder() {  	delete []selAndEdge;  } -int BreakFinder::First() { +int BreakFinder::First() const {  	return nextBreak;  } @@ -580,7 +580,7 @@ int PositionCacheEntry::Hash(unsigned int styleNumber, const char *s, unsigned i  	return ret;  } -bool PositionCacheEntry::NewerThan(const PositionCacheEntry &other) { +bool PositionCacheEntry::NewerThan(const PositionCacheEntry &other) const {  	return clock > other.clock;  } diff --git a/src/PositionCache.h b/src/PositionCache.h index e99ae5870..754545877 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -93,7 +93,7 @@ public:  	};  	void Invalidate(LineLayout::validLevel validity_);  	void SetLevel(int level_); -	int GetLevel() { return level; } +	int GetLevel() const { return level; }  	LineLayout *Retrieve(int lineNumber, int lineCaret, int maxChars, int styleClock_,  		int linesOnScreen, int linesInDoc);  	void Dispose(LineLayout *ll); @@ -111,7 +111,7 @@ public:  	void Clear();  	bool Retrieve(unsigned int styleNumber_, const char *s_, unsigned int len_, int *positions_) const;  	static int Hash(unsigned int styleNumber, const char *s, unsigned int len); -	bool NewerThan(const PositionCacheEntry &other); +	bool NewerThan(const PositionCacheEntry &other) const;  	void ResetClock();  }; @@ -138,7 +138,7 @@ class BreakFinder {  public:  	BreakFinder(LineLayout *ll_, int lineStart_, int lineEnd_, int posLineStart_, bool utf8_, int xStart, bool breakForSelection);  	~BreakFinder(); -	int First(); +	int First() const;  	int Next();  }; @@ -152,7 +152,7 @@ public:  	~PositionCache();  	void Clear();  	void SetSize(size_t size_); -	int GetSize() { return size; } +	int GetSize() const { return size; }  	void MeasureWidths(Surface *surface, ViewStyle &vstyle, unsigned int styleNumber,  		const char *s, unsigned int len, int *positions);  }; diff --git a/src/StyleContext.h b/src/StyleContext.h index a2e058a70..4e175bc29 100644 --- a/src/StyleContext.h +++ b/src/StyleContext.h @@ -65,7 +65,7 @@ public:  	void Complete() {  		styler.ColourTo(currentPos - 1, state);  	} -	bool More() { +	bool More() const {  		return currentPos < endPos;  	}  	void Forward() { @@ -108,10 +108,10 @@ public:  	int GetRelative(int n) {  		return static_cast<unsigned char>(styler.SafeGetCharAt(currentPos+n));  	} -	bool Match(char ch0) { +	bool Match(char ch0) const {  		return ch == static_cast<unsigned char>(ch0);  	} -	bool Match(char ch0, char ch1) { +	bool Match(char ch0, char ch1) const {  		return (ch == static_cast<unsigned char>(ch0)) && (chNext == static_cast<unsigned char>(ch1));  	}  	bool Match(const char *s) { @@ -43,9 +43,9 @@ public:  	void Draw(Surface *surface, PRectangle &rc);  	char **InLinesForm() { return lines; }  	void SetId(int pid_) { pid = pid_; } -	int GetId() { return pid; } -	int GetHeight() { return height; } -	int GetWidth() { return width; } +	int GetId() const { return pid; } +	int GetHeight() const { return height; } +	int GetWidth() const { return width; }  	static const char **LinesFormFromTextForm(const char *textForm);  }; | 
