From 215f423cbe18fe9ca14a26caef918d303bad28ff Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:11 -0500 Subject: Second Life viewer sources 1.18.4.0-RC --- linden/indra/llinventory/llparcel.cpp | 46 ++++++++++++----------------------- 1 file changed, 16 insertions(+), 30 deletions(-) (limited to 'linden/indra/llinventory/llparcel.cpp') diff --git a/linden/indra/llinventory/llparcel.cpp b/linden/indra/llinventory/llparcel.cpp index 5902acd..3a67385 100644 --- a/linden/indra/llinventory/llparcel.cpp +++ b/linden/indra/llinventory/llparcel.cpp @@ -2,6 +2,8 @@ * @file llparcel.cpp * @brief A land parcel. * + * $LicenseInfo:firstyear=2002&license=viewergpl$ + * * Copyright (c) 2002-2007, Linden Research, Inc. * * Second Life Viewer Source Code @@ -24,6 +26,7 @@ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ */ #include "linden_common.h" @@ -256,42 +259,25 @@ void LLParcel::overrideParcelFlags(U32 flags) mParcelFlags = flags; } -void set_std_string(const char* src, std::string& dest) -{ - if(src) - { - dest.assign(src); - } - else - { -#if (LL_LINUX && __GNUC__ < 3) - dest.assign(std::string("")); -#else - dest.clear(); -#endif - } -} - -void LLParcel::setName(const char* name) +void LLParcel::setName(const LLString& name) { // The escaping here must match the escaping in the database // abstraction layer. - set_std_string(name, mName); + mName = name; LLStringFn::replace_nonprintable(mName, LL_UNKNOWN_CHAR); } -void LLParcel::setDesc(const char* desc) +void LLParcel::setDesc(const LLString& desc) { // The escaping here must match the escaping in the database // abstraction layer. - set_std_string(desc, mDesc); + mDesc = desc; mDesc = rawstr_to_utf8(mDesc); } -void LLParcel::setMusicURL(const char* url) +void LLParcel::setMusicURL(const LLString& url) { - set_std_string(url, mMusicURL); - + mMusicURL = url; // The escaping here must match the escaping in the database // abstraction layer. // This should really filter the url in some way. Other than @@ -299,10 +285,9 @@ void LLParcel::setMusicURL(const char* url) LLStringFn::replace_nonprintable(mMusicURL, LL_UNKNOWN_CHAR); } -void LLParcel::setMediaURL(const char* url) +void LLParcel::setMediaURL(const LLString& url) { - set_std_string(url, mMediaURL); - + mMediaURL = url; // The escaping here must match the escaping in the database // abstraction layer if it's ever added. // This should really filter the url in some way. Other than @@ -568,19 +553,19 @@ BOOL LLParcel::importStream(std::istream& input_stream) } else if ("name" == keyword) { - setName( value.c_str() ); + setName( value ); } else if ("desc" == keyword) { - setDesc( value.c_str() ); + setDesc( value ); } else if ("music_url" == keyword) { - setMusicURL( value.c_str() ); + setMusicURL( value ); } else if ("media_url" == keyword) { - setMediaURL( value.c_str() ); + setMediaURL( value ); } else if ("media_id" == keyword) { @@ -1835,3 +1820,4 @@ LLParcel::ECategory category_ui_string_to_category(const char* s) return LLParcel::C_ANY; } + -- cgit v1.1