diff options
Diffstat (limited to 'src/ScintillaBase.cxx')
| -rw-r--r-- | src/ScintillaBase.cxx | 30 | 
1 files changed, 15 insertions, 15 deletions
| diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 8f9da7fa6..86158bcfb 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -247,7 +247,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {  	if (ac.chooseSingle && (listType == 0)) {  		if (list && !strchr(list, ac.GetSeparator())) {  			const char *typeSep = strchr(list, ac.GetTypesep()); -			int lenInsert = typeSep ? +			const int lenInsert = typeSep ?  				static_cast<int>(typeSep-list) : static_cast<int>(strlen(list));  			if (ac.ignoreCase) {  				// May need to convert the case before invocation, so remove lenEntered characters @@ -262,7 +262,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {  	ac.Start(wMain, idAutoComplete, sel.MainCaret(), PointMainCaret(),  				lenEntered, vs.lineHeight, IsUnicodeMode(), technology); -	PRectangle rcClient = GetClientRectangle(); +	const PRectangle rcClient = GetClientRectangle();  	Point pt = LocationFromPosition(sel.MainCaret() - lenEntered);  	PRectangle rcPopupBounds = wMain.GetMonitorRect(pt);  	if (rcPopupBounds.Height() == 0) @@ -276,7 +276,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {  		pt = PointMainCaret();  	}  	if (wMargin.GetID()) { -		Point ptOrigin = GetVisibleOriginInMain(); +		const Point ptOrigin = GetVisibleOriginInMain();  		pt.x += ptOrigin.x;  		pt.y += ptOrigin.y;  	} @@ -296,7 +296,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {  	rcac.bottom = static_cast<XYPOSITION>(std::min(static_cast<int>(rcac.top) + heightLB, static_cast<int>(rcPopupBounds.bottom)));  	ac.lb->SetPositionRelative(rcac, wMain);  	ac.lb->SetFont(vs.styles[STYLE_DEFAULT].font); -	unsigned int aveCharWidth = static_cast<unsigned int>(vs.styles[STYLE_DEFAULT].aveCharWidth); +	const unsigned int aveCharWidth = static_cast<unsigned int>(vs.styles[STYLE_DEFAULT].aveCharWidth);  	ac.lb->SetAverageCharWidth(aveCharWidth);  	ac.lb->SetDelegate(this); @@ -304,7 +304,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {  	// Fiddle the position of the list so it is right next to the target and wide enough for all its strings  	PRectangle rcList = ac.lb->GetDesiredRect(); -	int heightAlloced = static_cast<int>(rcList.bottom - rcList.top); +	const int heightAlloced = static_cast<int>(rcList.bottom - rcList.top);  	widthLB = std::max(widthLB, static_cast<int>(rcList.right - rcList.left));  	if (maxListWidth != 0)  		widthLB = std::min(widthLB, static_cast<int>(aveCharWidth)*maxListWidth); @@ -346,7 +346,7 @@ void ScintillaBase::AutoCompleteMoveToCurrentWord() {  }  void ScintillaBase::AutoCompleteSelection() { -	int item = ac.GetSelection(); +	const int item = ac.GetSelection();  	std::string selected;  	if (item != -1) {  		selected = ac.GetValue(item); @@ -357,7 +357,7 @@ void ScintillaBase::AutoCompleteSelection() {  	scn.message = 0;  	scn.wParam = listType;  	scn.listType = listType; -	Sci::Position firstPos = ac.posStart - ac.startLen; +	const Sci::Position firstPos = ac.posStart - ac.startLen;  	scn.position = firstPos;  	scn.lParam = firstPos;  	scn.text = selected.c_str(); @@ -406,7 +406,7 @@ void ScintillaBase::AutoCompleteCompleted(char ch, unsigned int completionMethod  	scn.listCompletionMethod = completionMethod;  	scn.wParam = listType;  	scn.listType = listType; -	Sci::Position firstPos = ac.posStart - ac.startLen; +	const Sci::Position firstPos = ac.posStart - ac.startLen;  	scn.position = firstPos;  	scn.lParam = firstPos;  	scn.text = selected.c_str(); @@ -458,12 +458,12 @@ void ScintillaBase::CallTipShow(Point pt, const char *defn) {  	// If container knows about STYLE_CALLTIP then use it in place of the  	// STYLE_DEFAULT for the face name, size and character set. Also use it  	// for the foreground and background colour. -	int ctStyle = ct.UseStyleCallTip() ? STYLE_CALLTIP : STYLE_DEFAULT; +	const int ctStyle = ct.UseStyleCallTip() ? STYLE_CALLTIP : STYLE_DEFAULT;  	if (ct.UseStyleCallTip()) {  		ct.SetForeBack(vs.styles[STYLE_CALLTIP].fore, vs.styles[STYLE_CALLTIP].back);  	}  	if (wMargin.GetID()) { -		Point ptOrigin = GetVisibleOriginInMain(); +		const Point ptOrigin = GetVisibleOriginInMain();  		pt.x += ptOrigin.x;  		pt.y += ptOrigin.y;  	} @@ -479,7 +479,7 @@ void ScintillaBase::CallTipShow(Point pt, const char *defn) {  	// If the call-tip window would be out of the client  	// space  	const PRectangle rcClient = GetClientRectangle(); -	int offset = vs.lineHeight + static_cast<int>(rc.Height()); +	const int offset = vs.lineHeight + static_cast<int>(rc.Height());  	// adjust so it displays above the text.  	if (rc.bottom > rcClient.bottom && rc.Height() < rcClient.Height()) {  		rc.top -= offset; @@ -655,7 +655,7 @@ const char *LexState::DescribeWordListSets() {  void LexState::SetWordList(int n, const char *wl) {  	if (instance) { -		Sci_Position firstModification = instance->WordListSet(n, wl); +		const Sci_Position firstModification = instance->WordListSet(n, wl);  		if (firstModification >= 0) {  			pdoc->ModifiedAt(static_cast<Sci::Position>(firstModification));  		} @@ -701,7 +701,7 @@ const char *LexState::DescribeProperty(const char *name) {  void LexState::PropSet(const char *key, const char *val) {  	props.Set(key, val);  	if (instance) { -		Sci_Position firstModification = instance->PropertySet(key, val); +		const Sci_Position firstModification = instance->PropertySet(key, val);  		if (firstModification >= 0) {  			pdoc->ModifiedAt(static_cast<Sci::Position>(firstModification));  		} @@ -826,9 +826,9 @@ const char *LexState::DescriptionOfStyle(int style) {  void ScintillaBase::NotifyStyleToNeeded(Sci::Position endStyleNeeded) {  #ifdef SCI_LEXER  	if (DocumentLexState()->lexLanguage != SCLEX_CONTAINER) { -		Sci::Line lineEndStyled = static_cast<Sci::Line>( +		const Sci::Line lineEndStyled = static_cast<Sci::Line>(  			pdoc->LineFromPosition(pdoc->GetEndStyled())); -		Sci::Position endStyled = static_cast<Sci::Position>( +		const Sci::Position endStyled = static_cast<Sci::Position>(  			pdoc->LineStart(lineEndStyled));  		DocumentLexState()->Colourise(endStyled, endStyleNeeded);  		return; | 
