summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelclassified.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelclassified.cpp')
-rw-r--r--indra/newview/llpanelclassified.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index 7c84d0f6a5..dbd97fc7d1 100644
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -224,6 +224,24 @@ BOOL LLPanelClassified::postBuild()
return TRUE;
}
+BOOL LLPanelClassified::titleIsValid()
+{
+ // Disallow leading spaces, punctuation, etc. that screw up
+ // sort order.
+ const LLString& name = mNameEditor->getText();
+ if (name.empty())
+ {
+ gViewerWindow->alertXml("BlankClassifiedName");
+ return FALSE;
+ }
+ if (!isalnum(name[0]))
+ {
+ gViewerWindow->alertXml("ClassifiedMustBeAlphanumeric");
+ return FALSE;
+ }
+
+ return TRUE;
+}
void LLPanelClassified::apply()
{
@@ -602,17 +620,10 @@ void LLPanelClassified::onClickUpdate(void* data)
// Disallow leading spaces, punctuation, etc. that screw up
// sort order.
- const LLString& name = self->mNameEditor->getText();
- if (name.empty())
+ if ( ! self->titleIsValid() )
{
- gViewerWindow->alertXml("BlankClassifiedName");
return;
- }
- if (!isalnum(name[0]))
- {
- gViewerWindow->alertXml("ClassifiedMustBeAlphanumeric");
- return;
- }
+ };
// if already paid for, just do the update
if (self->mPaidFor)