diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-06-26 00:39:00 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-06-26 00:39:00 +0000 |
commit | 25c10ed028da5c547b11f1f461916897272b0e6d (patch) | |
tree | 350a5858f8970b6e28b2dc395625d74d8bd597b2 /indra/llinventory/lltransactionflags.cpp | |
parent | 6dd125d375b38455997a0c4b8747659f4c2351aa (diff) |
QAR-628 merge string-cleanup-5 -r 90476:90508 -> release
dataserver-is-deprecated
Diffstat (limited to 'indra/llinventory/lltransactionflags.cpp')
-rw-r--r-- | indra/llinventory/lltransactionflags.cpp | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/indra/llinventory/lltransactionflags.cpp b/indra/llinventory/lltransactionflags.cpp index 6b90fbdc5a..3f82ad46ae 100644 --- a/indra/llinventory/lltransactionflags.cpp +++ b/indra/llinventory/lltransactionflags.cpp @@ -69,12 +69,12 @@ BOOL is_tf_owner_group(TransactionFlags flags) void append_reason( std::ostream& ostr, S32 transaction_type, - const char* description) + const std::string& description) { switch( transaction_type ) { case TRANS_OBJECT_SALE: - ostr << " for " << (description ? description : "<unknown>"); + ostr << " for " << (description.length() > 0 ? description : std::string("<unknown>")); break; case TRANS_LAND_SALE: ostr << " for a parcel of land"; @@ -95,16 +95,21 @@ std::string build_transfer_message_to_source( const LLUUID& dest_id, const std::string& dest_name, S32 transaction_type, - const char* desc) + const std::string& description) { - std::string description(ll_safe_string(desc)); lldebugs << "build_transfer_message_to_source: " << amount << " " << source_id << " " << dest_id << " " << dest_name << " " << transaction_type << " " - << (description.empty()?"(no desc)":description.c_str()) + << (description.empty() ? "(no desc)" : description) << llendl; - if(source_id.isNull()) return description; - if((0 == amount) && description.empty()) return description; + if(source_id.isNull()) + { + return description; + } + if((0 == amount) && description.empty()) + { + return description; + } std::ostringstream ostr; if(dest_id.isNull()) { @@ -127,7 +132,7 @@ std::string build_transfer_message_to_source( else { ostr << "You paid " << dest_name << " L$" << amount; - append_reason(ostr, transaction_type, description.c_str()); + append_reason(ostr, transaction_type, description); } ostr << "."; return ostr.str(); @@ -139,14 +144,20 @@ std::string build_transfer_message_to_destination( const LLUUID& source_id, const std::string& source_name, S32 transaction_type, - const char* description) + const std::string& description) { lldebugs << "build_transfer_message_to_dest: " << amount << " " << dest_id << " " << source_id << " " << source_name << " " - << transaction_type << " " << (description?description:"(no desc)") + << transaction_type << " " << (description.empty() ? "(no desc)" : description) << llendl; - if(0 == amount) return std::string(); - if(dest_id.isNull()) return ll_safe_string(description); + if(0 == amount) + { + return std::string(); + } + if(dest_id.isNull()) + { + return description; + } std::ostringstream ostr; ostr << source_name << " paid you L$" << amount; append_reason(ostr, transaction_type, description); |