MAINT-6509 Viewer still allows you to create a group with leading spaces in the group name

master
Mnikolenko Productengine 2016-06-17 12:07:16 +03:00
parent aff8dcea75
commit 373947aba3
3 changed files with 11 additions and 1 deletions

View File

@ -328,6 +328,15 @@ namespace LLTextValidate
return rv;
}
bool validateASCIINoLeadingSpace(const LLWString &str)
{
if (LLStringOps::isSpace(str[0]))
{
return FALSE;
}
return validateASCII(str);
}
// Used for multiline text stored on the server.
// Example is landmark description in Places SP.
bool validateASCIIWithNewLine(const LLWString &str)

View File

@ -52,6 +52,7 @@ namespace LLTextValidate
bool validateASCIIPrintableNoPipe(const LLWString &str);
bool validateASCIIPrintableNoSpace(const LLWString &str);
bool validateASCII(const LLWString &str);
bool validateASCIINoLeadingSpace(const LLWString &str);
bool validateASCIIWithNewLine(const LLWString &str);
}

View File

@ -199,7 +199,7 @@ void LLPanelGroupGeneral::setupCtrls(LLPanel* panel_group)
mGroupNameEditor = panel_group->getChild<LLLineEditor>("group_name_editor");
mGroupNameEditor->setPrevalidate( LLTextValidate::validateASCII );
mGroupNameEditor->setPrevalidate( LLTextValidate::validateASCIINoLeadingSpace );
}