diff options
author | McCabe Maxsted | 2009-01-23 17:22:41 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-01-23 17:22:41 -0700 |
commit | 0cd8fbf9ead692deeb3cf34cfe11da90ca17b475 (patch) | |
tree | f1863e980b265450bbfa218078f2dd2295820239 | |
parent | Windows version sets its own gstreamer environment variable (diff) | |
download | meta-impy-0cd8fbf9ead692deeb3cf34cfe11da90ca17b475.zip meta-impy-0cd8fbf9ead692deeb3cf34cfe11da90ca17b475.tar.gz meta-impy-0cd8fbf9ead692deeb3cf34cfe11da90ca17b475.tar.bz2 meta-impy-0cd8fbf9ead692deeb3cf34cfe11da90ca17b475.tar.xz |
Backported Qarl's fix for VWR-8773: Closing parenthesis breaks urls
Diffstat (limited to '')
-rw-r--r-- | ChangeLog.txt | 6 | ||||
-rw-r--r-- | linden/indra/llui/lltexteditor.cpp | 48 |
2 files changed, 40 insertions, 14 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 18d743c..da21601 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt | |||
@@ -2,6 +2,12 @@ | |||
2 | =- 1.1.0 -= | 2 | =- 1.1.0 -= |
3 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | 3 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |
4 | 4 | ||
5 | 2009-01-23 McCabe Maxsted <hakushakukun@gmail.com> | ||
6 | |||
7 | * linden/indra/llui/lltexteditor.cpp: | ||
8 | Backported Qarl's fix for VWR-8773: Closing parenthesis breaks urls. | ||
9 | |||
10 | |||
5 | 2009-01-22 McCabe Maxsted <hakushakukun@gmail.com> | 11 | 2009-01-22 McCabe Maxsted <hakushakukun@gmail.com> |
6 | 12 | ||
7 | * linden/indra/newview/llappviewer.cpp: | 13 | * linden/indra/newview/llappviewer.cpp: |
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index e56002f..90199f1 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp | |||
@@ -4260,35 +4260,55 @@ S32 LLTextEditor::findHTMLToken(const std::string &line, S32 pos, BOOL reverse) | |||
4260 | std::string openers=" \t\n('\"[{<>"; | 4260 | std::string openers=" \t\n('\"[{<>"; |
4261 | std::string closers=" \t\n)'\"]}><;"; | 4261 | std::string closers=" \t\n)'\"]}><;"; |
4262 | 4262 | ||
4263 | S32 m2 = 0; | 4263 | S32 index = 0; |
4264 | S32 retval = 0; | ||
4265 | 4264 | ||
4266 | if (reverse) | 4265 | if (reverse) |
4267 | { | 4266 | { |
4268 | 4267 | for (index=pos; index >= 0; index--) | |
4269 | for (retval=pos; retval >= 0; retval--) | ||
4270 | { | 4268 | { |
4271 | m2 = openers.find(line.substr(retval,1)); | 4269 | char c = line[index]; |
4270 | S32 m2 = openers.find(c); | ||
4272 | if (m2 >= 0) | 4271 | if (m2 >= 0) |
4273 | { | 4272 | { |
4274 | break; | 4273 | return index+1; |
4275 | } | 4274 | } |
4276 | } | 4275 | } |
4277 | return retval+1; | ||
4278 | } | 4276 | } |
4279 | else | 4277 | else |
4280 | { | 4278 | { |
4281 | 4279 | // adjust the search slightly, to allow matching parenthesis inside the URL | |
4282 | for (retval=pos; retval<(S32)line.length(); retval++) | 4280 | S32 paren_count = 0; |
4281 | for (index=pos; index<(S32)line.length(); index++) | ||
4283 | { | 4282 | { |
4284 | m2 = closers.find(line.substr(retval,1)); | 4283 | char c = line[index]; |
4285 | if (m2 >= 0) | 4284 | |
4285 | if (c == '(') | ||
4286 | { | 4286 | { |
4287 | break; | 4287 | paren_count++; |
4288 | } | ||
4289 | else if (c == ')') | ||
4290 | { | ||
4291 | if (paren_count <= 0) | ||
4292 | { | ||
4293 | return index; | ||
4294 | } | ||
4295 | else | ||
4296 | { | ||
4297 | paren_count--; | ||
4298 | } | ||
4299 | } | ||
4300 | else | ||
4301 | { | ||
4302 | S32 m2 = closers.find(c); | ||
4303 | if (m2 >= 0) | ||
4304 | { | ||
4305 | return index; | ||
4306 | } | ||
4288 | } | 4307 | } |
4289 | } | 4308 | } |
4290 | return retval; | 4309 | } |
4291 | } | 4310 | |
4311 | return index; | ||
4292 | } | 4312 | } |
4293 | 4313 | ||
4294 | BOOL LLTextEditor::findHTML(const std::string &line, S32 *begin, S32 *end) const | 4314 | BOOL LLTextEditor::findHTML(const std::string &line, S32 *begin, S32 *end) const |