diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-07-27 15:17:57 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-07-28 08:24:59 +0800 |
commit | 96a81b5ecbe3bffb582ded930752c0523df5e80a (patch) | |
tree | a87a0bd09fd980562e88150dbfea3819d28d9f12 /indra/llui/lltextparser.cpp | |
parent | 06e8f0c443c1ba7858d000c6d695b7e988e02053 (diff) | |
parent | ed73208eb96b862b97fa285036edea1e792ca3c6 (diff) |
Merge remote-tracking branch 'secondlife/release/2024.06-atlasaurus' into 2024.06-atlasaurus
Diffstat (limited to 'indra/llui/lltextparser.cpp')
-rw-r--r-- | indra/llui/lltextparser.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/indra/llui/lltextparser.cpp b/indra/llui/lltextparser.cpp index 7bb7c7f7bb..097b168106 100644 --- a/indra/llui/lltextparser.cpp +++ b/indra/llui/lltextparser.cpp @@ -73,11 +73,11 @@ S32 LLTextParser::findPattern(const std::string &text, LLSD highlight) found = (! ltext.find(pattern) ? 0 : std::string::npos); break; case ENDS_WITH: - S32 pos = ltext.rfind(pattern); - if (pos >= 0 && (ltext.length()-pattern.length()==pos)) found = pos; + auto pos = ltext.rfind(pattern); + if (pos != std::string::npos && pos >= 0 && (ltext.length() - pattern.length() == pos)) found = pos; break; } - return found; + return static_cast<S32>(found); } LLSD LLTextParser::parsePartialLineHighlights(const std::string &text, const LLColor4 &color, EHighlightPosition part, S32 index) @@ -99,8 +99,8 @@ LLSD LLTextParser::parsePartialLineHighlights(const std::string &text, const LLC S32 start = findPattern(text,mHighlights[i]); if (start >= 0 ) { - S32 end = std::string(mHighlights[i]["pattern"]).length(); - S32 len = text.length(); + auto end = std::string(mHighlights[i]["pattern"]).length(); + auto len = text.length(); EHighlightPosition newpart; if (start==0) { @@ -184,11 +184,11 @@ bool LLTextParser::parseFullLineHighlights(const std::string &text, LLColor4 *co { LLSD color_llsd = mHighlights[i]["color"]; color->setValue(color_llsd); - return TRUE; + return true; } } } - return FALSE; //No matches found. + return false; //No matches found. } std::string LLTextParser::getFileName() @@ -229,11 +229,11 @@ bool LLTextParser::saveToDisk(LLSD highlights) if (filename.empty()) { LL_WARNS() << "LLTextParser::saveToDisk() no valid user directory." << LL_ENDL; - return FALSE; + return false; } llofstream file; file.open(filename.c_str()); LLSDSerialize::toPrettyXML(mHighlights, file); file.close(); - return TRUE; + return true; } |