diff options
author | McCabe Maxsted | 2009-03-07 21:24:51 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-03-07 21:24:51 -0700 |
commit | 2f52d9dc25a0a52518cd57c59a02bf7f2688305f (patch) | |
tree | 85be58dfaae5cc2f91c064f99a5ccbb0f181a88d /linden/indra/newview/llvoavatar.cpp | |
parent | Landmark icons now correctly change color when visited (patch by Zi Ree--VWR-... (diff) | |
download | meta-impy-2f52d9dc25a0a52518cd57c59a02bf7f2688305f.zip meta-impy-2f52d9dc25a0a52518cd57c59a02bf7f2688305f.tar.gz meta-impy-2f52d9dc25a0a52518cd57c59a02bf7f2688305f.tar.bz2 meta-impy-2f52d9dc25a0a52518cd57c59a02bf7f2688305f.tar.xz |
Use std::string for nametags, removed bizarre name stacking option
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llvoavatar.cpp | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index fd2487b..7d70dd2 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp | |||
@@ -3096,69 +3096,62 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) | |||
3096 | (is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute) | 3096 | (is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute) |
3097 | || is_appearance != mNameAppearance) | 3097 | || is_appearance != mNameAppearance) |
3098 | { | 3098 | { |
3099 | char line[MAX_STRING]; /* Flawfinder: ignore */ | 3099 | std::string line; |
3100 | if (!sRenderGroupTitles) | 3100 | if (title && title->getString() && title->getString()[0] != '\0') |
3101 | { | ||
3102 | // If all group titles are turned off, stack first name | ||
3103 | // on a line above last name | ||
3104 | strncpy(line, firstname->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */ | ||
3105 | line[MAX_STRING -1] = '\0'; | ||
3106 | strcat(line, "\n"); | ||
3107 | } | ||
3108 | else if (title && title->getString() && title->getString()[0] != '\0') | ||
3109 | { | 3101 | { |
3110 | strncpy(line, title->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */ | 3102 | line += title->getString(); |
3111 | line[MAX_STRING -1] = '\0'; | 3103 | LLStringFn::replace_nonprintable(line,LL_UNKNOWN_CHAR); |
3112 | strcat(line, "\n"); /* Flawfinder: ignore */ | 3104 | line += "\n"; |
3113 | strncat(line, firstname->getString(), MAX_STRING - strlen(line) -1 ); /* Flawfinder: ignore */ | 3105 | line += firstname->getString(); |
3114 | } | 3106 | } |
3115 | else | 3107 | else |
3116 | { | 3108 | { |
3117 | strncpy(line, firstname->getString(), MAX_STRING -1 ); /* Flawfinder: ignore */ | 3109 | line += firstname->getString(); |
3118 | line[MAX_STRING -1] = '\0'; | ||
3119 | } | 3110 | } |
3120 | 3111 | ||
3121 | strcat(line, " "); /* Flawfinder: ignore */ | 3112 | line += " "; |
3122 | strncat(line, lastname->getString(), MAX_STRING - strlen(line) -1); /* Flawfinder: ignore */ | 3113 | line += lastname->getString(); |
3123 | BOOL need_comma = FALSE; | 3114 | BOOL need_comma = FALSE; |
3124 | 3115 | ||
3125 | if (is_away || is_muted || is_busy) | 3116 | if (is_away || is_muted || is_busy) |
3126 | { | 3117 | { |
3127 | strcat(line, " ("); /* Flawfinder: ignore */ | 3118 | line += " ("; |
3128 | if (is_away) | 3119 | if (is_away) |
3129 | { | 3120 | { |
3130 | strcat(line, "Away"); /* Flawfinder: ignore */ | 3121 | line += "Away"; |
3131 | need_comma = TRUE; | 3122 | need_comma = TRUE; |
3132 | } | 3123 | } |
3133 | if (is_busy) | 3124 | if (is_busy) |
3134 | { | 3125 | { |
3135 | if (need_comma) | 3126 | if (need_comma) |
3136 | { | 3127 | { |
3137 | strcat(line, ", "); /* Flawfinder: ignore */ | 3128 | line += ", "; |
3138 | } | 3129 | } |
3139 | strcat(line, "Busy"); /* Flawfinder: ignore */ | 3130 | line += "Busy"; |
3140 | need_comma = TRUE; | 3131 | need_comma = TRUE; |
3141 | } | 3132 | } |
3142 | if (is_muted) | 3133 | if (is_muted) |
3143 | { | 3134 | { |
3144 | if (need_comma) | 3135 | if (need_comma) |
3145 | { | 3136 | { |
3146 | strcat(line, ", "); /* Flawfinder: ignore */ | 3137 | line += ", "; |
3147 | } | 3138 | } |
3148 | strcat(line, "Muted"); /* Flawfinder: ignore */ | 3139 | line += "Muted"; |
3149 | need_comma = TRUE; | 3140 | need_comma = TRUE; |
3150 | } | 3141 | } |
3151 | strcat(line,")"); /* Flawfinder: ignore */ | 3142 | line += ")"; |
3152 | } | 3143 | } |
3153 | if (is_appearance) | 3144 | if (is_appearance) |
3154 | { | 3145 | { |
3155 | strcat(line, "\n(Editing Appearance)"); /* Flawfinder: ignore */ | 3146 | line += "\n"; |
3147 | line += "(Editing Appearance)"; | ||
3156 | } | 3148 | } |
3157 | mNameAway = is_away; | 3149 | mNameAway = is_away; |
3158 | mNameBusy = is_busy; | 3150 | mNameBusy = is_busy; |
3159 | mNameMute = is_muted; | 3151 | mNameMute = is_muted; |
3160 | mNameAppearance = is_appearance; | 3152 | mNameAppearance = is_appearance; |
3161 | mTitle = title ? title->getString() : ""; | 3153 | mTitle = title ? title->getString() : ""; |
3154 | LLStringFn::replace_nonprintable(mTitle,LL_UNKNOWN_CHAR); | ||
3162 | mNameString = utf8str_to_wstring(line); | 3155 | mNameString = utf8str_to_wstring(line); |
3163 | new_name = TRUE; | 3156 | new_name = TRUE; |
3164 | } | 3157 | } |