@@ -132,7 +132,7 @@ FileType* BaseEditor::chooseFileTypeCh(const UnicodeString* fileName, int choose
132
132
UnicodeString textStart;
133
133
int totalLength = 0 ;
134
134
for (int i = 0 ; i < chooseStr; i++) {
135
- UnicodeString* iLine = lineSource->getLine (i);
135
+ const UnicodeString* iLine = lineSource->getLine (i);
136
136
if (iLine == nullptr ) {
137
137
break ;
138
138
}
@@ -164,10 +164,11 @@ FileType* BaseEditor::chooseFileType(const UnicodeString* fileName)
164
164
currentFileType = parserFactory->getHrcLibrary ().chooseFileType (fileName, nullptr );
165
165
}
166
166
else {
167
- int chooseStr = CHOOSE_STR, chooseLen = CHOOSE_LEN;
167
+ int chooseStr = CHOOSE_STR;
168
+ int chooseLen = CHOOSE_LEN;
168
169
169
170
UnicodeString ds_def = UnicodeString (" default" );
170
- FileType* def = parserFactory->getHrcLibrary ().getFileType (&ds_def);
171
+ const FileType* def = parserFactory->getHrcLibrary ().getFileType (&ds_def);
171
172
if (def) {
172
173
chooseStr = def->getParamValueInt (" firstlines" , chooseStr);
173
174
chooseLen = def->getParamValueInt (" firstlinebytes" , chooseLen);
@@ -360,7 +361,7 @@ void BaseEditor::lineCountEvent(int newLineCount)
360
361
lineCount = newLineCount;
361
362
}
362
363
363
- inline int BaseEditor::getLastVisibleLine ()
364
+ inline int BaseEditor::getLastVisibleLine () const
364
365
{
365
366
int r1 = (wStart + wSize);
366
367
int r2 = lineCount;
@@ -369,7 +370,8 @@ inline int BaseEditor::getLastVisibleLine()
369
370
370
371
void BaseEditor::validate (int lno, bool rebuildRegions)
371
372
{
372
- int parseFrom, parseTo;
373
+ int parseFrom;
374
+ int parseTo;
373
375
bool layoutChanged = false ;
374
376
TextParser::TextParseMode tpmode = TextParser::TextParseMode::TPM_CACHE_READ;
375
377
@@ -420,8 +422,7 @@ void BaseEditor::validate(int lno, bool rebuildRegions)
420
422
}
421
423
firstLine = newFirstLine;
422
424
layoutChanged = true ;
423
- COLORER_LOG_DEBUG (" [BaseEditor] newFirstLine=%, parseFrom=%, parseTo=%" , firstLine, parseFrom,
424
- parseTo);
425
+ COLORER_LOG_DEBUG (" [BaseEditor] newFirstLine=%, parseFrom=%, parseTo=%" , firstLine, parseFrom, parseTo);
425
426
}
426
427
427
428
if (!layoutChanged) {
@@ -445,7 +446,7 @@ void BaseEditor::validate(int lno, bool rebuildRegions)
445
446
/* Runs parser */
446
447
if (parseTo - parseFrom > 0 ) {
447
448
COLORER_LOG_DEBUG (" [BaseEditor] validate:parse:%-%, %" , parseFrom, parseTo,
448
- tpmode == TextParser::TextParseMode::TPM_CACHE_READ ? " READ" : " UPDATE" );
449
+ tpmode == TextParser::TextParseMode::TPM_CACHE_READ ? " READ" : " UPDATE" );
449
450
int stopLine = textParser->parse (parseFrom, parseTo - parseFrom, tpmode);
450
451
451
452
if (tpmode == TextParser::TextParseMode::TPM_CACHE_UPDATE) {
@@ -518,7 +519,7 @@ void BaseEditor::leaveScheme(size_t lno, UnicodeString* line, int sx, int ex, co
518
519
}
519
520
}
520
521
521
- bool BaseEditor::haveInvalidLine ()
522
+ bool BaseEditor::haveInvalidLine () const
522
523
{
523
524
return invalidLine < lineCount;
524
525
}
0 commit comments