diff options
author | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-07-21 19:25:36 +0300 |
---|---|---|
committer | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-07-21 19:25:36 +0300 |
commit | 4d2daeed21dfba9d6a40e88ecd92aaaa6df92ae1 (patch) | |
tree | 58a4fb4a1b9536d6f77d89a31fecefa7a93d6ac6 /indra | |
parent | f72de80c9d0f49cb0d1a2fbd00f8867f8e44f066 (diff) |
EXT-8401 FIXED Added new text prevalidation callback to allow ascii characters and new line in text editor.
Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/786/.
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/lltextvalidate.cpp | 18 | ||||
-rw-r--r-- | indra/llui/lltextvalidate.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_landmark_info.xml | 2 |
3 files changed, 20 insertions, 1 deletions
diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp index 8b6bc5bd7d..53c4d21151 100644 --- a/indra/llui/lltextvalidate.cpp +++ b/indra/llui/lltextvalidate.cpp @@ -50,6 +50,7 @@ namespace LLTextValidate declare("alpha_num_space", validateAlphaNumSpace); declare("ascii_printable_no_pipe", validateASCIIPrintableNoPipe); declare("ascii_printable_no_space", validateASCIIPrintableNoSpace); + declare("ascii_with_newline", validateASCIIWithNewLine); } // Limits what characters can be used to [1234567890.-] with [-] only valid in the first position. @@ -299,4 +300,21 @@ namespace LLTextValidate } return rv; } + + // Used for multiline text stored on the server. + // Example is landmark description in Places SP. + bool validateASCIIWithNewLine(const LLWString &str) + { + bool rv = TRUE; + S32 len = str.length(); + while(len--) + { + if (str[len] < 0x20 && str[len] != 0xA || str[len] > 0x7f) + { + rv = FALSE; + break; + } + } + return rv; + } } diff --git a/indra/llui/lltextvalidate.h b/indra/llui/lltextvalidate.h index ffb4e85e7c..c033f5045b 100644 --- a/indra/llui/lltextvalidate.h +++ b/indra/llui/lltextvalidate.h @@ -57,6 +57,7 @@ namespace LLTextValidate bool validateASCIIPrintableNoPipe(const LLWString &str); bool validateASCIIPrintableNoSpace(const LLWString &str); bool validateASCII(const LLWString &str); + bool validateASCIIWithNewLine(const LLWString &str); } diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml index 40cb7c7f4b..c5d6aced7a 100644 --- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml +++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml @@ -275,7 +275,7 @@ name="notes_editor" read_only="true" text_readonly_color="white" - text_type="ascii" + text_type="ascii_with_newline" top_pad="5" width="290" wrap="true" /> |