Automated merge with tip of viewer-release

Thu, 01 Mar 2018 14:33:47 -0800

author
callum_linden
date
Thu, 01 Mar 2018 14:33:47 -0800
changeset 55080
7d60d617f377
parent 55079
2f4d6e168250
parent 54952
d96226d41736
child 55081
cd11db88290d
child 55084
bcb31ad86000

Automated merge with tip of viewer-release

autobuild.xml file | annotate | diff | revisions
indra/newview/llfloatertwitter.cpp file | annotate | diff | revisions
indra/newview/llstartup.cpp file | annotate | diff | revisions
indra/newview/llviewermedia.cpp file | annotate | diff | revisions
     1.1 --- a/.hgtags	Thu Mar 01 09:34:25 2018 -0800
     1.2 +++ b/.hgtags	Thu Mar 01 14:33:47 2018 -0800
     1.3 @@ -533,3 +533,4 @@
     1.4  40ca7118765be85a043b31b011e4ee6bd9e33c95 5.0.9-release
     1.5  ad0e15543836d64d6399d28b32852510435e344a 5.1.0-release
     1.6  26d9e9bb166a9a417f35b1863223a597af8185fd 5.1.1-release
     1.7 +2eb917875efdfe920680b9049302d0f03721245d 5.1.2-release
     2.1 --- a/autobuild.xml	Thu Mar 01 09:34:25 2018 -0800
     2.2 +++ b/autobuild.xml	Thu Mar 01 14:33:47 2018 -0800
     2.3 @@ -3260,9 +3260,9 @@
     2.4              <key>archive</key>
     2.5              <map>
     2.6                <key>hash</key>
     2.7 -              <string>c4d56d3e942169661a598035a9fbd533</string>
     2.8 +              <string>f1248b6692dcbb1a42db87ca8d9fed93</string>
     2.9                <key>url</key>
    2.10 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/12112/71187/viewer_manager-1.0.511688-darwin64-511688.tar.bz2</string>
    2.11 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/13982/87166/viewer_manager-1.0.512801-darwin64-512801.tar.bz2</string>
    2.12              </map>
    2.13              <key>name</key>
    2.14              <string>darwin64</string>
    2.15 @@ -3284,9 +3284,9 @@
    2.16              <key>archive</key>
    2.17              <map>
    2.18                <key>hash</key>
    2.19 -              <string>61f324d880eaa303669b99e28e6cf64c</string>
    2.20 +              <string>c174ecc0893f8c193571b1dc80b823ad</string>
    2.21                <key>url</key>
    2.22 -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/12113/71193/viewer_manager-1.0.511688-windows-511688.tar.bz2</string>
    2.23 +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/13983/87172/viewer_manager-1.0.512801-windows-512801.tar.bz2</string>
    2.24              </map>
    2.25              <key>name</key>
    2.26              <string>windows</string>
    2.27 @@ -3297,7 +3297,7 @@
    2.28          <key>source_type</key>
    2.29          <string>hg</string>
    2.30          <key>version</key>
    2.31 -        <string>1.0.511688</string>
    2.32 +        <string>1.0.512801</string>
    2.33        </map>
    2.34        <key>vlc-bin</key>
    2.35        <map>
     3.1 --- a/doc/contributions.txt	Thu Mar 01 09:34:25 2018 -0800
     3.2 +++ b/doc/contributions.txt	Thu Mar 01 14:33:47 2018 -0800
     3.3 @@ -217,6 +217,7 @@
     3.4  	MAINT-6519
     3.5  	MAINT-7899
     3.6  	STORM-2105
     3.7 +	STORM-2151
     3.8  Aralara Rajal
     3.9  Arare Chantilly
    3.10  	CHUIBUG-191
     4.1 --- a/indra/llcommon/llsdserialize.cpp	Thu Mar 01 09:34:25 2018 -0800
     4.2 +++ b/indra/llcommon/llsdserialize.cpp	Thu Mar 01 14:33:47 2018 -0800
     4.3 @@ -2121,22 +2121,13 @@
     4.4  	deflateEnd(&strm);
     4.5  	free(output);
     4.6  
     4.7 -#if 0 //verify results work with unzip_llsd
     4.8 -	std::istringstream test(result);
     4.9 -	LLSD test_sd;
    4.10 -	if (!unzip_llsd(test_sd, test, result.size()))
    4.11 -	{
    4.12 -		LL_ERRS() << "Invalid compression result!" << LL_ENDL;
    4.13 -	}
    4.14 -#endif
    4.15 -
    4.16  	return result;
    4.17  }
    4.18  
    4.19  //decompress a block of LLSD from provided istream
    4.20  // not very efficient -- creats a copy of decompressed LLSD block in memory
    4.21  // and deserializes from that copy using LLSDSerialize
    4.22 -bool unzip_llsd(LLSD& data, std::istream& is, S32 size)
    4.23 +LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, std::istream& is, S32 size)
    4.24  {
    4.25  	U8* result = NULL;
    4.26  	U32 cur_size = 0;
    4.27 @@ -2144,7 +2135,11 @@
    4.28  		
    4.29  	const U32 CHUNK = 65536;
    4.30  
    4.31 -	U8 *in = new U8[size];
    4.32 +	U8 *in = new(std::nothrow) U8[size];
    4.33 +	if (!in)
    4.34 +	{
    4.35 +		return ZR_MEM_ERROR;
    4.36 +	}
    4.37  	is.read((char*) in, size); 
    4.38  
    4.39  	U8 out[CHUNK];
    4.40 @@ -2167,7 +2162,7 @@
    4.41  			inflateEnd(&strm);
    4.42  			free(result);
    4.43  			delete [] in;
    4.44 -			return false;
    4.45 +			return ZR_DATA_ERROR;
    4.46  		}
    4.47  		
    4.48  		switch (ret)
    4.49 @@ -2179,7 +2174,7 @@
    4.50  			inflateEnd(&strm);
    4.51  			free(result);
    4.52  			delete [] in;
    4.53 -			return false;
    4.54 +			return ZR_MEM_ERROR;
    4.55  			break;
    4.56  		}
    4.57  
    4.58 @@ -2188,14 +2183,13 @@
    4.59  		U8* new_result = (U8*)realloc(result, cur_size + have);
    4.60  		if (new_result == NULL)
    4.61  		{
    4.62 -			LL_WARNS() << "Failed to unzip LLSD block: can't reallocate memory, current size: " << cur_size << " bytes; requested " << cur_size + have << " bytes." << LL_ENDL;
    4.63  			inflateEnd(&strm);
    4.64  			if (result)
    4.65  			{
    4.66  				free(result);
    4.67  			}
    4.68  			delete[] in;
    4.69 -			return false;
    4.70 +			return ZR_MEM_ERROR;
    4.71  		}
    4.72  		result = new_result;
    4.73  		memcpy(result+cur_size, out, have);
    4.74 @@ -2209,33 +2203,50 @@
    4.75  	if (ret != Z_STREAM_END)
    4.76  	{
    4.77  		free(result);
    4.78 -		return false;
    4.79 +		return ZR_DATA_ERROR;
    4.80  	}
    4.81  
    4.82  	//result now points to the decompressed LLSD block
    4.83  	{
    4.84 -		std::string res_str((char*) result, cur_size);
    4.85 +		std::istringstream istr;
    4.86 +		// Since we are using this for meshes, data we are dealing with tend to be large.
    4.87 +		// So string can potentially fail to allocate, make sure this won't cause problems
    4.88 +		try
    4.89 +		{
    4.90 +			std::string res_str((char*)result, cur_size);
    4.91  
    4.92 -		std::string deprecated_header("<? LLSD/Binary ?>");
    4.93 +			std::string deprecated_header("<? LLSD/Binary ?>");
    4.94  
    4.95 -		if (res_str.substr(0, deprecated_header.size()) == deprecated_header)
    4.96 +			if (res_str.substr(0, deprecated_header.size()) == deprecated_header)
    4.97 +			{
    4.98 +				res_str = res_str.substr(deprecated_header.size() + 1, cur_size);
    4.99 +			}
   4.100 +			cur_size = res_str.size();
   4.101 +
   4.102 +			istr.str(res_str);
   4.103 +		}
   4.104 +#ifdef LL_WINDOWS
   4.105 +		catch (std::length_error)
   4.106  		{
   4.107 -			res_str = res_str.substr(deprecated_header.size()+1, cur_size);
   4.108 +			free(result);
   4.109 +			return ZR_SIZE_ERROR;
   4.110  		}
   4.111 -		cur_size = res_str.size();
   4.112 +#endif
   4.113 +		catch (std::bad_alloc)
   4.114 +		{
   4.115 +			free(result);
   4.116 +			return ZR_MEM_ERROR;
   4.117 +		}
   4.118  
   4.119 -		std::istringstream istr(res_str);
   4.120 -		
   4.121  		if (!LLSDSerialize::fromBinary(data, istr, cur_size))
   4.122  		{
   4.123 -			LL_WARNS() << "Failed to unzip LLSD block" << LL_ENDL;
   4.124  			free(result);
   4.125 -			return false;
   4.126 -		}		
   4.127 +			return ZR_PARSE_ERROR;
   4.128 +		}
   4.129  	}
   4.130  
   4.131  	free(result);
   4.132 -	return true;
   4.133 +	return ZR_OK;
   4.134  }
   4.135  //This unzip function will only work with a gzip header and trailer - while the contents
   4.136  //of the actual compressed data is the same for either format (gzip vs zlib ), the headers
     5.1 --- a/indra/llcommon/llsdserialize.h	Thu Mar 01 09:34:25 2018 -0800
     5.2 +++ b/indra/llcommon/llsdserialize.h	Thu Mar 01 14:33:47 2018 -0800
     5.3 @@ -814,8 +814,24 @@
     5.4  	}
     5.5  };
     5.6  
     5.7 +class LL_COMMON_API LLUZipHelper : public LLRefCount
     5.8 +{
     5.9 +public:
    5.10 +    typedef enum e_zip_result
    5.11 +    {
    5.12 +        ZR_OK = 0,
    5.13 +        ZR_MEM_ERROR,
    5.14 +        ZR_SIZE_ERROR,
    5.15 +        ZR_DATA_ERROR,
    5.16 +        ZR_PARSE_ERROR,
    5.17 +    } EZipRresult;
    5.18 +    // return OK or reason for failure
    5.19 +    static EZipRresult unzip_llsd(LLSD& data, std::istream& is, S32 size);
    5.20 +};
    5.21 +
    5.22  //dirty little zip functions -- yell at davep
    5.23  LL_COMMON_API std::string zip_llsd(LLSD& data);
    5.24 -LL_COMMON_API bool unzip_llsd(LLSD& data, std::istream& is, S32 size);
    5.25 +
    5.26 +
    5.27  LL_COMMON_API U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize,std::istream& is, S32 size);
    5.28  #endif // LL_LLSDSERIALIZE_H
     6.1 --- a/indra/llcommon/llthread.cpp	Thu Mar 01 09:34:25 2018 -0800
     6.2 +++ b/indra/llcommon/llthread.cpp	Thu Mar 01 14:33:47 2018 -0800
     6.3 @@ -129,50 +129,32 @@
     6.4  
     6.5      sThreadID = threadp->mID;
     6.6  
     6.7 -    try
     6.8 +    // Run the user supplied function
     6.9 +    do 
    6.10      {
    6.11 -        // Run the user supplied function
    6.12 -        do 
    6.13 +        try
    6.14          {
    6.15 -            try
    6.16 -            {
    6.17 -                threadp->run();
    6.18 -            }
    6.19 -            catch (const LLContinueError &e)
    6.20 -            {
    6.21 -                LL_WARNS("THREAD") << "ContinueException on thread '" << threadp->mName <<
    6.22 -                    "' reentering run(). Error what is: '" << e.what() << "'" << LL_ENDL;
    6.23 -                //output possible call stacks to log file.
    6.24 -                LLError::LLCallStacks::print();
    6.25 +            threadp->run();
    6.26 +        }
    6.27 +        catch (const LLContinueError &e)
    6.28 +        {
    6.29 +            LL_WARNS("THREAD") << "ContinueException on thread '" << threadp->mName <<
    6.30 +                "' reentering run(). Error what is: '" << e.what() << "'" << LL_ENDL;
    6.31 +            //output possible call stacks to log file.
    6.32 +            LLError::LLCallStacks::print();
    6.33  
    6.34 -                LOG_UNHANDLED_EXCEPTION("LLThread");
    6.35 -                continue;
    6.36 -            }
    6.37 -            break;
    6.38 +            LOG_UNHANDLED_EXCEPTION("LLThread");
    6.39 +            continue;
    6.40 +        }
    6.41 +        break;
    6.42  
    6.43 -        } while (true);
    6.44 +    } while (true);
    6.45  
    6.46 -        //LL_INFOS() << "LLThread::staticRun() Exiting: " << threadp->mName << LL_ENDL;
    6.47 +    //LL_INFOS() << "LLThread::staticRun() Exiting: " << threadp->mName << LL_ENDL;
    6.48  
    6.49 -        // We're done with the run function, this thread is done executing now.
    6.50 -        //NB: we are using this flag to sync across threads...we really need memory barriers here
    6.51 -        threadp->mStatus = STOPPED;
    6.52 -    }
    6.53 -    catch (std::bad_alloc)
    6.54 -    {
    6.55 -        threadp->mStatus = CRASHED;
    6.56 -        LLMemory::logMemoryInfo(TRUE);
    6.57 -
    6.58 -        //output possible call stacks to log file.
    6.59 -        LLError::LLCallStacks::print();
    6.60 -
    6.61 -        LL_ERRS("THREAD") << "Bad memory allocation in LLThread::staticRun() named '" << threadp->mName << "'!" << LL_ENDL;
    6.62 -    }
    6.63 -    catch (...)
    6.64 -    {
    6.65 -        threadp->mStatus = CRASHED;
    6.66 -        CRASH_ON_UNHANDLED_EXCEPTION("LLThread");
    6.67 -    }
    6.68 +    // We're done with the run function, this thread is done executing now.
    6.69 +    //NB: we are using this flag to sync across threads...we really need memory barriers here
    6.70 +    threadp->mStatus = STOPPED;
    6.71  
    6.72      delete threadp->mRecorder;
    6.73      threadp->mRecorder = NULL;
     7.1 --- a/indra/llimage/llimage.cpp	Thu Mar 01 09:34:25 2018 -0800
     7.2 +++ b/indra/llimage/llimage.cpp	Thu Mar 01 14:33:47 2018 -0800
     7.3 @@ -748,7 +748,11 @@
     7.4  	{
     7.5  		size = 0;
     7.6  		mWidth = mHeight = 0;
     7.7 -		mData = NULL;
     7.8 +		if (mData)
     7.9 +		{
    7.10 +			deleteData(); // virtual
    7.11 +			mData = NULL;
    7.12 +		}
    7.13  	}
    7.14  	mDataSize = size;
    7.15  	claimMem(mDataSize);
    7.16 @@ -775,6 +779,7 @@
    7.17  	disclaimMem(mDataSize);
    7.18  	mDataSize = size;
    7.19  	claimMem(mDataSize);
    7.20 +	mBadBufferAllocation = false;
    7.21  	return mData;
    7.22  }
    7.23  
     8.1 --- a/indra/llimage/llimagedimensionsinfo.cpp	Thu Mar 01 09:34:25 2018 -0800
     8.2 +++ b/indra/llimage/llimagedimensionsinfo.cpp	Thu Mar 01 14:33:47 2018 -0800
     8.3 @@ -163,7 +163,7 @@
     8.4  {
     8.5  	sJpegErrorEncountered = false;
     8.6  	clean();
     8.7 -	FILE *fp = fopen (mSrcFilename.c_str(), "rb");
     8.8 +	FILE *fp = LLFile::fopen(mSrcFilename, "rb");
     8.9  	if (fp == NULL) 
    8.10  	{
    8.11  		setLastError("Unable to open file for reading", mSrcFilename);
     9.1 --- a/indra/llimage/llimagej2c.cpp	Thu Mar 01 09:34:25 2018 -0800
     9.2 +++ b/indra/llimage/llimagej2c.cpp	Thu Mar 01 14:33:47 2018 -0800
     9.3 @@ -369,19 +369,28 @@
     9.4  	else
     9.5  	{
     9.6  		U8 *data = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), file_size);
     9.7 -		apr_size_t bytes_read = file_size;
     9.8 -		apr_status_t s = apr_file_read(apr_file, data, &bytes_read); // modifies bytes_read	
     9.9 -		infile.close() ;
    9.10 -
    9.11 -		if (s != APR_SUCCESS || (S32)bytes_read != file_size)
    9.12 +		if (!data)
    9.13  		{
    9.14 -			FREE_MEM(LLImageBase::getPrivatePool(), data);
    9.15 -			setLastError("Unable to read entire file");
    9.16 +			infile.close();
    9.17 +			setLastError("Out of memory", filename);
    9.18  			res = false;
    9.19  		}
    9.20  		else
    9.21  		{
    9.22 -			res = validate(data, file_size);
    9.23 +			apr_size_t bytes_read = file_size;
    9.24 +			apr_status_t s = apr_file_read(apr_file, data, &bytes_read); // modifies bytes_read	
    9.25 +			infile.close();
    9.26 +
    9.27 +			if (s != APR_SUCCESS || (S32)bytes_read != file_size)
    9.28 +			{
    9.29 +				FREE_MEM(LLImageBase::getPrivatePool(), data);
    9.30 +				setLastError("Unable to read entire file");
    9.31 +				res = false;
    9.32 +			}
    9.33 +			else
    9.34 +			{
    9.35 +				res = validate(data, file_size);
    9.36 +			}
    9.37  		}
    9.38  	}
    9.39  	
    10.1 --- a/indra/llmath/llvolume.cpp	Thu Mar 01 09:34:25 2018 -0800
    10.2 +++ b/indra/llmath/llvolume.cpp	Thu Mar 01 14:33:47 2018 -0800
    10.3 @@ -2367,9 +2367,10 @@
    10.4  	//input stream is now pointing at a zlib compressed block of LLSD
    10.5  	//decompress block
    10.6  	LLSD mdl;
    10.7 -	if (!unzip_llsd(mdl, is, size))
    10.8 -	{
    10.9 -		LL_DEBUGS("MeshStreaming") << "Failed to unzip LLSD blob for LoD, will probably fetch from sim again." << LL_ENDL;
   10.10 +	U32 uzip_result = LLUZipHelper::unzip_llsd(mdl, is, size);
   10.11 +	if (uzip_result != LLUZipHelper::ZR_OK)
   10.12 +	{
   10.13 +		LL_DEBUGS("MeshStreaming") << "Failed to unzip LLSD blob for LoD with code " << uzip_result << " , will probably fetch from sim again." << LL_ENDL;
   10.14  		return false;
   10.15  	}
   10.16  	
   10.17 @@ -2676,11 +2677,17 @@
   10.18  			}
   10.19  		}
   10.20  	}
   10.21 +
   10.22 +	if (!cacheOptimize())
   10.23 +	{
   10.24 +		// Out of memory?
   10.25 +		LL_WARNS() << "Failed to optimize!" << LL_ENDL;
   10.26 +		mVolumeFaces.clear();
   10.27 +		return false;
   10.28 +	}
   10.29  	
   10.30  	mSculptLevel = 0;  // success!
   10.31  
   10.32 -	cacheOptimize();
   10.33 -
   10.34  	return true;
   10.35  }
   10.36  
   10.37 @@ -2712,12 +2719,16 @@
   10.38  	mSculptLevel = 0;
   10.39  }
   10.40  
   10.41 -void LLVolume::cacheOptimize()
   10.42 +bool LLVolume::cacheOptimize()
   10.43  {
   10.44  	for (S32 i = 0; i < mVolumeFaces.size(); ++i)
   10.45  	{
   10.46 -		mVolumeFaces[i].cacheOptimize();
   10.47 -	}
   10.48 +		if (!mVolumeFaces[i].cacheOptimize())
   10.49 +		{
   10.50 +			return false;
   10.51 +		}
   10.52 +	}
   10.53 +	return true;
   10.54  }
   10.55  
   10.56  
   10.57 @@ -5173,7 +5184,7 @@
   10.58  };
   10.59  
   10.60  
   10.61 -void LLVolumeFace::cacheOptimize()
   10.62 +bool LLVolumeFace::cacheOptimize()
   10.63  { //optimize for vertex cache according to Forsyth method: 
   10.64    // http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html
   10.65  	
   10.66 @@ -5184,7 +5195,7 @@
   10.67  	
   10.68  	if (mNumVertices < 3)
   10.69  	{ //nothing to do
   10.70 -		return;
   10.71 +		return true;
   10.72  	}
   10.73  
   10.74  	//mapping of vertices to triangles and indices
   10.75 @@ -5193,8 +5204,16 @@
   10.76  	//mapping of triangles do vertices
   10.77  	std::vector<LLVCacheTriangleData> triangle_data;
   10.78  
   10.79 -	triangle_data.resize(mNumIndices/3);
   10.80 -	vertex_data.resize(mNumVertices);
   10.81 +	try
   10.82 +	{
   10.83 +		triangle_data.resize(mNumIndices / 3);
   10.84 +		vertex_data.resize(mNumVertices);
   10.85 +	}
   10.86 +	catch (std::bad_alloc)
   10.87 +	{
   10.88 +		LL_WARNS("LLVOLUME") << "Resize failed" << LL_ENDL;
   10.89 +		return false;
   10.90 +	}
   10.91  
   10.92  	for (U32 i = 0; i < mNumIndices; i++)
   10.93  	{ //populate vertex data and triangle data arrays
   10.94 @@ -5306,7 +5325,8 @@
   10.95  	LLVector4a* pos = (LLVector4a*) ll_aligned_malloc<64>(sizeof(LLVector4a)*2*num_verts+size);
   10.96  	if (pos == NULL)
   10.97  	{
   10.98 -		LL_ERRS("LLVOLUME") << "Allocation of positions vector[" << sizeof(LLVector4a) * 2 * num_verts + size  << "] failed. " << LL_ENDL;
   10.99 +		LL_WARNS("LLVOLUME") << "Allocation of positions vector[" << sizeof(LLVector4a) * 2 * num_verts + size  << "] failed. " << LL_ENDL;
  10.100 +		return false;
  10.101  	}
  10.102  	LLVector4a* norm = pos + num_verts;
  10.103  	LLVector2* tc = (LLVector2*) (norm + num_verts);
  10.104 @@ -5317,7 +5337,9 @@
  10.105  		wght = (LLVector4a*)ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
  10.106  		if (wght == NULL)
  10.107  		{
  10.108 -			LL_ERRS("LLVOLUME") << "Allocation of weights[" << sizeof(LLVector4a) * num_verts << "] failed" << LL_ENDL;
  10.109 +			ll_aligned_free<64>(pos);
  10.110 +			LL_WARNS("LLVOLUME") << "Allocation of weights[" << sizeof(LLVector4a) * num_verts << "] failed" << LL_ENDL;
  10.111 +			return false;
  10.112  		}
  10.113  	}
  10.114  
  10.115 @@ -5327,13 +5349,28 @@
  10.116  		binorm = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*num_verts);
  10.117  		if (binorm == NULL)
  10.118  		{
  10.119 -			LL_ERRS("LLVOLUME") << "Allocation of binormals[" << sizeof(LLVector4a)*num_verts << "] failed" << LL_ENDL;
  10.120 +			ll_aligned_free<64>(pos);
  10.121 +			ll_aligned_free_16(wght);
  10.122 +			LL_WARNS("LLVOLUME") << "Allocation of binormals[" << sizeof(LLVector4a)*num_verts << "] failed" << LL_ENDL;
  10.123 +			return false;
  10.124  		}
  10.125  	}
  10.126  
  10.127  	//allocate mapping of old indices to new indices
  10.128  	std::vector<S32> new_idx;
  10.129 -	new_idx.resize(mNumVertices, -1);
  10.130 +
  10.131 +	try
  10.132 +	{
  10.133 +		new_idx.resize(mNumVertices, -1);
  10.134 +	}
  10.135 +	catch (std::bad_alloc)
  10.136 +	{
  10.137 +		ll_aligned_free<64>(pos);
  10.138 +		ll_aligned_free_16(wght);
  10.139 +		ll_aligned_free_16(binorm);
  10.140 +		LL_WARNS("LLVOLUME") << "Resize failed: " << mNumVertices << LL_ENDL;
  10.141 +		return false;
  10.142 +	}
  10.143  
  10.144  	S32 cur_idx = 0;
  10.145  	for (U32 i = 0; i < mNumIndices; ++i)
  10.146 @@ -5379,6 +5416,7 @@
  10.147  	//std::string result = llformat("ACMR pre/post: %.3f/%.3f  --  %d triangles %d breaks", pre_acmr, post_acmr, mNumIndices/3, breaks);
  10.148  	//LL_INFOS() << result << LL_ENDL;
  10.149  
  10.150 +	return true;
  10.151  }
  10.152  
  10.153  void LLVolumeFace::createOctree(F32 scaler, const LLVector4a& center, const LLVector4a& size)
    11.1 --- a/indra/llmath/llvolume.h	Thu Mar 01 09:34:25 2018 -0800
    11.2 +++ b/indra/llmath/llvolume.h	Thu Mar 01 14:33:47 2018 -0800
    11.3 @@ -903,7 +903,7 @@
    11.4  	};
    11.5  
    11.6  	void optimize(F32 angle_cutoff = 2.f);
    11.7 -	void cacheOptimize();
    11.8 +	bool cacheOptimize();
    11.9  
   11.10  	void createOctree(F32 scaler = 0.25f, const LLVector4a& center = LLVector4a(0,0,0), const LLVector4a& size = LLVector4a(0.5f,0.5f,0.5f));
   11.11  
   11.12 @@ -1063,7 +1063,7 @@
   11.13  	void copyVolumeFaces(const LLVolume* volume);
   11.14  	void copyFacesTo(std::vector<LLVolumeFace> &faces) const;
   11.15  	void copyFacesFrom(const std::vector<LLVolumeFace> &faces);
   11.16 -	void cacheOptimize();
   11.17 +	bool cacheOptimize();
   11.18  
   11.19  private:
   11.20  	void sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type);
    12.1 --- a/indra/llmessage/llavatarnamecache.cpp	Thu Mar 01 09:34:25 2018 -0800
    12.2 +++ b/indra/llmessage/llavatarnamecache.cpp	Thu Mar 01 14:33:47 2018 -0800
    12.3 @@ -769,7 +769,7 @@
    12.4  
    12.5      // Legacy method
    12.6      LLUUID id;
    12.7 -    if (gCacheName->getUUID(name, id))
    12.8 +    if (gCacheName && gCacheName->getUUID(name, id))
    12.9      {
   12.10          return id;
   12.11      }
    13.1 --- a/indra/llprimitive/llmodel.cpp	Thu Mar 01 09:34:25 2018 -0800
    13.2 +++ b/indra/llprimitive/llmodel.cpp	Thu Mar 01 14:33:47 2018 -0800
    13.3 @@ -1034,8 +1034,11 @@
    13.4  	{  //no exact match found, get closest point
    13.5  		const F32 epsilon = 1e-5f;
    13.6  		weight_map::iterator iter_up = mSkinWeights.lower_bound(pos);
    13.7 -		weight_map::iterator iter_down = ++iter_up;
    13.8 -
    13.9 +		weight_map::iterator iter_down = iter_up;
   13.10 +		if (iter_up != mSkinWeights.end())
   13.11 +		{
   13.12 +			iter_down = ++iter_up;
   13.13 +		}
   13.14  		weight_map::iterator best = iter_up;
   13.15  
   13.16  		F32 min_dist = (iter->first - pos).magVec();
   13.17 @@ -1354,7 +1357,7 @@
   13.18  
   13.19  		LLSD skin_data;
   13.20  
   13.21 -		if (unzip_llsd(skin_data, is, size))
   13.22 +		if (LLUZipHelper::unzip_llsd(skin_data, is, size) == LLUZipHelper::ZR_OK)
   13.23  		{
   13.24  			mSkinInfo.fromLLSD(skin_data);
   13.25  			return true;
   13.26 @@ -1375,7 +1378,7 @@
   13.27  
   13.28  		LLSD data;
   13.29  
   13.30 -		if (unzip_llsd(data, is, size))
   13.31 +		if (LLUZipHelper::unzip_llsd(data, is, size) == LLUZipHelper::ZR_OK)
   13.32  		{
   13.33  			mPhysics.fromLLSD(data);
   13.34  			updateHullCenters();
    14.1 --- a/indra/llrender/llimagegl.cpp	Thu Mar 01 09:34:25 2018 -0800
    14.2 +++ b/indra/llrender/llimagegl.cpp	Thu Mar 01 14:33:47 2018 -0800
    14.3 @@ -622,7 +622,7 @@
    14.4  }
    14.5  
    14.6  static LLTrace::BlockTimerStatHandle FTM_SET_IMAGE("setImage");
    14.7 -void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
    14.8 +BOOL LLImageGL::setImage(const U8* data_in, BOOL data_hasmips)
    14.9  {
   14.10  	LL_RECORD_BLOCK_TIME(FTM_SET_IMAGE);
   14.11  	bool is_compressed = false;
   14.12 @@ -787,19 +787,33 @@
   14.13  						llassert(prev_mip_data);
   14.14  						llassert(cur_mip_size == bytes*4);
   14.15  #endif
   14.16 -						U8* new_data = new U8[bytes];
   14.17 +						U8* new_data = new(std::nothrow) U8[bytes];
   14.18 +						if (!new_data)
   14.19 +						{
   14.20 +							stop_glerror();
   14.21 +
   14.22 +							if (prev_mip_data)
   14.23 +								delete[] prev_mip_data;
   14.24 +							if (cur_mip_data)
   14.25 +								delete[] cur_mip_data;
   14.26 +							
   14.27 +							mGLTextureCreated = false;
   14.28 +							return FALSE;
   14.29 +						}
   14.30 +						else
   14.31 +						{
   14.32  
   14.33  #ifdef SHOW_ASSERT
   14.34 -						llassert(prev_mip_data);
   14.35 -						llassert(cur_mip_size == bytes*4);
   14.36 -						llassert_always(new_data);
   14.37 +							llassert(prev_mip_data);
   14.38 +							llassert(cur_mip_size == bytes * 4);
   14.39  #endif
   14.40  
   14.41 -						LLImageBase::generateMip(prev_mip_data, new_data, w, h, mComponents);
   14.42 -						cur_mip_data = new_data;
   14.43 +							LLImageBase::generateMip(prev_mip_data, new_data, w, h, mComponents);
   14.44 +							cur_mip_data = new_data;
   14.45  #ifdef SHOW_ASSERT
   14.46 -						cur_mip_size = bytes; 
   14.47 +							cur_mip_size = bytes;
   14.48  #endif
   14.49 +						}
   14.50  
   14.51  					}
   14.52  					llassert(w > 0 && h > 0 && cur_mip_data);
   14.53 @@ -886,6 +900,7 @@
   14.54  	}
   14.55  	stop_glerror();
   14.56  	mGLTextureCreated = true;
   14.57 +	return TRUE;
   14.58  }
   14.59  
   14.60  BOOL LLImageGL::preAddToAtlas(S32 discard_level, const LLImageRaw* raw_image)
   14.61 @@ -1355,8 +1370,7 @@
   14.62  	if (mTexName != 0 && discard_level == mCurrentDiscardLevel)
   14.63  	{
   14.64  		// This will only be true if the size has not changed
   14.65 -		setImage(data_in, data_hasmips);
   14.66 -		return TRUE;
   14.67 +		return setImage(data_in, data_hasmips);
   14.68  	}
   14.69  	
   14.70  	U32 old_name = mTexName;
   14.71 @@ -1398,7 +1412,11 @@
   14.72  
   14.73  	mCurrentDiscardLevel = discard_level;	
   14.74  
   14.75 -	setImage(data_in, data_hasmips);
   14.76 +	if (!setImage(data_in, data_hasmips))
   14.77 +	{
   14.78 +		stop_glerror();
   14.79 +		return FALSE;
   14.80 +	}
   14.81  
   14.82  	// Set texture options to our defaults.
   14.83  	gGL.getTexUnit(0)->setHasMipMaps(mHasMipMaps);
    15.1 --- a/indra/llrender/llimagegl.h	Thu Mar 01 09:34:25 2018 -0800
    15.2 +++ b/indra/llrender/llimagegl.h	Thu Mar 01 14:33:47 2018 -0800
    15.3 @@ -105,7 +105,7 @@
    15.4  		S32 category = sMaxCategories-1);
    15.5  	BOOL createGLTexture(S32 discard_level, const U8* data, BOOL data_hasmips = FALSE, S32 usename = 0);
    15.6  	void setImage(const LLImageRaw* imageraw);
    15.7 -	void setImage(const U8* data_in, BOOL data_hasmips = FALSE);
    15.8 +	BOOL setImage(const U8* data_in, BOOL data_hasmips = FALSE);
    15.9  	BOOL setSubImage(const LLImageRaw* imageraw, S32 x_pos, S32 y_pos, S32 width, S32 height, BOOL force_fast_update = FALSE);
   15.10  	BOOL setSubImage(const U8* datap, S32 data_width, S32 data_height, S32 x_pos, S32 y_pos, S32 width, S32 height, BOOL force_fast_update = FALSE);
   15.11  	BOOL setSubImageFromFrameBuffer(S32 fb_x, S32 fb_y, S32 x_pos, S32 y_pos, S32 width, S32 height);
    16.1 --- a/indra/llrender/llvertexbuffer.cpp	Thu Mar 01 09:34:25 2018 -0800
    16.2 +++ b/indra/llrender/llvertexbuffer.cpp	Thu Mar 01 14:33:47 2018 -0800
    16.3 @@ -1057,10 +1057,12 @@
    16.4  
    16.5  	if (mFence)
    16.6  	{
    16.7 +		// Sanity check. We have weird crashes in this destructor (on delete). Yet mFence is disabled.
    16.8 +		// TODO: mFence was added in scope of SH-2038, but was never enabled, consider removing mFence.
    16.9 +		LL_ERRS() << "LLVertexBuffer destruction failed" << LL_ENDL;
   16.10  		delete mFence;
   16.11 +		mFence = NULL;
   16.12  	}
   16.13 -	
   16.14 -	mFence = NULL;
   16.15  
   16.16  	sVertexCount -= mNumVerts;
   16.17  	sIndexCount -= mNumIndices;
   16.18 @@ -1930,7 +1932,21 @@
   16.19  					const MappedRegion& region = mMappedVertexRegions[i];
   16.20  					S32 offset = region.mIndex >= 0 ? mOffsets[region.mType]+sTypeSize[region.mType]*region.mIndex : 0;
   16.21  					S32 length = sTypeSize[region.mType]*region.mCount;
   16.22 -					glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, offset, length, (U8*) mMappedData+offset);
   16.23 +					if (mSize >= length + offset)
   16.24 +					{
   16.25 +						glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, offset, length, (U8*)mMappedData + offset);
   16.26 +					}
   16.27 +					else
   16.28 +					{
   16.29 +						GLint size = 0;
   16.30 +						glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size);
   16.31 +						LL_WARNS() << "Attempted to map regions to a buffer that is too small, " 
   16.32 +							<< "mapped size: " << mSize
   16.33 +							<< ", gl buffer size: " << size
   16.34 +							<< ", length: " << length
   16.35 +							<< ", offset: " << offset
   16.36 +							<< LL_ENDL;
   16.37 +					}
   16.38  					stop_glerror();
   16.39  				}
   16.40  
   16.41 @@ -1998,7 +2014,21 @@
   16.42  					const MappedRegion& region = mMappedIndexRegions[i];
   16.43  					S32 offset = region.mIndex >= 0 ? sizeof(U16)*region.mIndex : 0;
   16.44  					S32 length = sizeof(U16)*region.mCount;
   16.45 -					glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, (U8*) mMappedIndexData+offset);
   16.46 +					if (mIndicesSize >= length + offset)
   16.47 +					{
   16.48 +						glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, (U8*) mMappedIndexData+offset);
   16.49 +					}
   16.50 +					else
   16.51 +					{
   16.52 +						GLint size = 0;
   16.53 +						glGetBufferParameterivARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size);
   16.54 +						LL_WARNS() << "Attempted to map regions to a buffer that is too small, " 
   16.55 +							<< "mapped size: " << mIndicesSize
   16.56 +							<< ", gl buffer size: " << size
   16.57 +							<< ", length: " << length
   16.58 +							<< ", offset: " << offset
   16.59 +							<< LL_ENDL;
   16.60 +					}
   16.61  					stop_glerror();
   16.62  				}
   16.63  
    17.1 --- a/indra/llui/llbadge.cpp	Thu Mar 01 09:34:25 2018 -0800
    17.2 +++ b/indra/llui/llbadge.cpp	Thu Mar 01 14:33:47 2018 -0800
    17.3 @@ -224,7 +224,7 @@
    17.4  	{
    17.5  		LLView* owner_view = mOwner.get();
    17.6  
    17.7 -		if (owner_view)
    17.8 +		if (owner_view && owner_view->isInVisibleChain())
    17.9  		{
   17.10  			//
   17.11  			// Calculate badge size based on label text
    18.1 --- a/indra/llui/llurlentry.cpp	Thu Mar 01 09:34:25 2018 -0800
    18.2 +++ b/indra/llui/llurlentry.cpp	Thu Mar 01 14:33:47 2018 -0800
    18.3 @@ -190,31 +190,32 @@
    18.4  
    18.5  std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) const
    18.6  {
    18.7 -	LLUriParser up(unescapeUrl(url));
    18.8 +	LLUriParser up(escapeUrl(url));
    18.9  	up.normalize();
   18.10  
   18.11  	std::string label;
   18.12  	up.extractParts();
   18.13  	up.glueFirst(label);
   18.14  
   18.15 -	return label;
   18.16 +	return unescapeUrl(label);
   18.17  }
   18.18  
   18.19  std::string LLUrlEntryBase::urlToGreyQuery(const std::string &url) const
   18.20  {
   18.21 -	LLUriParser up(unescapeUrl(url));
   18.22 +	std::string escaped_url = escapeUrl(url);
   18.23 +	LLUriParser up(escaped_url);
   18.24  
   18.25  	std::string label;
   18.26  	up.extractParts();
   18.27  	up.glueFirst(label, false);
   18.28  
   18.29 -	size_t pos = url.find(label);
   18.30 +	size_t pos = escaped_url.find(label);
   18.31  	if (pos == std::string::npos)
   18.32  	{
   18.33  		return "";
   18.34  	}
   18.35  	pos += label.size();
   18.36 -	return url.substr(pos);
   18.37 +	return unescapeUrl(escaped_url.substr(pos));
   18.38  }
   18.39  
   18.40  
    19.1 --- a/indra/llui/llurlregistry.cpp	Thu Mar 01 09:34:25 2018 -0800
    19.2 +++ b/indra/llui/llurlregistry.cpp	Thu Mar 01 14:33:47 2018 -0800
    19.3 @@ -212,7 +212,7 @@
    19.4  			}
    19.5  		}
    19.6  	}
    19.7 -	
    19.8 +
    19.9  	// did we find a match? if so, return its details in the match object
   19.10  	if (match_entry)
   19.11  	{
   19.12 @@ -223,33 +223,6 @@
   19.13  		// fill in the LLUrlMatch object and return it
   19.14  		std::string url = text.substr(match_start, match_end - match_start + 1);
   19.15  
   19.16 -		LLUrlEntryBase *stripped_entry = NULL;
   19.17 -		if((match_entry != mUrlEntryNoLink) && (match_entry != mUrlEntryHTTPLabel) && (match_entry !=mUrlEntrySLLabel)
   19.18 -		        && LLStringUtil::containsNonprintable(url))
   19.19 -		{
   19.20 -			LLStringUtil::stripNonprintable(url);
   19.21 -
   19.22 -			std::vector<LLUrlEntryBase *>::iterator iter;
   19.23 -			for (iter = mUrlEntry.begin(); iter != mUrlEntry.end(); ++iter)
   19.24 -			{
   19.25 -				LLUrlEntryBase *url_entry = *iter;
   19.26 -				U32 start = 0, end = 0;
   19.27 -				if (matchRegex(url.c_str(), url_entry->getPattern(), start, end))
   19.28 -				{
   19.29 -					if (mLLUrlEntryInvalidSLURL == *iter)
   19.30 -					{
   19.31 -						if(url_entry && url_entry->isSLURLvalid(url))
   19.32 -						{
   19.33 -							continue;
   19.34 -						}
   19.35 -					}
   19.36 -					stripped_entry = url_entry;
   19.37 -					break;
   19.38 -				}
   19.39 -			}
   19.40 -		}
   19.41 -
   19.42 -
   19.43  		if (match_entry == mUrlEntryTrusted)
   19.44  		{
   19.45  			LLUriParser up(url);
   19.46 @@ -257,12 +230,10 @@
   19.47  			url = up.normalizedUri();
   19.48  		}
   19.49  
   19.50 -		std::string url_label = stripped_entry? stripped_entry->getLabel(url, cb) : match_entry->getLabel(url, cb);
   19.51 -		std::string url_query = stripped_entry? stripped_entry->getQuery(url) : match_entry->getQuery(url);
   19.52  		match.setValues(match_start, match_end,
   19.53  						match_entry->getUrl(url),
   19.54 -						url_label,
   19.55 -						url_query,
   19.56 +						match_entry->getLabel(url, cb),
   19.57 +						match_entry->getQuery(url),
   19.58  						match_entry->getTooltip(url),
   19.59  						match_entry->getIcon(url),
   19.60  						match_entry->getStyle(),
    20.1 --- a/indra/llwindow/llwindowwin32.cpp	Thu Mar 01 09:34:25 2018 -0800
    20.2 +++ b/indra/llwindow/llwindowwin32.cpp	Thu Mar 01 14:33:47 2018 -0800
    20.3 @@ -421,6 +421,11 @@
    20.4  	mKeyVirtualKey = 0;
    20.5  	mhDC = NULL;
    20.6  	mhRC = NULL;
    20.7 +	
    20.8 +	if (!SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &mMouseVanish, 0))
    20.9 +	{
   20.10 +		mMouseVanish = TRUE;
   20.11 +	}
   20.12  
   20.13  	// Initialize the keyboard
   20.14  	gKeyboard = new LLKeyboardWin32();
   20.15 @@ -1096,7 +1101,14 @@
   20.16  		mhInstance,
   20.17  		NULL);
   20.18  
   20.19 -	LL_INFOS("Window") << "window is created." << LL_ENDL ;
   20.20 +	if (mWindowHandle)
   20.21 +	{
   20.22 +		LL_INFOS("Window") << "window is created." << LL_ENDL ;
   20.23 +	}
   20.24 +	else
   20.25 +	{
   20.26 +		LL_WARNS("Window") << "Window creation failed, code: " << GetLastError() << LL_ENDL;
   20.27 +	}
   20.28  
   20.29  	//-----------------------------------------------------------------------
   20.30  	// Create GL drawing context
   20.31 @@ -1411,7 +1423,16 @@
   20.32  			mhInstance,
   20.33  			NULL);
   20.34  
   20.35 -		LL_INFOS("Window") << "recreate window done." << LL_ENDL ;
   20.36 +
   20.37 +		if (mWindowHandle)
   20.38 +		{
   20.39 +			LL_INFOS("Window") << "recreate window done." << LL_ENDL ;
   20.40 +		}
   20.41 +		else
   20.42 +		{
   20.43 +			// Note: if value is NULL GetDC retrieves the DC for the entire screen.
   20.44 +			LL_WARNS("Window") << "Window recreation failed, code: " << GetLastError() << LL_ENDL;
   20.45 +		}
   20.46  
   20.47  		if (!(mhDC = GetDC(mWindowHandle)))
   20.48  		{
   20.49 @@ -1680,7 +1701,7 @@
   20.50  
   20.51  void LLWindowWin32::hideCursorUntilMouseMove()
   20.52  {
   20.53 -	if (!mHideCursorPermanent)
   20.54 +	if (!mHideCursorPermanent && mMouseVanish)
   20.55  	{
   20.56  		hideCursor();
   20.57  		mHideCursorPermanent = FALSE;
   20.58 @@ -2641,20 +2662,20 @@
   20.59  			}
   20.60  
   20.61  		case WM_SETFOCUS:
   20.62 -			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_SETFOCUS");
   20.63  			if (gDebugWindowProc)
   20.64  			{
   20.65  				LL_INFOS("Window") << "WINDOWPROC SetFocus" << LL_ENDL;
   20.66  			}
   20.67 +			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_SETFOCUS");
   20.68  			window_imp->mCallbacks->handleFocus(window_imp);
   20.69  			return 0;
   20.70  
   20.71  		case WM_KILLFOCUS:
   20.72 -			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KILLFOCUS");
   20.73  			if (gDebugWindowProc)
   20.74  			{
   20.75  				LL_INFOS("Window") << "WINDOWPROC KillFocus" << LL_ENDL;
   20.76  			}
   20.77 +			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KILLFOCUS");
   20.78  			window_imp->mCallbacks->handleFocusLost(window_imp);
   20.79  			return 0;
   20.80  
   20.81 @@ -2668,6 +2689,18 @@
   20.82  			return 0;			
   20.83  
   20.84  			break;
   20.85 +
   20.86 +		case WM_SETTINGCHANGE:
   20.87 +			{
   20.88 +				if (w_param == SPI_SETMOUSEVANISH)
   20.89 +				{
   20.90 +					if (!SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &window_imp->mMouseVanish, 0))
   20.91 +					{
   20.92 +						window_imp->mMouseVanish = TRUE;
   20.93 +					}
   20.94 +				}
   20.95 +			}
   20.96 +			break;
   20.97  		}
   20.98  
   20.99  	window_imp->mCallbacks->handlePauseWatchdog(window_imp);	
    21.1 --- a/indra/llwindow/llwindowwin32.h	Thu Mar 01 09:34:25 2018 -0800
    21.2 +++ b/indra/llwindow/llwindowwin32.h	Thu Mar 01 14:33:47 2018 -0800
    21.3 @@ -214,6 +214,8 @@
    21.4  	U32				mRawWParam;
    21.5  	U32				mRawLParam;
    21.6  
    21.7 +	BOOL			mMouseVanish;
    21.8 +
    21.9  	friend class LLWindowManager;
   21.10  };
   21.11  
    22.1 --- a/indra/newview/VIEWER_VERSION.txt	Thu Mar 01 09:34:25 2018 -0800
    22.2 +++ b/indra/newview/VIEWER_VERSION.txt	Thu Mar 01 14:33:47 2018 -0800
    22.3 @@ -1,1 +1,1 @@
    22.4 -5.1.2
    22.5 +5.1.3
    23.1 --- a/indra/newview/character/avatar_lad.xml	Thu Mar 01 09:34:25 2018 -0800
    23.2 +++ b/indra/newview/character/avatar_lad.xml	Thu Mar 01 14:33:47 2018 -0800
    23.3 @@ -530,7 +530,7 @@
    23.4       location="ATTACH_FACE_JAW"
    23.5       position="0.000 0.000 0.000"
    23.6       rotation="0 0 0"
    23.7 -     visible_in_first_person="true"/>
    23.8 +     visible_in_first_person="false"/>
    23.9  
   23.10      <attachment_point
   23.11       id="48"
   23.12 @@ -541,7 +541,7 @@
   23.13       location="ATTACH_FACE_LEAR"
   23.14       position="0.000 0.000 0.000"
   23.15       rotation="0 0 0"
   23.16 -     visible_in_first_person="true"/>
   23.17 +     visible_in_first_person="false"/>
   23.18  
   23.19      <attachment_point
   23.20       id="49"
   23.21 @@ -552,7 +552,7 @@
   23.22       location="ATTACH_FACE_REAR"
   23.23       position="0.000 0.000 0.000"
   23.24       rotation="0 0 0"
   23.25 -     visible_in_first_person="true"/>
   23.26 +     visible_in_first_person="false"/>
   23.27  
   23.28      <attachment_point
   23.29       id="50"
   23.30 @@ -563,7 +563,7 @@
   23.31       location="ATTACH_FACE_LEYE"
   23.32       position="0.000 0.000 0.000"
   23.33       rotation="0 0 0"
   23.34 -     visible_in_first_person="true"/>
   23.35 +     visible_in_first_person="false"/>
   23.36  
   23.37      <attachment_point
   23.38       id="51"
   23.39 @@ -574,7 +574,7 @@
   23.40       location="ATTACH_FACE_REYE"
   23.41       position="0.000 0.000 0.000"
   23.42       rotation="0 0 0"
   23.43 -     visible_in_first_person="true"/>
   23.44 +     visible_in_first_person="false"/>
   23.45  
   23.46      <attachment_point
   23.47       id="52"
   23.48 @@ -585,7 +585,7 @@
   23.49       location="ATTACH_FACE_TONGUE"
   23.50       position="0.000 0.000 0.000"
   23.51       rotation="0 0 0"
   23.52 -     visible_in_first_person="true"/>
   23.53 +     visible_in_first_person="false"/>
   23.54  
   23.55      <attachment_point
   23.56       id="53"
    24.1 --- a/indra/newview/llavataractions.cpp	Thu Mar 01 09:34:25 2018 -0800
    24.2 +++ b/indra/newview/llavataractions.cpp	Thu Mar 01 14:33:47 2018 -0800
    24.3 @@ -1011,7 +1011,7 @@
    24.4  	LLAvatarNameCache::get(id, &av_name);
    24.5  
    24.6  	LLMuteList* mute_list = LLMuteList::getInstance();
    24.7 -	bool is_muted = mute_list->isMuted(id, LLMute::flagVoiceChat);
    24.8 +	bool is_muted = mute_list->isMuted(id, flags);
    24.9  
   24.10  	LLMute mute(id, av_name.getUserName(), LLMute::AGENT);
   24.11  	if (!is_muted)
    25.1 --- a/indra/newview/llchatitemscontainerctrl.cpp	Thu Mar 01 09:34:25 2018 -0800
    25.2 +++ b/indra/newview/llchatitemscontainerctrl.cpp	Thu Mar 01 14:33:47 2018 -0800
    25.3 @@ -242,27 +242,28 @@
    25.4  
    25.5  	S32 chars_in_line = mMsgText->getRect().getWidth() / messageFont->getWidth("c");
    25.6  	S32 max_lines = notification["available_height"].asInteger() / (mMsgText->getTextPixelHeight() + 4);
    25.7 -	S32 new_line_chars = std::count(messageText.begin(), messageText.end(), '\n');
    25.8 -	S32 lines_count = (messageText.size() - new_line_chars) / chars_in_line + new_line_chars + 1;
    25.9 +	int lines = 0;
   25.10 +	int chars = 0;
   25.11  
   25.12 -	//Remove excessive chars if message is not fit in available height. MAINT-6891
   25.13 -	if(lines_count > max_lines)
   25.14 +	//Remove excessive chars if message does not fit in available height. MAINT-6891
   25.15 +	std::string::iterator it;
   25.16 +	for (it = messageText.begin(); it < messageText.end() && lines < max_lines; it++)
   25.17  	{
   25.18 -		while(lines_count > max_lines)
   25.19 +		if (*it == '\n')
   25.20 +			++lines;
   25.21 +		else
   25.22 +			++chars;
   25.23 +
   25.24 +		if (chars >= chars_in_line)
   25.25  		{
   25.26 -			std::size_t nl_pos = messageText.rfind('\n');
   25.27 -			if (nl_pos != std::string::npos)
   25.28 -			{
   25.29 -				nl_pos = nl_pos > messageText.length() - chars_in_line? nl_pos : messageText.length() - chars_in_line;
   25.30 -				messageText.erase(messageText.begin() + nl_pos, messageText.end());
   25.31 -			}
   25.32 -			else
   25.33 -			{
   25.34 -				messageText.erase(messageText.end() - chars_in_line, messageText.end());
   25.35 -			}
   25.36 -			new_line_chars = std::count(messageText.begin(), messageText.end(), '\n');
   25.37 -			lines_count = (messageText.size() - new_line_chars) / chars_in_line + new_line_chars;
   25.38 +			chars = 0;
   25.39 +			++lines;
   25.40  		}
   25.41 +	}
   25.42 +
   25.43 +	if (it < messageText.end())
   25.44 +	{
   25.45 +		messageText.erase(it, messageText.end());
   25.46  		messageText += " ...";
   25.47  	}
   25.48  
    26.1 --- a/indra/newview/llfavoritesbar.cpp	Thu Mar 01 09:34:25 2018 -0800
    26.2 +++ b/indra/newview/llfavoritesbar.cpp	Thu Mar 01 14:33:47 2018 -0800
    26.3 @@ -750,7 +750,7 @@
    26.4  		return;
    26.5  	}
    26.6  
    26.7 -	if(mGetPrevItems)
    26.8 +	if(mGetPrevItems && gInventory.isCategoryComplete(mFavoriteFolderId))
    26.9  	{
   26.10  	    for (LLInventoryModel::item_array_t::iterator it = mItems.begin(); it != mItems.end(); it++)
   26.11  	    {
    27.1 --- a/indra/newview/llfilepicker.cpp	Thu Mar 01 09:34:25 2018 -0800
    27.2 +++ b/indra/newview/llfilepicker.cpp	Thu Mar 01 14:33:47 2018 -0800
    27.3 @@ -341,7 +341,7 @@
    27.4  					dirname = filename + "\\";
    27.5  				else
    27.6  					mFiles.push_back(dirname + filename);
    27.7 -				tptrw += filename.size();
    27.8 +				tptrw += wcslen(tptrw);
    27.9  			}
   27.10  		}
   27.11  	}
    28.1 --- a/indra/newview/llfloateravatarrendersettings.cpp	Thu Mar 01 09:34:25 2018 -0800
    28.2 +++ b/indra/newview/llfloateravatarrendersettings.cpp	Thu Mar 01 14:33:47 2018 -0800
    28.3 @@ -89,20 +89,11 @@
    28.4      LLFloater::postBuild();
    28.5      mAvatarSettingsList = getChild<LLNameListCtrl>("render_settings_list");
    28.6      mAvatarSettingsList->setRightMouseDownCallback(boost::bind(&LLFloaterAvatarRenderSettings::onAvatarListRightClick, this, _1, _2, _3));
    28.7 -    this->setVisibleCallback(boost::bind(&LLFloaterAvatarRenderSettings::removePicker, this));
    28.8      getChild<LLFilterEditor>("people_filter_input")->setCommitCallback(boost::bind(&LLFloaterAvatarRenderSettings::onFilterEdit, this, _2));
    28.9  
   28.10  	return TRUE;
   28.11  }
   28.12  
   28.13 -void LLFloaterAvatarRenderSettings::removePicker()
   28.14 -{
   28.15 -    if(mPicker.get())
   28.16 -    {
   28.17 -        mPicker.get()->closeFloater();
   28.18 -    }
   28.19 -}
   28.20 -
   28.21  void LLFloaterAvatarRenderSettings::draw()
   28.22  {
   28.23      if(mNeedsUpdate)
   28.24 @@ -263,8 +254,6 @@
   28.25      {
   28.26          root_floater->addDependentFloater(picker);
   28.27      }
   28.28 -
   28.29 -    mPicker = picker->getHandle();
   28.30  }
   28.31  
   28.32  void LLFloaterAvatarRenderSettings::callbackAvatarPicked(const uuid_vec_t& ids, S32 visual_setting)
    29.1 --- a/indra/newview/llfloateravatarrendersettings.h	Thu Mar 01 09:34:25 2018 -0800
    29.2 +++ b/indra/newview/llfloateravatarrendersettings.h	Thu Mar 01 14:33:47 2018 -0800
    29.3 @@ -66,7 +66,6 @@
    29.4      bool mNeedsUpdate;
    29.5      LLListContextMenu* mContextMenu;
    29.6      LLNameListCtrl* mAvatarSettingsList;
    29.7 -    LLHandle<LLFloater> mPicker;
    29.8  
    29.9      std::string mNameFilter;
   29.10  };
    30.1 --- a/indra/newview/llfloatermediasettings.cpp	Thu Mar 01 09:34:25 2018 -0800
    30.2 +++ b/indra/newview/llfloatermediasettings.cpp	Thu Mar 01 14:33:47 2018 -0800
    30.3 @@ -171,8 +171,12 @@
    30.4  void LLFloaterMediaSettings::initValues( const LLSD& media_settings, bool editable )
    30.5  {
    30.6  	if (sInstance->hasFocus()) return;
    30.7 -	
    30.8 -	sInstance->clearValues(editable);
    30.9 +
   30.10 +	// Clear values
   30.11 +	sInstance->mPanelMediaSettingsGeneral->clearValues(sInstance->mPanelMediaSettingsGeneral, editable, false /*don't update preview*/);
   30.12 +	sInstance->mPanelMediaSettingsSecurity->clearValues(sInstance->mPanelMediaSettingsSecurity,	editable);
   30.13 +	sInstance->mPanelMediaSettingsPermissions->clearValues(sInstance->mPanelMediaSettingsPermissions,  editable);
   30.14 +
   30.15  	// update all panels with values from simulator
   30.16  	sInstance->mPanelMediaSettingsGeneral->
   30.17  		initValues( sInstance->mPanelMediaSettingsGeneral, media_settings, editable );
    31.1 --- a/indra/newview/llfloaterpreference.cpp	Thu Mar 01 09:34:25 2018 -0800
    31.2 +++ b/indra/newview/llfloaterpreference.cpp	Thu Mar 01 14:33:47 2018 -0800
    31.3 @@ -1304,7 +1304,6 @@
    31.4  	BOOL shaders = ctrl_shader_enable->get();
    31.5  	if (shaders)
    31.6  	{
    31.7 -		terrain_detail->setValue(1);
    31.8  		terrain_detail->setEnabled(FALSE);
    31.9  		terrain_text->setEnabled(FALSE);
   31.10  	}
    32.1 --- a/indra/newview/llfloatersearch.cpp	Thu Mar 01 09:34:25 2018 -0800
    32.2 +++ b/indra/newview/llfloatersearch.cpp	Thu Mar 01 14:33:47 2018 -0800
    32.3 @@ -100,6 +100,7 @@
    32.4  	mCategoryPaths["events"]       = "search/events";
    32.5  	mCategoryPaths["groups"]       = "search/groups";
    32.6  	mCategoryPaths["wiki"]         = "search/wiki";
    32.7 +	mCategoryPaths["land"]         = "land";
    32.8  	mCategoryPaths["destinations"] = "destinations";
    32.9  	mCategoryPaths["classifieds"]  = "classifieds";
   32.10  }
    33.1 --- a/indra/newview/llfloatertools.cpp	Thu Mar 01 09:34:25 2018 -0800
    33.2 +++ b/indra/newview/llfloatertools.cpp	Thu Mar 01 14:33:47 2018 -0800
    33.3 @@ -1317,7 +1317,6 @@
    33.4  	
    33.5  	std::string multi_media_info_str = LLTrans::getString("Multiple Media");
    33.6  	std::string media_title = "";
    33.7 -	mNeedMediaTitle = false;
    33.8  	// update UI depending on whether "object" (prim or face) has media
    33.9  	// and whether or not you are allowed to edit it.
   33.10  	
   33.11 @@ -1335,17 +1334,12 @@
   33.12  			{
   33.13  				// initial media title is the media URL (until we get the name)
   33.14  				media_title = media_data_get.getHomeURL();
   33.15 -
   33.16 -				// kick off a navigate and flag that we need to update the title
   33.17 -				navigateToTitleMedia( media_data_get.getHomeURL() );
   33.18 -				mNeedMediaTitle = true;
   33.19  			}
   33.20  			// else all faces might be empty. 
   33.21  		}
   33.22  		else // there' re Different Medias' been set on on the faces.
   33.23  		{
   33.24  			media_title = multi_media_info_str;
   33.25 -			mNeedMediaTitle = false;
   33.26  		}
   33.27  		
   33.28  		getChildView("media_tex")->setEnabled(bool_has_media && editable);
   33.29 @@ -1362,7 +1356,6 @@
   33.30  		if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia)
   33.31  		{
   33.32  			media_title = multi_media_info_str;
   33.33 -			mNeedMediaTitle = false;
   33.34  		}
   33.35  		else
   33.36  		{
   33.37 @@ -1371,10 +1364,6 @@
   33.38  			{
   33.39  				// initial media title is the media URL (until we get the name)
   33.40  				media_title = media_data_get.getHomeURL();
   33.41 -
   33.42 -				// kick off a navigate and flag that we need to update the title
   33.43 -				navigateToTitleMedia( media_data_get.getHomeURL() );
   33.44 -				mNeedMediaTitle = true;
   33.45  			}
   33.46  		}
   33.47  		
   33.48 @@ -1383,6 +1372,8 @@
   33.49  		getChildView("delete_media")->setEnabled(TRUE);
   33.50  		getChildView("add_media")->setEnabled(editable);
   33.51  	}
   33.52 +
   33.53 +	navigateToTitleMedia(media_title);
   33.54  	media_info->setText(media_title);
   33.55  	
   33.56  	// load values for media settings
   33.57 @@ -1472,16 +1463,31 @@
   33.58  //
   33.59  void LLFloaterTools::navigateToTitleMedia( const std::string url )
   33.60  {
   33.61 -	if ( mTitleMedia )
   33.62 +	std::string multi_media_info_str = LLTrans::getString("Multiple Media");
   33.63 +	if (url.empty() || multi_media_info_str == url)
   33.64 +	{
   33.65 +		// nothing to show
   33.66 +		mNeedMediaTitle = false;
   33.67 +	}
   33.68 +	else if (mTitleMedia)
   33.69  	{
   33.70  		LLPluginClassMedia* media_plugin = mTitleMedia->getMediaPlugin();
   33.71 -		if ( media_plugin )
   33.72 +
   33.73 +		if ( media_plugin ) // Shouldn't this be after navigateTo creates plugin?
   33.74  		{
   33.75  			// if it's a movie, we don't want to hear it
   33.76  			media_plugin->setVolume( 0 );
   33.77  		};
   33.78 -		mTitleMedia->navigateTo( url );
   33.79 -	};
   33.80 +
   33.81 +		// check if url changed or if we need a new media source
   33.82 +		if (mTitleMedia->getCurrentNavUrl() != url || media_plugin == NULL)
   33.83 +		{
   33.84 +			mTitleMedia->navigateTo( url );
   33.85 +		}
   33.86 +
   33.87 +		// flag that we need to update the title (even if no request were made)
   33.88 +		mNeedMediaTitle = true;
   33.89 +	}
   33.90  }
   33.91  
   33.92  //////////////////////////////////////////////////////////////////////////////
    34.1 --- a/indra/newview/llfloatertools.h	Thu Mar 01 09:34:25 2018 -0800
    34.2 +++ b/indra/newview/llfloatertools.h	Thu Mar 01 14:33:47 2018 -0800
    34.3 @@ -102,8 +102,6 @@
    34.4  	void onClickBtnAddMedia();
    34.5  	void onClickBtnEditMedia();
    34.6  	void clearMediaSettings();
    34.7 -	void updateMediaTitle();
    34.8 -	void navigateToTitleMedia( const std::string url );
    34.9  	bool selectedMediaEditable();
   34.10  	void updateLandImpacts();
   34.11  
   34.12 @@ -116,6 +114,8 @@
   34.13  	void refreshMedia();
   34.14  	void getMediaState();
   34.15  	void updateMediaSettings();
   34.16 +	void navigateToTitleMedia( const std::string url ); // navigate if changed
   34.17 +	void updateMediaTitle();
   34.18  	static bool deleteMediaConfirm(const LLSD& notification, const LLSD& response);
   34.19  	static bool multipleFacesSelectedConfirm(const LLSD& notification, const LLSD& response);
   34.20  	static void setObjectType( LLPCode pcode );
    35.1 --- a/indra/newview/llfloatertwitter.cpp	Thu Mar 01 09:34:25 2018 -0800
    35.2 +++ b/indra/newview/llfloatertwitter.cpp	Thu Mar 01 14:33:47 2018 -0800
    35.3 @@ -403,13 +403,12 @@
    35.4  void LLTwitterPhotoPanel::updateStatusTextLength(BOOL restore_old_status_text)
    35.5  {
    35.6  	bool add_location = mLocationCheckbox->getValue().asBoolean();
    35.7 -	bool add_photo = mPhotoCheckbox->getValue().asBoolean();
    35.8  
    35.9  	// Restrict the status text length to Twitter's character limit
   35.10  	LLTextEditor* status_text_box = dynamic_cast<LLTextEditor*>(mStatusTextBox);
   35.11  	if (status_text_box)
   35.12  	{
   35.13 -		int max_status_length = 140 - (add_location ? 40 : 0) - (add_photo ? 40 : 0);
   35.14 +		int max_status_length = 280 - (add_location ? 40 : 0);
   35.15  		status_text_box->setMaxTextLength(max_status_length);
   35.16  		if (restore_old_status_text)
   35.17  		{
    36.1 --- a/indra/newview/llinspectgroup.cpp	Thu Mar 01 09:34:25 2018 -0800
    36.2 +++ b/indra/newview/llinspectgroup.cpp	Thu Mar 01 14:33:47 2018 -0800
    36.3 @@ -205,7 +205,7 @@
    36.4  {
    36.5  	if (id == mGroupID)
    36.6  	{
    36.7 -		getChild<LLUICtrl>("group_name")->setValue( LLSD(name) );
    36.8 +		getChild<LLUICtrl>("group_name")->setValue(LLSD("<nolink>" + name + "</nolink>"));
    36.9  	}
   36.10  	
   36.11  	// Otherwise possibly a request for an older inspector, ignore it
    37.1 --- a/indra/newview/llinventorybridge.cpp	Thu Mar 01 09:34:25 2018 -0800
    37.2 +++ b/indra/newview/llinventorybridge.cpp	Thu Mar 01 14:33:47 2018 -0800
    37.3 @@ -43,6 +43,7 @@
    37.4  #include "llfloatermarketplacelistings.h"
    37.5  #include "llfloateroutfitphotopreview.h"
    37.6  #include "llfloatersidepanelcontainer.h"
    37.7 +#include "llsidepanelinventory.h"
    37.8  #include "llfloaterworldmap.h"
    37.9  #include "llfolderview.h"
   37.10  #include "llfriendcard.h"
   37.11 @@ -1828,11 +1829,24 @@
   37.12  	LLInventoryObject *obj = getInventoryObject();
   37.13  	if (obj && obj->getIsLinkType())
   37.14  	{
   37.15 -		LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel();
   37.16 -		if (active_panel)
   37.17 -		{
   37.18 -			active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
   37.19 -		}
   37.20 +		const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX);
   37.21 +		if (gInventory.isObjectDescendentOf(obj->getLinkedUUID(), inbox_id))
   37.22 +		{
   37.23 +			LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
   37.24 +			if (sidepanel_inventory && sidepanel_inventory->getInboxPanel())
   37.25 +			{
   37.26 +				sidepanel_inventory->getInboxPanel()->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
   37.27 +			}
   37.28 +		}
   37.29 +		else
   37.30 +		{
   37.31 +			LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel();
   37.32 +			if (active_panel)
   37.33 +			{
   37.34 +				active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
   37.35 +			}
   37.36 +		}
   37.37 +
   37.38  	}
   37.39  }
   37.40  
   37.41 @@ -2199,8 +2213,24 @@
   37.42      {
   37.43          return llformat(" ( %s ) ", LLTrans::getString("LoadingData").c_str());
   37.44      }
   37.45 -    
   37.46 -    return LLInvFVBridge::getLabelSuffix();
   37.47 +    std::string suffix = "";
   37.48 +    if(mShowDescendantsCount)
   37.49 +    {
   37.50 +        LLInventoryModel::cat_array_t cat_array;
   37.51 +        LLInventoryModel::item_array_t item_array;
   37.52 +        gInventory.collectDescendents(getUUID(), cat_array, item_array, TRUE);
   37.53 +        S32 count = item_array.size();
   37.54 +        if(count > 0)
   37.55 +        {
   37.56 +            std::ostringstream oss;
   37.57 +            oss << count;
   37.58 +            LLStringUtil::format_map_t args;
   37.59 +            args["[ITEMS_COUNT]"] = oss.str();
   37.60 +            suffix = " " + LLTrans::getString("InventoryItemsCount", args);
   37.61 +        }
   37.62 +    }
   37.63 +
   37.64 +    return LLInvFVBridge::getLabelSuffix() + suffix;
   37.65  }
   37.66  
   37.67  LLFontGL::StyleFlags LLFolderBridge::getLabelStyle() const
    38.1 --- a/indra/newview/llinventorybridge.h	Thu Mar 01 09:34:25 2018 -0800
    38.2 +++ b/indra/newview/llinventorybridge.h	Thu Mar 01 14:33:47 2018 -0800
    38.3 @@ -268,7 +268,8 @@
    38.4  	:	LLInvFVBridge(inventory, root, uuid),
    38.5  		mCallingCards(FALSE),
    38.6  		mWearables(FALSE),
    38.7 -		mIsLoading(false)
    38.8 +		mIsLoading(false),
    38.9 +		mShowDescendantsCount(false)
   38.10  	{}
   38.11  		
   38.12  	BOOL dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop, std::string& tooltip_msg, BOOL user_confirm = TRUE);
   38.13 @@ -293,6 +294,8 @@
   38.14  	virtual std::string getLabelSuffix() const;
   38.15  	virtual LLFontGL::StyleFlags getLabelStyle() const;
   38.16  
   38.17 +	void setShowDescendantsCount(bool show_count) {mShowDescendantsCount = show_count;}
   38.18 +
   38.19  	virtual BOOL renameItem(const std::string& new_name);
   38.20  
   38.21  	virtual BOOL removeItem();
   38.22 @@ -373,6 +376,7 @@
   38.23  	bool							mCallingCards;
   38.24  	bool							mWearables;
   38.25  	bool							mIsLoading;
   38.26 +	bool							mShowDescendantsCount;
   38.27  	LLTimer							mTimeSinceRequestStart;
   38.28      std::string                     mMessage;
   38.29  	LLRootHandle<LLFolderBridge> mHandle;
    39.1 --- a/indra/newview/llinventoryfunctions.cpp	Thu Mar 01 09:34:25 2018 -0800
    39.2 +++ b/indra/newview/llinventoryfunctions.cpp	Thu Mar 01 14:33:47 2018 -0800
    39.3 @@ -1178,7 +1178,7 @@
    39.4      int incoming_folder_depth = get_folder_levels(inv_cat);
    39.5      // Compute the nested folders level we're inserting ourselves in
    39.6      // Note: add 1 when inserting under a listing folder as we need to take the root listing folder in the count
    39.7 -    int insertion_point_folder_depth = (root_folder ? get_folder_path_length(root_folder->getUUID(), dest_folder->getUUID()) + 1 : 0);
    39.8 +    int insertion_point_folder_depth = (root_folder ? get_folder_path_length(root_folder->getUUID(), dest_folder->getUUID()) + 1 : 1);
    39.9  
   39.10      // Get the version folder: that's where the folders and items counts start from
   39.11      const LLViewerInventoryCategory * version_folder = (insertion_point_folder_depth >= 2 ? gInventory.getFirstDescendantOf(root_folder->getUUID(), dest_folder->getUUID()) : NULL);
    40.1 --- a/indra/newview/llinventorymodel.cpp	Thu Mar 01 09:34:25 2018 -0800
    40.2 +++ b/indra/newview/llinventorymodel.cpp	Thu Mar 01 14:33:47 2018 -0800
    40.3 @@ -617,6 +617,11 @@
    40.4  		return LLUUID::null;
    40.5  	}
    40.6  
    40.7 +	if (!gMessageSystem)
    40.8 +	{
    40.9 +		return LLUUID::null;
   40.10 +	}
   40.11 +
   40.12  	// Add the category to the internal representation
   40.13  	LLPointer<LLViewerInventoryCategory> cat =
   40.14  		new LLViewerInventoryCategory(id, parent_id, preferred_type, name, gAgent.getID());
    41.1 --- a/indra/newview/llinventorypanel.cpp	Thu Mar 01 09:34:25 2018 -0800
    41.2 +++ b/indra/newview/llinventorypanel.cpp	Thu Mar 01 14:33:47 2018 -0800
    41.3 @@ -563,6 +563,7 @@
    41.4  				{
    41.5  					setSelection(item_id, FALSE);
    41.6  				}
    41.7 +				updateFolderLabel(model_item->getParentUUID());
    41.8  			}
    41.9  
   41.10  			//////////////////////////////
   41.11 @@ -574,6 +575,7 @@
   41.12  				// Don't process the item if it is the root
   41.13  				if (old_parent)
   41.14  				{
   41.15 +					LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(old_parent->getViewModelItem());
   41.16  					LLFolderViewFolder* new_parent =   (LLFolderViewFolder*)getItemByID(model_item->getParentUUID());
   41.17  					// Item has been moved.
   41.18  					if (old_parent != new_parent)
   41.19 @@ -591,6 +593,7 @@
   41.20  									setSelection(item_id, FALSE);
   41.21  								}
   41.22  							}
   41.23 +							updateFolderLabel(model_item->getParentUUID());
   41.24  						}
   41.25  						else 
   41.26  						{
   41.27 @@ -602,6 +605,10 @@
   41.28  							// doesn't include trash).  Just remove the item's UI.
   41.29  							view_item->destroyView();
   41.30  						}
   41.31 +						if(viewmodel_folder)
   41.32 +						{
   41.33 +							updateFolderLabel(viewmodel_folder->getUUID());
   41.34 +						}
   41.35  						old_parent->getViewModelItem()->dirtyDescendantsFilter();
   41.36  					}
   41.37  				}
   41.38 @@ -619,6 +626,11 @@
   41.39  				if(parent)
   41.40  				{
   41.41  					parent->getViewModelItem()->dirtyDescendantsFilter();
   41.42 +					LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(parent->getViewModelItem());
   41.43 +					if(viewmodel_folder)
   41.44 +					{
   41.45 +						updateFolderLabel(viewmodel_folder->getUUID());
   41.46 +					}
   41.47  				}
   41.48  			}
   41.49  		}
   41.50 @@ -1110,6 +1122,73 @@
   41.51  			fv->startRenamingSelectedItem();
   41.52  		}
   41.53  	}
   41.54 +
   41.55 +	std::set<LLFolderViewItem*> selected_items = mFolderRoot.get()->getSelectionList();
   41.56 +	LLFolderViewItem* prev_folder_item = getItemByID(mPreviousSelectedFolder);
   41.57 +
   41.58 +	if (selected_items.size() == 1)
   41.59 +	{
   41.60 +		std::set<LLFolderViewItem*>::const_iterator iter = selected_items.begin();
   41.61 +		LLFolderViewItem* folder_item = (*iter);
   41.62 +		if(folder_item && (folder_item != prev_folder_item))
   41.63 +		{
   41.64 +			LLFolderViewModelItemInventory* fve_listener = static_cast<LLFolderViewModelItemInventory*>(folder_item->getViewModelItem());
   41.65 +			if (fve_listener && (fve_listener->getInventoryType() == LLInventoryType::IT_CATEGORY))
   41.66 +			{
   41.67 +				if(prev_folder_item)
   41.68 +				{
   41.69 +					LLFolderBridge* prev_bridge = (LLFolderBridge*)prev_folder_item->getViewModelItem();
   41.70 +					if(prev_bridge)
   41.71 +					{
   41.72 +						prev_bridge->clearDisplayName();
   41.73 +						prev_bridge->setShowDescendantsCount(false);
   41.74 +						prev_folder_item->refresh();
   41.75 +					}
   41.76 +				}
   41.77 +
   41.78 +				LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getViewModelItem();
   41.79 +				if(bridge)
   41.80 +				{
   41.81 +					bridge->clearDisplayName();
   41.82 +					bridge->setShowDescendantsCount(true);
   41.83 +					folder_item->refresh();
   41.84 +					mPreviousSelectedFolder = bridge->getUUID();
   41.85 +				}
   41.86 +			}
   41.87 +		}
   41.88 +	}
   41.89 +	else
   41.90 +	{
   41.91 +		if(prev_folder_item)
   41.92 +		{
   41.93 +			LLFolderBridge* prev_bridge = (LLFolderBridge*)prev_folder_item->getViewModelItem();
   41.94 +			if(prev_bridge)
   41.95 +			{
   41.96 +				prev_bridge->clearDisplayName();
   41.97 +				prev_bridge->setShowDescendantsCount(false);
   41.98 +				prev_folder_item->refresh();
   41.99 +			}
  41.100 +		}
  41.101 +		mPreviousSelectedFolder = LLUUID();
  41.102 +	}
  41.103 +
  41.104 +}
  41.105 +
  41.106 +void LLInventoryPanel::updateFolderLabel(const LLUUID& folder_id)
  41.107 +{
  41.108 +	if(folder_id != mPreviousSelectedFolder) return;
  41.109 +
  41.110 +	LLFolderViewItem* folder_item = getItemByID(mPreviousSelectedFolder);
  41.111 +	if(folder_item)
  41.112 +	{
  41.113 +		LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getViewModelItem();
  41.114 +		if(bridge)
  41.115 +		{
  41.116 +			bridge->clearDisplayName();
  41.117 +			bridge->setShowDescendantsCount(true);
  41.118 +			folder_item->refresh();
  41.119 +		}
  41.120 +	}
  41.121  }
  41.122  
  41.123  void LLInventoryPanel::doCreate(const LLSD& userdata)
  41.124 @@ -1364,10 +1443,12 @@
  41.125  }
  41.126  
  41.127  //static
  41.128 -void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel)
  41.129 +void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel, BOOL take_keyboard_focus, BOOL reset_filter)
  41.130  {
  41.131  	LLInventoryPanel *active_panel;
  41.132 -	if (main_panel)
  41.133 +	bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX)));
  41.134 +
  41.135 +	if (main_panel && !in_inbox)
  41.136  	{
  41.137  		LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory")->selectAllItemsPanel();
  41.138  	}
  41.139 @@ -1376,42 +1457,22 @@
  41.140  	if (active_panel)
  41.141  	{
  41.142  		LL_DEBUGS("Messaging") << "Highlighting" << obj_id  << LL_ENDL;
  41.143 -		
  41.144 -		LLViewerInventoryItem * item = gInventory.getItem(obj_id);
  41.145 -		LLViewerInventoryCategory * cat = gInventory.getCategory(obj_id);
  41.146 -		
  41.147 -		bool in_inbox = false;
  41.148 -		
  41.149 -		LLViewerInventoryCategory * parent_cat = NULL;
  41.150 -		
  41.151 -		if (item)
  41.152 +
  41.153 +		if (reset_filter)
  41.154  		{
  41.155 -			parent_cat = gInventory.getCategory(item->getParentUUID());
  41.156 +			reset_inventory_filter();
  41.157  		}
  41.158 -		else if (cat)
  41.159 -		{
  41.160 -			parent_cat = gInventory.getCategory(cat->getParentUUID());
  41.161 -		}
  41.162 -		
  41.163 -		if (parent_cat)
  41.164 -		{
  41.165 -			in_inbox = (LLFolderType::FT_INBOX == parent_cat->getPreferredType());
  41.166 -		}
  41.167 -		
  41.168 +
  41.169  		if (in_inbox)
  41.170  		{
  41.171  			LLSidepanelInventory * sidepanel_inventory =	LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
  41.172  			LLInventoryPanel * inventory_panel = NULL;
  41.173 -			
  41.174 -			if (in_inbox)
  41.175 -			{
  41.176 -				sidepanel_inventory->openInbox();
  41.177 -				inventory_panel = sidepanel_inventory->getInboxPanel();
  41.178 -			}
  41.179 +			sidepanel_inventory->openInbox();
  41.180 +			inventory_panel = sidepanel_inventory->getInboxPanel();
  41.181  
  41.182  			if (inventory_panel)
  41.183  			{
  41.184 -				inventory_panel->setSelection(obj_id, TAKE_FOCUS_YES);
  41.185 +				inventory_panel->setSelection(obj_id, take_keyboard_focus);
  41.186  			}
  41.187  		}
  41.188  		else
  41.189 @@ -1421,7 +1482,7 @@
  41.190  			{
  41.191  				floater_inventory->setFocus(TRUE);
  41.192  			}
  41.193 -			active_panel->setSelection(obj_id, TAKE_FOCUS_YES);
  41.194 +			active_panel->setSelection(obj_id, take_keyboard_focus);
  41.195  		}
  41.196  	}
  41.197  }
    42.1 --- a/indra/newview/llinventorypanel.h	Thu Mar 01 09:34:25 2018 -0800
    42.2 +++ b/indra/newview/llinventorypanel.h	Thu Mar 01 14:33:47 2018 -0800
    42.3 @@ -209,6 +209,8 @@
    42.4  	bool attachObject(const LLSD& userdata);
    42.5  	static void idle(void* user_data);
    42.6  
    42.7 +	void updateFolderLabel(const LLUUID& folder_id);
    42.8 +
    42.9  	// DEBUG ONLY:
   42.10  	static void dumpSelectionInformation(void* user_data);
   42.11  
   42.12 @@ -220,8 +222,12 @@
   42.13  	// Find whichever inventory panel is active / on top.
   42.14  	// "Auto_open" determines if we open an inventory panel if none are open.
   42.15  	static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE);
   42.16 -	
   42.17 -	static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel = FALSE);
   42.18 +
   42.19 +	static void openInventoryPanelAndSetSelection(BOOL auto_open,
   42.20 +													const LLUUID& obj_id,
   42.21 +													BOOL main_panel = FALSE,
   42.22 +													BOOL take_keyboard_focus = TAKE_FOCUS_YES,
   42.23 +													BOOL reset_filter = FALSE);
   42.24  
   42.25  	void addItemID(const LLUUID& id, LLFolderViewItem* itemp);
   42.26  	void removeItemID(const LLUUID& id);
   42.27 @@ -254,6 +260,8 @@
   42.28  	LLHandle<LLFolderView>      mFolderRoot;
   42.29  	LLScrollContainer*			mScroller;
   42.30  
   42.31 +	LLUUID						mPreviousSelectedFolder;
   42.32 +
   42.33  	LLFolderViewModelInventory	mInventoryViewModel;
   42.34      LLPointer<LLFolderViewGroupedItemBridge> mGroupedItemBridge;
   42.35  	Params						mParams;	// stored copy of parameter block
    43.1 --- a/indra/newview/llmaterialmgr.cpp	Thu Mar 01 09:34:25 2018 -0800
    43.2 +++ b/indra/newview/llmaterialmgr.cpp	Thu Mar 01 14:33:47 2018 -0800
    43.3 @@ -410,9 +410,10 @@
    43.4  	std::istringstream content_stream(content_string);
    43.5  
    43.6  	LLSD response_data;
    43.7 -	if (!unzip_llsd(response_data, content_stream, content_binary.size()))
    43.8 +	U32 uzip_result = LLUZipHelper::unzip_llsd(response_data, content_stream, content_binary.size());
    43.9 +	if (uzip_result != LLUZipHelper::ZR_OK)
   43.10  	{
   43.11 -		LL_WARNS("Materials") << "Cannot unzip LLSD binary content" << LL_ENDL;
   43.12 +		LL_WARNS("Materials") << "Cannot unzip LLSD binary content: " << uzip_result << LL_ENDL;
   43.13  		return;
   43.14  	}
   43.15  
   43.16 @@ -452,9 +453,10 @@
   43.17  	std::istringstream content_stream(content_string);
   43.18  
   43.19  	LLSD response_data;
   43.20 -	if (!unzip_llsd(response_data, content_stream, content_binary.size()))
   43.21 +	U32 uzip_result = LLUZipHelper::unzip_llsd(response_data, content_stream, content_binary.size());
   43.22 +	if (uzip_result != LLUZipHelper::ZR_OK)
   43.23  	{
   43.24 -		LL_WARNS("Materials") << "Cannot unzip LLSD binary content" << LL_ENDL;
   43.25 +		LL_WARNS("Materials") << "Cannot unzip LLSD binary content: " << uzip_result << LL_ENDL;
   43.26  		return;
   43.27  	}
   43.28  
   43.29 @@ -520,9 +522,10 @@
   43.30  	std::istringstream content_stream(content_string);
   43.31  
   43.32  	LLSD response_data;
   43.33 -	if (!unzip_llsd(response_data, content_stream, content_binary.size()))
   43.34 +	U32 uzip_result = LLUZipHelper::unzip_llsd(response_data, content_stream, content_binary.size());
   43.35 +	if (uzip_result != LLUZipHelper::ZR_OK)
   43.36  	{
   43.37 -		LL_WARNS("Materials") << "Cannot unzip LLSD binary content" << LL_ENDL;
   43.38 +		LL_WARNS("Materials") << "Cannot unzip LLSD binary content: " << uzip_result << LL_ENDL;
   43.39  		return;
   43.40  	}
   43.41  	else
    44.1 --- a/indra/newview/llmeshrepository.cpp	Thu Mar 01 09:34:25 2018 -0800
    44.2 +++ b/indra/newview/llmeshrepository.cpp	Thu Mar 01 14:33:47 2018 -0800
    44.3 @@ -1224,7 +1224,12 @@
    44.4  				LLMeshRepository::sCacheBytesRead += size;
    44.5  				++LLMeshRepository::sCacheReads;
    44.6  				file.seek(offset);
    44.7 -				U8* buffer = new U8[size];
    44.8 +				U8* buffer = new(std::nothrow) U8[size];
    44.9 +				if (!buffer)
   44.10 +				{
   44.11 +					LL_WARNS(LOG_MESH) << "Failed to allocate memory for skin info" << LL_ENDL;
   44.12 +					return false;
   44.13 +				}
   44.14  				file.read(buffer, size);
   44.15  
   44.16  				//make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written)
   44.17 @@ -1316,7 +1321,12 @@
   44.18  				++LLMeshRepository::sCacheReads;
   44.19  
   44.20  				file.seek(offset);
   44.21 -				U8* buffer = new U8[size];
   44.22 +				U8* buffer = new(std::nothrow) U8[size];
   44.23 +				if (!buffer)
   44.24 +				{
   44.25 +					LL_WARNS(LOG_MESH) << "Failed to allocate memory for mesh decomposition" << LL_ENDL;
   44.26 +					return false;
   44.27 +				}
   44.28  				file.read(buffer, size);
   44.29  
   44.30  				//make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written)
   44.31 @@ -1407,7 +1417,12 @@
   44.32  				LLMeshRepository::sCacheBytesRead += size;
   44.33  				++LLMeshRepository::sCacheReads;
   44.34  				file.seek(offset);
   44.35 -				U8* buffer = new U8[size];
   44.36 +				U8* buffer = new(std::nothrow) U8[size];
   44.37 +				if (!buffer)
   44.38 +				{
   44.39 +					LL_WARNS(LOG_MESH) << "Failed to allocate memory for physics shape" << LL_ENDL;
   44.40 +					return false;
   44.41 +				}
   44.42  				file.read(buffer, size);
   44.43  
   44.44  				//make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written)
   44.45 @@ -1727,8 +1742,17 @@
   44.46  	}
   44.47  
   44.48  	LLPointer<LLVolume> volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod));
   44.49 -	std::string mesh_string((char*) data, data_size);
   44.50 -	std::istringstream stream(mesh_string);
   44.51 +	std::istringstream stream;
   44.52 +	try
   44.53 +	{
   44.54 +		std::string mesh_string((char*)data, data_size);
   44.55 +		stream.str(mesh_string);
   44.56 +	}
   44.57 +	catch (std::bad_alloc)
   44.58 +	{
   44.59 +		// out of memory, we won't be able to process this mesh
   44.60 +		return false;
   44.61 +	}
   44.62  
   44.63  	if (volume->unpackVolumeFaces(stream, data_size))
   44.64  	{
   44.65 @@ -1756,9 +1780,11 @@
   44.66  
   44.67  		std::istringstream stream(res_str);
   44.68  
   44.69 -		if (!unzip_llsd(skin, stream, data_size))
   44.70 +		U32 uzip_result = LLUZipHelper::unzip_llsd(skin, stream, data_size);
   44.71 +		if (uzip_result != LLUZipHelper::ZR_OK)
   44.72  		{
   44.73  			LL_WARNS(LOG_MESH) << "Mesh skin info parse error.  Not a valid mesh asset!  ID:  " << mesh_id
   44.74 +							   << " uzip result" << uzip_result
   44.75  							   << LL_ENDL;
   44.76  			return false;
   44.77  		}
   44.78 @@ -1788,9 +1814,11 @@
   44.79  
   44.80  		std::istringstream stream(res_str);
   44.81  
   44.82 -		if (!unzip_llsd(decomp, stream, data_size))
   44.83 +		U32 uzip_result = LLUZipHelper::unzip_llsd(decomp, stream, data_size);
   44.84 +		if (uzip_result != LLUZipHelper::ZR_OK)
   44.85  		{
   44.86  			LL_WARNS(LOG_MESH) << "Mesh decomposition parse error.  Not a valid mesh asset!  ID:  " << mesh_id
   44.87 +							   << " uzip result: " << uzip_result
   44.88  							   << LL_ENDL;
   44.89  			return false;
   44.90  		}
   44.91 @@ -2918,9 +2946,12 @@
   44.92  			// handler, optional first that takes a body, fallback second
   44.93  			// that requires a temporary allocation and data copy.
   44.94  			body_offset = mOffset - offset;
   44.95 -			data = new U8[data_size - body_offset];
   44.96 -			body->read(body_offset, (char *) data, data_size - body_offset);
   44.97 -			LLMeshRepository::sBytesReceived += data_size;
   44.98 +			data = new(std::nothrow) U8[data_size - body_offset];
   44.99 +			if (data)
  44.100 +			{
  44.101 +				body->read(body_offset, (char *) data, data_size - body_offset);
  44.102 +				LLMeshRepository::sBytesReceived += data_size;
  44.103 +			}
  44.104  		}
  44.105  
  44.106  		processData(body, body_offset, data, data_size - body_offset);
  44.107 @@ -2969,7 +3000,9 @@
  44.108  									  U8 * data, S32 data_size)
  44.109  {
  44.110  	LLUUID mesh_id = mMeshParams.getSculptID();
  44.111 -	bool success = (! MESH_HEADER_PROCESS_FAILED) && gMeshRepo.mThread->headerReceived(mMeshParams, data, data_size);
  44.112 +	bool success = (! MESH_HEADER_PROCESS_FAILED)
  44.113 +		&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
  44.114 +		&& gMeshRepo.mThread->headerReceived(mMeshParams, data, data_size);
  44.115  	llassert(success);
  44.116  	if (! success)
  44.117  	{
  44.118 @@ -3093,7 +3126,9 @@
  44.119  void LLMeshLODHandler::processData(LLCore::BufferArray * /* body */, S32 /* body_offset */,
  44.120  								   U8 * data, S32 data_size)
  44.121  {
  44.122 -	if ((! MESH_LOD_PROCESS_FAILED) && gMeshRepo.mThread->lodReceived(mMeshParams, mLOD, data, data_size))
  44.123 +	if ((!MESH_LOD_PROCESS_FAILED)
  44.124 +		&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
  44.125 +		&& gMeshRepo.mThread->lodReceived(mMeshParams, mLOD, data, data_size))
  44.126  	{
  44.127  		// good fetch from sim, write to VFS for caching
  44.128  		LLVFile file(gVFS, mMeshParams.getSculptID(), LLAssetType::AT_MESH, LLVFile::WRITE);
  44.129 @@ -3141,7 +3176,9 @@
  44.130  void LLMeshSkinInfoHandler::processData(LLCore::BufferArray * /* body */, S32 /* body_offset */,
  44.131  										U8 * data, S32 data_size)
  44.132  {
  44.133 -	if ((! MESH_SKIN_INFO_PROCESS_FAILED) && gMeshRepo.mThread->skinInfoReceived(mMeshID, data, data_size))
  44.134 +	if ((!MESH_SKIN_INFO_PROCESS_FAILED)
  44.135 +		&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
  44.136 +		&& gMeshRepo.mThread->skinInfoReceived(mMeshID, data, data_size))
  44.137  	{
  44.138  		// good fetch from sim, write to VFS for caching
  44.139  		LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
  44.140 @@ -3187,7 +3224,9 @@
  44.141  void LLMeshDecompositionHandler::processData(LLCore::BufferArray * /* body */, S32 /* body_offset */,
  44.142  											 U8 * data, S32 data_size)
  44.143  {
  44.144 -	if ((! MESH_DECOMP_PROCESS_FAILED) && gMeshRepo.mThread->decompositionReceived(mMeshID, data, data_size))
  44.145 +	if ((!MESH_DECOMP_PROCESS_FAILED)
  44.146 +		&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
  44.147 +		&& gMeshRepo.mThread->decompositionReceived(mMeshID, data, data_size))
  44.148  	{
  44.149  		// good fetch from sim, write to VFS for caching
  44.150  		LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
  44.151 @@ -3232,7 +3271,9 @@
  44.152  void LLMeshPhysicsShapeHandler::processData(LLCore::BufferArray * /* body */, S32 /* body_offset */,
  44.153  											U8 * data, S32 data_size)
  44.154  {
  44.155 -	if ((! MESH_PHYS_SHAPE_PROCESS_FAILED) && gMeshRepo.mThread->physicsShapeReceived(mMeshID, data, data_size))
  44.156 +	if ((!MESH_PHYS_SHAPE_PROCESS_FAILED)
  44.157 +		&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
  44.158 +		&& gMeshRepo.mThread->physicsShapeReceived(mMeshID, data, data_size))
  44.159  	{
  44.160  		// good fetch from sim, write to VFS for caching
  44.161  		LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
  44.162 @@ -4827,26 +4868,32 @@
  44.163          gInventory.notifyObservers();
  44.164          success = true;
  44.165  
  44.166 +        LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
  44.167 +
  44.168          // Show the preview panel for textures and sounds to let
  44.169          // user know that the image (or snapshot) arrived intact.
  44.170 -        LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel();
  44.171 +        LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
  44.172          if (panel)
  44.173          {
  44.174 -            LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
  44.175  
  44.176              panel->setSelection(
  44.177                  server_response["new_inventory_item"].asUUID(),
  44.178                  TAKE_FOCUS_NO);
  44.179 -
  44.180 -            // restore keyboard focus
  44.181 -            gFocusMgr.setKeyboardFocus(focus);
  44.182          }
  44.183 +        else
  44.184 +        {
  44.185 +            LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, server_response["new_inventory_item"].asUUID(), TRUE, TAKE_FOCUS_NO, TRUE);
  44.186 +        }
  44.187 +
  44.188 +        // restore keyboard focus
  44.189 +        gFocusMgr.setKeyboardFocus(focus);
  44.190      }
  44.191      else
  44.192      {
  44.193          LL_WARNS() << "Can't find a folder to put it in" << LL_ENDL;
  44.194      }
  44.195  
  44.196 +    // Todo: This is mesh repository code, is following code really needed?
  44.197      // remove the "Uploading..." message
  44.198      LLUploadDialog::modalUploadFinished();
  44.199  
    45.1 --- a/indra/newview/llmutelist.cpp	Thu Mar 01 09:34:25 2018 -0800
    45.2 +++ b/indra/newview/llmutelist.cpp	Thu Mar 01 14:33:47 2018 -0800
    45.3 @@ -316,14 +316,7 @@
    45.4  				updateAdd(localmute);
    45.5  				notifyObservers();
    45.6  				notifyObserversDetailed(localmute);
    45.7 -				if(!(localmute.mFlags & LLMute::flagParticles))
    45.8 -				{
    45.9 -					//Kill all particle systems owned by muted task
   45.10 -					if(localmute.mType == LLMute::AGENT || localmute.mType == LLMute::OBJECT)
   45.11 -					{
   45.12 -						LLViewerPartSim::getInstance()->clearParticlesByOwnerID(localmute.mID);
   45.13 -					}
   45.14 -				}
   45.15 +
   45.16  				//mute local lights that are attached to the avatar
   45.17  				LLVOAvatar *avatarp = find_avatar(localmute.mID);
   45.18  				if (avatarp)
    46.1 --- a/indra/newview/lloutfitslist.cpp	Thu Mar 01 09:34:25 2018 -0800
    46.2 +++ b/indra/newview/lloutfitslist.cpp	Thu Mar 01 14:33:47 2018 -0800
    46.3 @@ -995,7 +995,8 @@
    46.4      // Reset selection if the outfit is selected.
    46.5      if (category_id == mSelectedOutfitUUID)
    46.6      {
    46.7 -        signalSelectionOutfitUUID(LLUUID::null);
    46.8 +        mSelectedOutfitUUID = LLUUID::null;
    46.9 +        signalSelectionOutfitUUID(mSelectedOutfitUUID);
   46.10      }
   46.11  }
   46.12  
    47.1 --- a/indra/newview/llpanellogin.cpp	Thu Mar 01 09:34:25 2018 -0800
    47.2 +++ b/indra/newview/llpanellogin.cpp	Thu Mar 01 14:33:47 2018 -0800
    47.3 @@ -299,12 +299,24 @@
    47.4  
    47.5  	// Load favorites into the combo.
    47.6  	std::string user_defined_name = getChild<LLComboBox>("username_combo")->getSimple();
    47.7 +	LLStringUtil::toLower(user_defined_name);
    47.8  	std::replace(user_defined_name.begin(), user_defined_name.end(), '.', ' ');
    47.9  	std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + LLGridManager::getInstance()->getGrid() + ".xml");
   47.10  	std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
   47.11  	mUsernameLength = user_defined_name.length();
   47.12  	updateLoginButtons();
   47.13  
   47.14 +	std::string::size_type index = user_defined_name.find(' ');
   47.15 +	if (index != std::string::npos)
   47.16 +	{
   47.17 +		std::string username = user_defined_name.substr(0, index);
   47.18 +		std::string lastname = user_defined_name.substr(index+1);
   47.19 +		if (lastname == "resident")
   47.20 +		{
   47.21 +			user_defined_name = username;
   47.22 +		}
   47.23 +	}
   47.24 +
   47.25  	LLSD fav_llsd;
   47.26  	llifstream file;
   47.27  	file.open(filename.c_str());
   47.28 @@ -492,7 +504,7 @@
   47.29  	LL_INFOS("Credentials") << "Setting authenticator field " << authenticator["type"].asString() << LL_ENDL;
   47.30  	if(authenticator.isMap() && 
   47.31  	   authenticator.has("secret") && 
   47.32 -	   (authenticator["secret"].asString().size() > 0))
   47.33 +	   (authenticator["secret"].asString().size() > 0) && remember)
   47.34  	{
   47.35  		
   47.36  		// This is a MD5 hex digest of a password.
   47.37 @@ -801,7 +813,8 @@
   47.38  	params["login_content_version"] = gSavedSettings.getString("LoginContentVersion");
   47.39  
   47.40  	// Make an LLURI with this augmented info
   47.41 -	LLURI login_uri(LLURI::buildHTTP(login_page.authority(),
   47.42 +	std::string url = login_page.scheme().empty()? login_page.authority() : login_page.scheme() + "://" + login_page.authority();
   47.43 +	LLURI login_uri(LLURI::buildHTTP(url,
   47.44  									 login_page.path(),
   47.45  									 params));
   47.46  
    48.1 --- a/indra/newview/llpanelmaininventory.cpp	Thu Mar 01 09:34:25 2018 -0800
    48.2 +++ b/indra/newview/llpanelmaininventory.cpp	Thu Mar 01 14:33:47 2018 -0800
    48.3 @@ -44,6 +44,7 @@
    48.4  #include "llfloaterreg.h"
    48.5  #include "llmenubutton.h"
    48.6  #include "lloutfitobserver.h"
    48.7 +#include "llpanelmarketplaceinbox.h"
    48.8  #include "llpreviewtexture.h"
    48.9  #include "llresmgr.h"
   48.10  #include "llscrollcontainer.h"
   48.11 @@ -178,7 +179,9 @@
   48.12  		mWornItemsPanel->setFilterWorn();
   48.13  		mWornItemsPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
   48.14  		mWornItemsPanel->setFilterLinks(LLInventoryFilter::FILTERLINK_EXCLUDE_LINKS);
   48.15 -		mWornItemsPanel->getFilter().markDefault();
   48.16 +		LLInventoryFilter& worn_filter = mWornItemsPanel->getFilter();
   48.17 +		worn_filter.setFilterCategoryTypes(worn_filter.getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX));
   48.18 +		worn_filter.markDefault();
   48.19  		mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2));
   48.20  	}
   48.21  	mSearchTypeCombo  = getChild<LLComboBox>("search_type");
   48.22 @@ -483,7 +486,7 @@
   48.23  	if (mActivePanel && (getActivePanel() != mWornItemsPanel))
   48.24  	{
   48.25  		initially_active = mActivePanel->getFilter().isNotDefault();
   48.26 -		mActivePanel->setFilterSubString(LLStringUtil::null);
   48.27 +		setFilterSubString(LLStringUtil::null);
   48.28  		mActivePanel->setFilterTypes(0xffffffffffffffffULL);
   48.29  		mActivePanel->setFilterLinks(LLInventoryFilter::FILTERLINK_INCLUDE_LINKS);
   48.30  	}
   48.31 @@ -503,6 +506,16 @@
   48.32  		mActivePanel->getRootFolder()->scrollToShowSelection();
   48.33  	}
   48.34  	mFilterSubString = "";
   48.35 +
   48.36 +	LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
   48.37 +	if (sidepanel_inventory)
   48.38 +	{
   48.39 +		LLPanelMarketplaceInbox* inbox_panel = sidepanel_inventory->getChild<LLPanelMarketplaceInbox>("marketplace_inbox");
   48.40 +		if (inbox_panel)
   48.41 +		{
   48.42 +			inbox_panel->onClearSearch();
   48.43 +		}
   48.44 +	}
   48.45  }
   48.46  
   48.47  void LLPanelMainInventory::onFilterEdit(const std::string& search_string )
   48.48 @@ -534,6 +547,16 @@
   48.49  
   48.50  	// set new filter string
   48.51  	setFilterSubString(mFilterSubString);
   48.52 +
   48.53 +	LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
   48.54 +	if (sidepanel_inventory)
   48.55 +	{
   48.56 +		LLPanelMarketplaceInbox* inbox_panel = sidepanel_inventory->getChild<LLPanelMarketplaceInbox>("marketplace_inbox");
   48.57 +		if (inbox_panel)
   48.58 +		{
   48.59 +			inbox_panel->onFilterEdit(search_string);
   48.60 +		}
   48.61 +	}
   48.62  }
   48.63  
   48.64  
   48.65 @@ -685,8 +708,17 @@
   48.66  		LLResMgr::getInstance()->getIntegerString(mItemCountString, mItemCount);
   48.67  	}
   48.68  
   48.69 +	if(mCategoryCount != gInventory.getCategoryCount())
   48.70 +	{
   48.71 +		mCategoryCount = gInventory.getCategoryCount();
   48.72 +		mCategoryCountString = "";
   48.73 +		LLLocale locale(LLLocale::USER_LOCALE);
   48.74 +		LLResMgr::getInstance()->getIntegerString(mCategoryCountString, mCategoryCount);
   48.75 +	}
   48.76 +
   48.77  	LLStringUtil::format_map_t string_args;
   48.78  	string_args["[ITEM_COUNT]"] = mItemCountString;
   48.79 +	string_args["[CATEGORY_COUNT]"] = mCategoryCountString;
   48.80  	string_args["[FILTER]"] = getFilterText();
   48.81  
   48.82  	std::string text = "";
   48.83 @@ -705,6 +737,7 @@
   48.84  	}
   48.85  	
   48.86      mCounterCtrl->setValue(text);
   48.87 +    mCounterCtrl->setToolTip(text);
   48.88  }
   48.89  
   48.90  void LLPanelMainInventory::onFocusReceived()
   48.91 @@ -848,7 +881,6 @@
   48.92  
   48.93  	// Get data needed for filter display
   48.94  	U32 filter_types = mFilter->getFilterObjectTypes();
   48.95 -	std::string filter_string = mFilter->getFilterSubString();
   48.96  	LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState();
   48.97  	U32 hours = mFilter->getHoursAgo();
   48.98  	U32 date_search_direction = mFilter->getDateSearchDirection();
    49.1 --- a/indra/newview/llpanelmaininventory.h	Thu Mar 01 09:34:25 2018 -0800
    49.2 +++ b/indra/newview/llpanelmaininventory.h	Thu Mar 01 14:33:47 2018 -0800
    49.3 @@ -132,7 +132,7 @@
    49.4  
    49.5  	LLFilterEditor*				mFilterEditor;
    49.6  	LLTabContainer*				mFilterTabs;
    49.7 -    LLUICtrl*                   mCounterCtrl;
    49.8 +	LLUICtrl*					mCounterCtrl;
    49.9  	LLHandle<LLFloater>			mFinderHandle;
   49.10  	LLInventoryPanel*			mActivePanel;
   49.11  	LLInventoryPanel*			mWornItemsPanel;
   49.12 @@ -141,7 +141,9 @@
   49.13  	std::string					mFilterText;
   49.14  	std::string					mFilterSubString;
   49.15  	S32							mItemCount;
   49.16 -	std::string 				mItemCountString;
   49.17 +	std::string					mItemCountString;
   49.18 +	S32							mCategoryCount;
   49.19 +	std::string					mCategoryCountString;
   49.20  	LLComboBox*					mSearchTypeCombo;
   49.21  
   49.22  
    50.1 --- a/indra/newview/llpanelmarketplaceinbox.cpp	Thu Mar 01 09:34:25 2018 -0800
    50.2 +++ b/indra/newview/llpanelmarketplaceinbox.cpp	Thu Mar 01 14:33:47 2018 -0800
    50.3 @@ -51,11 +51,15 @@
    50.4  	, mFreshCountCtrl(NULL)
    50.5  	, mInboxButton(NULL)
    50.6  	, mInventoryPanel(NULL)
    50.7 +	, mSavedFolderState(NULL)
    50.8  {
    50.9 +	mSavedFolderState = new LLSaveFolderState();
   50.10 +	mSavedFolderState->setApply(FALSE);
   50.11  }
   50.12  
   50.13  LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox()
   50.14  {
   50.15 +	delete mSavedFolderState;
   50.16  }
   50.17  
   50.18  // virtual
   50.19 @@ -96,6 +100,7 @@
   50.20  	// Set the sort order newest to oldest
   50.21  	mInventoryPanel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_DATE);
   50.22  	mInventoryPanel->getFilter().markDefault();
   50.23 +	mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
   50.24  
   50.25  	// Set selection callback for proper update of inventory status buttons
   50.26  	mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this));
   50.27 @@ -193,6 +198,38 @@
   50.28  	return item_count;
   50.29  }
   50.30  
   50.31 +void LLPanelMarketplaceInbox::onClearSearch()
   50.32 +{
   50.33 +	if (mInventoryPanel)
   50.34 +	{
   50.35 +		mInventoryPanel->setFilterSubString(LLStringUtil::null);
   50.36 +		mSavedFolderState->setApply(TRUE);
   50.37 +		mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
   50.38 +		LLOpenFoldersWithSelection opener;
   50.39 +		mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener);
   50.40 +		mInventoryPanel->getRootFolder()->scrollToShowSelection();
   50.41 +	}
   50.42 +}
   50.43 +
   50.44 +void LLPanelMarketplaceInbox::onFilterEdit(const std::string& search_string)
   50.45 +{
   50.46 +	if (mInventoryPanel)
   50.47 +	{
   50.48 +
   50.49 +		if (search_string == "")
   50.50 +		{
   50.51 +			onClearSearch();
   50.52 +		}
   50.53 +
   50.54 +		if (!mInventoryPanel->getFilter().isNotDefault())
   50.55 +		{
   50.56 +			mSavedFolderState->setApply(FALSE);
   50.57 +			mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
   50.58 +		}
   50.59 +		mInventoryPanel->setFilterSubString(search_string);
   50.60 +	}
   50.61 +}
   50.62 +
   50.63  std::string LLPanelMarketplaceInbox::getBadgeString() const
   50.64  {
   50.65  	std::string item_count_str("");
    51.1 --- a/indra/newview/llpanelmarketplaceinbox.h	Thu Mar 01 09:34:25 2018 -0800
    51.2 +++ b/indra/newview/llpanelmarketplaceinbox.h	Thu Mar 01 14:33:47 2018 -0800
    51.3 @@ -28,7 +28,7 @@
    51.4  #define LL_LLPANELMARKETPLACEINBOX_H
    51.5  
    51.6  #include "llpanel.h"
    51.7 -
    51.8 +#include "llfolderview.h"
    51.9  class LLButton;
   51.10  class LLInventoryPanel;
   51.11  class LLUICtrl;
   51.12 @@ -56,6 +56,9 @@
   51.13  	
   51.14  	LLInventoryPanel * setupInventoryPanel();
   51.15  
   51.16 +	void onClearSearch();
   51.17 +	void onFilterEdit(const std::string& search_string);
   51.18 +
   51.19  	U32 getFreshItemCount() const;
   51.20  	U32 getTotalItemCount() const;
   51.21  
   51.22 @@ -71,6 +74,7 @@
   51.23  	LLUICtrl *			mFreshCountCtrl;
   51.24  	LLButton *			mInboxButton;
   51.25  	LLInventoryPanel *	mInventoryPanel;
   51.26 +	LLSaveFolderState*			mSavedFolderState;
   51.27  };
   51.28  
   51.29  
    52.1 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp	Thu Mar 01 09:34:25 2018 -0800
    52.2 +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp	Thu Mar 01 14:33:47 2018 -0800
    52.3 @@ -62,6 +62,12 @@
    52.4  LLInboxInventoryPanel::~LLInboxInventoryPanel()
    52.5  {}
    52.6  
    52.7 +void LLInboxInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
    52.8 +{
    52.9 +	LLInventoryPanel::initFromParams(params);
   52.10 +	getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX));
   52.11 +}
   52.12 +
   52.13  LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop)
   52.14  {
   52.15  	LLUIColor item_color = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
   52.16 @@ -140,18 +146,16 @@
   52.17  	LLFolderViewFolder::draw();
   52.18  }
   52.19  
   52.20 -void LLInboxFolderViewFolder::selectItem()
   52.21 +BOOL LLInboxFolderViewFolder::handleMouseDown( S32 x, S32 y, MASK mask )
   52.22  {
   52.23  	deFreshify();
   52.24 -
   52.25 -	LLFolderViewFolder::selectItem();
   52.26 +	return LLFolderViewFolder::handleMouseDown(x, y, mask);
   52.27  }
   52.28  
   52.29 -void LLInboxFolderViewFolder::toggleOpen()
   52.30 +BOOL LLInboxFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask )
   52.31  {
   52.32  	deFreshify();
   52.33 -
   52.34 -	LLFolderViewFolder::toggleOpen();
   52.35 +	return LLFolderViewFolder::handleDoubleClick(x, y, mask);
   52.36  }
   52.37  
   52.38  void LLInboxFolderViewFolder::computeFreshness()
    53.1 --- a/indra/newview/llpanelmarketplaceinboxinventory.h	Thu Mar 01 09:34:25 2018 -0800
    53.2 +++ b/indra/newview/llpanelmarketplaceinboxinventory.h	Thu Mar 01 14:33:47 2018 -0800
    53.3 @@ -46,6 +46,7 @@
    53.4  	~LLInboxInventoryPanel();
    53.5  
    53.6  	// virtual
    53.7 +	void initFromParams(const LLInventoryPanel::Params&);
    53.8  	LLFolderViewFolder*	createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop);
    53.9  	LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge);
   53.10  };
   53.11 @@ -68,8 +69,8 @@
   53.12      void addItem(LLFolderViewItem* item);
   53.13  	void draw();
   53.14  	
   53.15 -	void selectItem();
   53.16 -	void toggleOpen();
   53.17 +	BOOL handleMouseDown(S32 x, S32 y, MASK mask);
   53.18 +	BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
   53.19  
   53.20  	void computeFreshness();
   53.21  	void deFreshify();
    54.1 --- a/indra/newview/llpanelmediasettingsgeneral.cpp	Thu Mar 01 09:34:25 2018 -0800
    54.2 +++ b/indra/newview/llpanelmediasettingsgeneral.cpp	Thu Mar 01 14:33:47 2018 -0800
    54.3 @@ -196,7 +196,7 @@
    54.4  
    54.5  ////////////////////////////////////////////////////////////////////////////////
    54.6  // static 
    54.7 -void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable)
    54.8 +void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable, bool update_preview)
    54.9  {	
   54.10  	LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata;
   54.11  	self->mAutoLoop->clear();
   54.12 @@ -217,7 +217,10 @@
   54.13  	self->mHeightPixels ->setEnabled(editable);
   54.14  	self->mHomeURL ->setEnabled(editable);
   54.15  	self->mWidthPixels ->setEnabled(editable);
   54.16 -	self->updateMediaPreview();
   54.17 +	if (update_preview)
   54.18 +	{
   54.19 +		self->updateMediaPreview();
   54.20 +	}
   54.21  }
   54.22  
   54.23  // static
    55.1 --- a/indra/newview/llpanelmediasettingsgeneral.h	Thu Mar 01 09:34:25 2018 -0800
    55.2 +++ b/indra/newview/llpanelmediasettingsgeneral.h	Thu Mar 01 14:33:47 2018 -0800
    55.3 @@ -59,7 +59,7 @@
    55.4  
    55.5  	void setParent( LLFloaterMediaSettings* parent );
    55.6  	static void initValues( void* userdata, const LLSD& media_settings ,bool editable);
    55.7 -	static void clearValues( void* userdata, bool editable);
    55.8 +	static void clearValues( void* userdata, bool editable, bool update_preview = true);
    55.9  	
   55.10  	// Navigates the current selected face to the Home URL.
   55.11  	// If 'only_if_current_is_empty' is "true", it only performs
    56.1 --- a/indra/newview/llpanelplaces.cpp	Thu Mar 01 09:34:25 2018 -0800
    56.2 +++ b/indra/newview/llpanelplaces.cpp	Thu Mar 01 14:33:47 2018 -0800
    56.3 @@ -395,11 +395,16 @@
    56.4  			mPlaceInfoType = key_type;
    56.5  			mPosGlobal.setZero();
    56.6  			mItem = NULL;
    56.7 +			mRegionId.setNull();
    56.8  			togglePlaceInfoPanel(TRUE);
    56.9  
   56.10  			if (mPlaceInfoType == AGENT_INFO_TYPE)
   56.11  			{
   56.12  				mPlaceProfile->setInfoType(LLPanelPlaceInfo::AGENT);
   56.13 +				if (gAgent.getRegion())
   56.14 +				{
   56.15 +					mRegionId = gAgent.getRegion()->getRegionID();
   56.16 +				}
   56.17  			}
   56.18  			else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE)
   56.19  			{
   56.20 @@ -472,6 +477,8 @@
   56.21  	if (!parcel_mgr)
   56.22  		return;
   56.23  
   56.24 +	mParcelLocalId = parcel_mgr->getAgentParcel()->getLocalID();
   56.25 +
   56.26  	// Start using LLViewerParcelMgr for land selection if
   56.27  	// information about nearby land is requested.
   56.28  	// Otherwise stop using land selection and deselect land.
   56.29 @@ -828,10 +835,21 @@
   56.30  	{
   56.31  		menu = mPlaceMenu;
   56.32  
   56.33 +		bool landmark_item_enabled = false;
   56.34 +		LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
   56.35 +		if (is_agent_place_info_visible
   56.36 +			&& gAgent.getRegion()
   56.37 +			&& mRegionId == gAgent.getRegion()->getRegionID()
   56.38 +			&& parcel_mgr
   56.39 +			&& parcel_mgr->getAgentParcel()->getLocalID() == mParcelLocalId)
   56.40 +		{
   56.41 +			// Floater still shows location identical to agent's position
   56.42 +			landmark_item_enabled = !LLLandmarkActions::landmarkAlreadyExists();
   56.43 +		}
   56.44 +
   56.45  		// Enable adding a landmark only for agent current parcel and if
   56.46  		// there is no landmark already pointing to that parcel in agent's inventory.
   56.47 -		menu->getChild<LLMenuItemCallGL>("landmark")->setEnabled(is_agent_place_info_visible &&
   56.48 -																 !LLLandmarkActions::landmarkAlreadyExists());
   56.49 +		menu->getChild<LLMenuItemCallGL>("landmark")->setEnabled(landmark_item_enabled);
   56.50  		// STORM-411
   56.51  		// Creating landmarks for remote locations is impossible.
   56.52  		// So hide menu item "Make a Landmark" in "Teleport History Profile" panel.
    57.1 --- a/indra/newview/llpanelplaces.h	Thu Mar 01 09:34:25 2018 -0800
    57.2 +++ b/indra/newview/llpanelplaces.h	Thu Mar 01 14:33:47 2018 -0800
    57.3 @@ -146,6 +146,10 @@
    57.4  	// Information type currently shown in Place Information panel
    57.5  	std::string					mPlaceInfoType;
    57.6  
    57.7 +	// Region and parcel ids, to detect location changes in case of AGENT_INFO_TYPE
    57.8 +	LLUUID						mRegionId;
    57.9 +	S32							mParcelLocalId;
   57.10 +
   57.11  	bool						isLandmarkEditModeOn;
   57.12  
   57.13  	// Holds info whether "My Landmarks" and "Teleport History" tabs have been created.
    58.1 --- a/indra/newview/llphysicsmotion.cpp	Thu Mar 01 09:34:25 2018 -0800
    58.2 +++ b/indra/newview/llphysicsmotion.cpp	Thu Mar 01 14:33:47 2018 -0800
    58.3 @@ -44,7 +44,7 @@
    58.4  typedef std::map<std::string, F32> default_controller_map_t;
    58.5  
    58.6  #define MIN_REQUIRED_PIXEL_AREA_AVATAR_PHYSICS_MOTION 0.f
    58.7 -#define TIME_ITERATION_STEP 0.1f
    58.8 +#define TIME_ITERATION_STEP 0.05f
    58.9  
   58.10  inline F64 llsgn(const F64 a)
   58.11  {
   58.12 @@ -491,12 +491,6 @@
   58.13          //
   58.14  
   58.15          const F32 time_delta = time - mLastTime;
   58.16 -
   58.17 -	// Don't update too frequently, to avoid precision errors from small time slices.
   58.18 -	if (time_delta <= .01)
   58.19 -	{
   58.20 -		return FALSE;
   58.21 -	}
   58.22  	
   58.23  	// If less than 1FPS, we don't want to be spending time updating physics at all.
   58.24          if (time_delta > 1.0)
   58.25 @@ -555,6 +549,18 @@
   58.26  	
   58.27  	// Break up the physics into a bunch of iterations so that differing framerates will show
   58.28  	// roughly the same behavior.
   58.29 +	// Explanation/example: Lets assume we have a bouncing object. Said abjects bounces at a
   58.30 +	// trajectory that has points A>B>C. Object bounces from A to B with specific speed.
   58.31 +	// It needs time T to move from A to B.
   58.32 +	// As long as our frame's time significantly smaller then T our motion will be split into
   58.33 +	// multiple parts. with each part speed will decrease. Object will reach B position (roughly)
   58.34 +	// and bounce/fall back to A.
   58.35 +	// But if frame's time (F_T) is larger then T, object will move with same speed for whole F_T
   58.36 +	// and will jump over point B up to C ending up with increased amplitude. To avoid that we
   58.37 +	// split F_T into smaller portions so that when frame's time is too long object can virtually
   58.38 +	// bounce at right (relatively) position.
   58.39 +	// Note: this doesn't look to be optimal, since it provides only "roughly same" behavior, but
   58.40 +	// irregularity at higher fps looks to be insignificant so it works good enough for low fps.
   58.41  	for (F32 time_iteration = 0; time_iteration <= time_delta; time_iteration += TIME_ITERATION_STEP)
   58.42  	{
   58.43  		F32 time_iteration_step = TIME_ITERATION_STEP;
    59.1 --- a/indra/newview/llstartup.cpp	Thu Mar 01 09:34:25 2018 -0800
    59.2 +++ b/indra/newview/llstartup.cpp	Thu Mar 01 14:33:47 2018 -0800
    59.3 @@ -718,7 +718,6 @@
    59.4  		set_startup_status(0.03f, msg.c_str(), gAgent.mMOTD.c_str());
    59.5  		display_startup();
    59.6  		// LLViewerMedia::initBrowser();
    59.7 -		show_release_notes_if_required();
    59.8  		LLStartUp::setStartupState( STATE_LOGIN_SHOW );
    59.9  		return FALSE;
   59.10  	}
   59.11 @@ -749,6 +748,7 @@
   59.12  			initialize_spellcheck_menu();
   59.13  			init_menus();
   59.14  		}
   59.15 +		show_release_notes_if_required();
   59.16  
   59.17  		if (show_connect_box)
   59.18  		{
    60.1 --- a/indra/newview/lltexturecache.cpp	Thu Mar 01 09:34:25 2018 -0800
    60.2 +++ b/indra/newview/lltexturecache.cpp	Thu Mar 01 14:33:47 2018 -0800
    60.3 @@ -452,27 +452,38 @@
    60.4  		size = llmin(size, mDataSize);
    60.5  		// Allocate the read buffer
    60.6  		mReadData = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), size);
    60.7 -		S32 bytes_read = LLAPRFile::readEx(mCache->mHeaderDataFileName, 
    60.8 -											 mReadData, offset, size, mCache->getLocalAPRFilePool());
    60.9 -		if (bytes_read != size)
   60.10 +		if (mReadData)
   60.11 +		{
   60.12 +			S32 bytes_read = LLAPRFile::readEx(mCache->mHeaderDataFileName, 
   60.13 +												 mReadData, offset, size, mCache->getLocalAPRFilePool());
   60.14 +			if (bytes_read != size)
   60.15 +			{
   60.16 +				LL_WARNS() << "LLTextureCacheWorker: "  << mID
   60.17 +						<< " incorrect number of bytes read from header: " << bytes_read
   60.18 +						<< " / " << size << LL_ENDL;
   60.19 +				FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
   60.20 +				mReadData = NULL;
   60.21 +				mDataSize = -1; // failed
   60.22 +				done = true;
   60.23 +			}
   60.24 +			// If we already read all we expected, we're actually done
   60.25 +			if (mDataSize <= bytes_read)
   60.26 +			{
   60.27 +				done = true;
   60.28 +			}
   60.29 +			else
   60.30 +			{
   60.31 +				mState = BODY;
   60.32 +			}
   60.33 +		}
   60.34 +		else
   60.35  		{
   60.36  			LL_WARNS() << "LLTextureCacheWorker: "  << mID
   60.37 -					<< " incorrect number of bytes read from header: " << bytes_read
   60.38 -					<< " / " << size << LL_ENDL;
   60.39 -			FREE_MEM(LLImageBase::getPrivatePool(), mReadData);
   60.40 +				<< " failed to allocate memory for reading: " << mDataSize << LL_ENDL;
   60.41  			mReadData = NULL;
   60.42  			mDataSize = -1; // failed
   60.43  			done = true;
   60.44  		}
   60.45 -		// If we already read all we expected, we're actually done
   60.46 -		if (mDataSize <= bytes_read)
   60.47 -		{
   60.48 -			done = true;
   60.49 -		}
   60.50 -		else
   60.51 -		{
   60.52 -			mState = BODY;
   60.53 -		}
   60.54  	}
   60.55  
   60.56  	// Fourth state / stage : read the rest of the data from the UUID based cached file
    61.1 --- a/indra/newview/lltexturefetch.cpp	Thu Mar 01 09:34:25 2018 -0800
    61.2 +++ b/indra/newview/lltexturefetch.cpp	Thu Mar 01 14:33:47 2018 -0800
    61.3 @@ -1760,7 +1760,17 @@
    61.4  				mRequestedSize -= src_offset;			// Make requested values reflect useful part
    61.5  				mRequestedOffset += src_offset;
    61.6  			}
    61.7 -			
    61.8 +
    61.9 +			U8 * buffer = (U8 *)ALLOCATE_MEM(LLImageBase::getPrivatePool(), total_size);
   61.10 +			if (!buffer)
   61.11 +			{
   61.12 +				// abort. If we have no space for packet, we have not enough space to decode image
   61.13 +				setState(DONE);
   61.14 +				LL_WARNS(LOG_TXT) << mID << " abort: out of memory" << LL_ENDL;
   61.15 +				releaseHttpSemaphore();
   61.16 +				return true;
   61.17 +			}
   61.18 +
   61.19  			if (mFormattedImage.isNull())
   61.20  			{
   61.21  				// For now, create formatted image based on extension
   61.22 @@ -1780,10 +1790,10 @@
   61.23  			{
   61.24  				mFileSize = total_size + 1 ; //flag the file is not fully loaded.
   61.25  			}
   61.26 -			
   61.27 -			U8 * buffer = (U8 *) ALLOCATE_MEM(LLImageBase::getPrivatePool(), total_size);
   61.28 +
   61.29  			if (cur_size > 0)
   61.30  			{
   61.31 +				// Copy previously collected data into buffer
   61.32  				memcpy(buffer, mFormattedImage->getData(), cur_size);
   61.33  			}
   61.34  			mHttpBufferArray->read(src_offset, (char *) buffer + cur_size, append_size);
    62.1 --- a/indra/newview/llviewerassetupload.cpp	Thu Mar 01 09:34:25 2018 -0800
    62.2 +++ b/indra/newview/llviewerassetupload.cpp	Thu Mar 01 14:33:47 2018 -0800
    62.3 @@ -760,17 +760,22 @@
    62.4          {
    62.5              success = true;
    62.6  
    62.7 +            LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
    62.8 +
    62.9              // Show the preview panel for textures and sounds to let
   62.10              // user know that the image (or snapshot) arrived intact.
   62.11 -            LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel();
   62.12 +            LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
   62.13              if (panel)
   62.14              {
   62.15 -                LLFocusableElement* focus = gFocusMgr.getKeyboardFocus();
   62.16                  panel->setSelection(serverInventoryItem, TAKE_FOCUS_NO);
   62.17 +            }
   62.18 +            else
   62.19 +            {
   62.20 +                LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, serverInventoryItem, TRUE, TAKE_FOCUS_NO, TRUE);
   62.21 +            }
   62.22  
   62.23 -                // restore keyboard focus
   62.24 -                gFocusMgr.setKeyboardFocus(focus);
   62.25 -            }
   62.26 +            // restore keyboard focus
   62.27 +            gFocusMgr.setKeyboardFocus(focus);
   62.28          }
   62.29          else
   62.30          {
    63.1 --- a/indra/newview/llviewermedia.cpp	Thu Mar 01 09:34:25 2018 -0800
    63.2 +++ b/indra/newview/llviewermedia.cpp	Thu Mar 01 14:33:47 2018 -0800
    63.3 @@ -776,13 +776,24 @@
    63.4  				}
    63.5  			}
    63.6  			// update the audio stream here as well
    63.7 +			static bool restore_parcel_audio = false;
    63.8  			if( !inworld_audio_enabled)
    63.9  			{
   63.10  				if(LLViewerMedia::isParcelAudioPlaying() && gAudiop && LLViewerMedia::hasParcelAudio())
   63.11  				{
   63.12  					LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade();
   63.13 +					restore_parcel_audio = true;
   63.14  				}
   63.15  			}
   63.16 +            else
   63.17 +            {
   63.18 +                if(gAudiop && LLViewerMedia::hasParcelAudio() && restore_parcel_audio && gSavedSettings.getBOOL("MediaTentativeAutoPlay"))
   63.19 +                {
   63.20 +                    LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL());
   63.21 +                    restore_parcel_audio = false;
   63.22 +                }
   63.23 +            }
   63.24 +
   63.25  			pimpl->setPriority(new_priority);
   63.26  
   63.27  			if(pimpl->getUsedInUI())
    64.1 --- a/indra/newview/llviewermessage.cpp	Thu Mar 01 09:34:25 2018 -0800
    64.2 +++ b/indra/newview/llviewermessage.cpp	Thu Mar 01 14:33:47 2018 -0800
    64.3 @@ -871,7 +871,7 @@
    64.4  	 */
    64.5  	bool isSelectionChanged()
    64.6  	{	
    64.7 -		LLInventoryPanel* active_panel = dynamic_cast<LLInventoryPanel*>(mActivePanel.get());
    64.8 +		LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel();
    64.9  
   64.10  		if (NULL == active_panel)
   64.11  		{
   64.12 @@ -881,7 +881,7 @@
   64.13  		// get selected items (without destination folder)
   64.14  		selected_items_t selected_items;
   64.15   		
   64.16 - 		std::set<LLFolderViewItem*> selection =    LLInventoryPanel::getActiveInventoryPanel()->getRootFolder()->getSelectionList();
   64.17 +		std::set<LLFolderViewItem*> selection = active_panel->getRootFolder()->getSelectionList();
   64.18  		for (std::set<LLFolderViewItem*>::iterator it = selection.begin(),    end_it = selection.end();
   64.19  			it != end_it;
   64.20  			++it)
    65.1 --- a/indra/newview/llviewerobject.cpp	Thu Mar 01 09:34:25 2018 -0800
    65.2 +++ b/indra/newview/llviewerobject.cpp	Thu Mar 01 14:33:47 2018 -0800
    65.3 @@ -270,7 +270,9 @@
    65.4  	mPhysicsShapeUnknown(true),
    65.5  	mAttachmentItemID(LLUUID::null),
    65.6  	mLastUpdateType(OUT_UNKNOWN),
    65.7 -	mLastUpdateCached(FALSE)
    65.8 +	mLastUpdateCached(FALSE),
    65.9 +	mCachedMuteListUpdateTime(0),
   65.10 +	mCachedOwnerInMuteList(false)
   65.11  {
   65.12  	if (!is_global)
   65.13  	{
   65.14 @@ -5116,6 +5118,30 @@
   65.15  	}
   65.16  }
   65.17  
   65.18 +bool LLViewerObject::isOwnerInMuteList(LLUUID id)
   65.19 +{
   65.20 +	LLUUID owner_id = id.isNull() ? mOwnerID : id;
   65.21 +	if (isAvatar() || owner_id.isNull())
   65.22 +	{
   65.23 +		return false;
   65.24 +	}
   65.25 +	bool muted = false;
   65.26 +	F64 now = LLFrameTimer::getTotalSeconds();
   65.27 +	if (now < mCachedMuteListUpdateTime)
   65.28 +	{
   65.29 +		muted = mCachedOwnerInMuteList;
   65.30 +	}
   65.31 +	else
   65.32 +	{
   65.33 +		muted = LLMuteList::getInstance()->isMuted(owner_id);
   65.34 +
   65.35 +		const F64 SECONDS_BETWEEN_MUTE_UPDATES = 1;
   65.36 +		mCachedMuteListUpdateTime = now + SECONDS_BETWEEN_MUTE_UPDATES;
   65.37 +		mCachedOwnerInMuteList = muted;
   65.38 +	}
   65.39 +	return muted;
   65.40 +}
   65.41 +
   65.42  LLVOAvatar* LLViewerObject::asAvatar()
   65.43  {
   65.44  	return NULL;
    66.1 --- a/indra/newview/llviewerobject.h	Thu Mar 01 09:34:25 2018 -0800
    66.2 +++ b/indra/newview/llviewerobject.h	Thu Mar 01 14:33:47 2018 -0800
    66.3 @@ -422,6 +422,8 @@
    66.4  	void updateText(); // update text label position
    66.5  	virtual void updateDrawable(BOOL force_damped); // force updates on static objects
    66.6  
    66.7 +	bool isOwnerInMuteList(LLUUID item_id = LLUUID());
    66.8 +
    66.9  	void setDrawableState(U32 state, BOOL recursive = TRUE);
   66.10  	void clearDrawableState(U32 state, BOOL recursive = TRUE);
   66.11  	BOOL isDrawableState(U32 state, BOOL recursive = TRUE) const;
   66.12 @@ -823,6 +825,9 @@
   66.13  	static BOOL sVelocityInterpolate;
   66.14  	static BOOL sPingInterpolate;
   66.15  
   66.16 +	bool mCachedOwnerInMuteList;
   66.17 +	F64 mCachedMuteListUpdateTime;
   66.18 +
   66.19  	//--------------------------------------------------------------------
   66.20  	// For objects that are attachments
   66.21  	//--------------------------------------------------------------------
    67.1 --- a/indra/newview/llviewerobjectlist.cpp	Thu Mar 01 09:34:25 2018 -0800
    67.2 +++ b/indra/newview/llviewerobjectlist.cpp	Thu Mar 01 14:33:47 2018 -0800
    67.3 @@ -478,15 +478,25 @@
    67.4  			{
    67.5  				U32 flags = 0;
    67.6  				mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, i);
    67.7 -                
    67.8 -				if(flags & FLAGS_TEMPORARY_ON_REZ)
    67.9 +
   67.10 +				compressed_dp.unpackUUID(fullid, "ID");
   67.11 +				compressed_dp.unpackU32(local_id, "LocalID");
   67.12 +				compressed_dp.unpackU8(pcode, "PCode");
   67.13 +				
   67.14 +				if (pcode == 0)
   67.15  				{
   67.16 -                    compressed_dp.unpackUUID(fullid, "ID");
   67.17 -                    compressed_dp.unpackU32(local_id, "LocalID");
   67.18 -                    compressed_dp.unpackU8(pcode, "PCode");
   67.19 -                }
   67.20 -				else //send to object cache
   67.21 +					// object creation will fail, LLViewerObject::createObject()
   67.22 +					LL_WARNS() << "Received object " << fullid
   67.23 +						<< " with 0 PCode. Local id: " << local_id
   67.24 +						<< " Flags: " << flags
   67.25 +						<< " Region: " << regionp->getName()
   67.26 +						<< " Region id: " << regionp->getRegionID() << LL_ENDL;
   67.27 +					recorder.objectUpdateFailure(local_id, update_type, msg_size);
   67.28 +					continue;
   67.29 +				}
   67.30 +				else if ((flags & FLAGS_TEMPORARY_ON_REZ) == 0)
   67.31  				{
   67.32 +					//send to object cache
   67.33  					regionp->cacheFullUpdate(compressed_dp, flags);
   67.34  					continue;
   67.35  				}
   67.36 @@ -732,9 +742,9 @@
   67.37  	S32 num_updates, max_value;
   67.38  	if (NUM_BINS - 1 == mCurBin)
   67.39  	{
   67.40 +		// Remainder (mObjects.size() could have changed)
   67.41  		num_updates = (S32) mObjects.size() - mCurLazyUpdateIndex;
   67.42  		max_value = (S32) mObjects.size();
   67.43 -		gTextureList.setUpdateStats(TRUE);
   67.44  	}
   67.45  	else
   67.46  	{
   67.47 @@ -791,10 +801,14 @@
   67.48  	mCurLazyUpdateIndex = max_value;
   67.49  	if (mCurLazyUpdateIndex == mObjects.size())
   67.50  	{
   67.51 +		// restart
   67.52  		mCurLazyUpdateIndex = 0;
   67.53 +		mCurBin = 0; // keep in sync with index (mObjects.size() could have changed)
   67.54  	}
   67.55 -
   67.56 -	mCurBin = (mCurBin + 1) % NUM_BINS;
   67.57 +	else
   67.58 +	{
   67.59 +		mCurBin = (mCurBin + 1) % NUM_BINS;
   67.60 +	}
   67.61  
   67.62  	LLVOAvatar::cullAvatarsByPixelArea();
   67.63  }
    68.1 --- a/indra/newview/llviewerpartsim.cpp	Thu Mar 01 09:34:25 2018 -0800
    68.2 +++ b/indra/newview/llviewerpartsim.cpp	Thu Mar 01 14:33:47 2018 -0800
    68.3 @@ -37,6 +37,7 @@
    68.4  #include "llviewerregion.h"
    68.5  #include "llvopartgroup.h"
    68.6  #include "llworld.h"
    68.7 +#include "llmutelist.h"
    68.8  #include "pipeline.h"
    68.9  #include "llspatialpartition.h"
   68.10  #include "llvoavatarself.h"
   68.11 @@ -711,6 +712,11 @@
   68.12  				upd = FALSE;
   68.13  			}
   68.14  
   68.15 +			if(vobj && vobj->isOwnerInMuteList(mViewerPartSources[i]->getOwnerUUID()))
   68.16 +			{
   68.17 +				upd = FALSE;
   68.18 +			}
   68.19 +
   68.20  			if (upd && vobj && (vobj->getPCode() == LL_PCODE_VOLUME))
   68.21  			{
   68.22  				if(vobj->getAvatar() && vobj->getAvatar()->isTooComplex())
   68.23 @@ -750,7 +756,7 @@
   68.24  		LLViewerObject* vobj = mViewerPartGroups[i]->mVOPartGroupp;
   68.25  
   68.26  		S32 visirate = 1;
   68.27 -		if (vobj)
   68.28 +		if (vobj && !vobj->isDead() && vobj->mDrawable && !vobj->mDrawable->isDead())
   68.29  		{
   68.30  			LLSpatialGroup* group = vobj->mDrawable->getSpatialGroup();
   68.31  			if (group && !group->isVisible()) // && !group->isState(LLSpatialGroup::OBJECT_DIRTY))
   68.32 @@ -761,7 +767,7 @@
   68.33  
   68.34  		if ((LLDrawable::getCurrentFrame()+mViewerPartGroups[i]->mID)%visirate == 0)
   68.35  		{
   68.36 -			if (vobj)
   68.37 +			if (vobj && !vobj->isDead())
   68.38  			{
   68.39  				gPipeline.markRebuild(vobj->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
   68.40  			}
    69.1 --- a/indra/newview/llviewertexturelist.cpp	Thu Mar 01 09:34:25 2018 -0800
    69.2 +++ b/indra/newview/llviewertexturelist.cpp	Thu Mar 01 14:33:47 2018 -0800
    69.3 @@ -92,7 +92,6 @@
    69.4  
    69.5  LLViewerTextureList::LLViewerTextureList() 
    69.6  	: mForceResetTextureStats(FALSE),
    69.7 -	mUpdateStats(FALSE),
    69.8  	mMaxResidentTexMemInMegaBytes(0),
    69.9  	mMaxTotalTextureMemInMegaBytes(0),
   69.10  	mInitialized(FALSE)
   69.11 @@ -103,7 +102,6 @@
   69.12  {			
   69.13  	mInitialized = TRUE ;
   69.14  	sNumImages = 0;
   69.15 -	mUpdateStats = TRUE;
   69.16  	mMaxResidentTexMemInMegaBytes = (U32Bytes)0;
   69.17  	mMaxTotalTextureMemInMegaBytes = (U32Bytes)0;
   69.18  	
   69.19 @@ -1171,7 +1169,7 @@
   69.20  
   69.21  void LLViewerTextureList::updateImagesUpdateStats()
   69.22  {
   69.23 -	if (mUpdateStats && mForceResetTextureStats)
   69.24 +	if (mForceResetTextureStats)
   69.25  	{
   69.26  		for (image_priority_list_t::iterator iter = mImageList.begin();
   69.27  			 iter != mImageList.end(); )
   69.28 @@ -1179,7 +1177,6 @@
   69.29  			LLViewerFetchedTexture* imagep = *iter++;
   69.30  			imagep->resetTextureStats();
   69.31  		}
   69.32 -		mUpdateStats = FALSE;
   69.33  		mForceResetTextureStats = FALSE;
   69.34  	}
   69.35  }
    70.1 --- a/indra/newview/llviewertexturelist.h	Thu Mar 01 09:34:25 2018 -0800
    70.2 +++ b/indra/newview/llviewertexturelist.h	Thu Mar 01 14:33:47 2018 -0800
    70.3 @@ -124,8 +124,6 @@
    70.4  
    70.5  	void handleIRCallback(void **data, const S32 number);
    70.6  
    70.7 -	void setUpdateStats(BOOL b)			{ mUpdateStats = b; }
    70.8 -
    70.9  	S32Megabytes	getMaxResidentTexMem() const	{ return mMaxResidentTexMemInMegaBytes; }
   70.10  	S32Megabytes getMaxTotalTextureMem() const   { return mMaxTotalTextureMemInMegaBytes;}
   70.11  	S32 getNumImages()					{ return mImageList.size(); }
   70.12 @@ -224,7 +222,6 @@
   70.13  	std::set<LLPointer<LLViewerFetchedTexture> > mImagePreloads;
   70.14  
   70.15  	BOOL mInitialized ;
   70.16 -	BOOL mUpdateStats;
   70.17  	S32Megabytes	mMaxResidentTexMemInMegaBytes;
   70.18  	S32Megabytes mMaxTotalTextureMemInMegaBytes;
   70.19  	LLFrameTimer mForceDecodeTimer;
    71.1 --- a/indra/newview/llviewerwindow.cpp	Thu Mar 01 09:34:25 2018 -0800
    71.2 +++ b/indra/newview/llviewerwindow.cpp	Thu Mar 01 14:33:47 2018 -0800
    71.3 @@ -1406,7 +1406,7 @@
    71.4  {
    71.5  	// Let the voice chat code check for its PTT key.  Note that this never affects event processing.
    71.6  	LLVoiceClient::getInstance()->keyDown(key, mask);
    71.7 -	
    71.8 +
    71.9  	if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
   71.10  	{
   71.11  		gAgent.clearAFK();
   71.12 @@ -1959,7 +1959,11 @@
   71.13  	// (But wait to add it as a child of the root view so that it will be in front of the 
   71.14  	// other views.)
   71.15  	MainPanel* main_view = new MainPanel();
   71.16 -	main_view->buildFromFile("main_view.xml");
   71.17 +	if (!main_view->buildFromFile("main_view.xml"))
   71.18 +	{
   71.19 +		LL_ERRS() << "Failed to initialize viewer: Viewer couldn't process file main_view.xml, "
   71.20 +				<< "if this problem happens again, please validate your installation." << LL_ENDL;
   71.21 +	}
   71.22  	main_view->setShape(full_window);
   71.23  	getRootView()->addChild(main_view);
   71.24  
   71.25 @@ -2264,6 +2268,7 @@
   71.26  LLViewerWindow::~LLViewerWindow()
   71.27  {
   71.28  	LL_INFOS() << "Destroying Window" << LL_ENDL;
   71.29 +	gDebugWindowProc = TRUE; // event catching, at this point it shouldn't output at all
   71.30  	destroyWindow();
   71.31  
   71.32  	delete mDebugText;
   71.33 @@ -4443,7 +4448,8 @@
   71.34  		err = LLFile::stat( filepath, &stat_info );
   71.35  		i++;
   71.36  	}
   71.37 -	while( -1 != err );  // search until the file is not found (i.e., stat() gives an error).
   71.38 +	while( -1 != err  // Search until the file is not found (i.e., stat() gives an error).
   71.39 +			&& is_snapshot_name_loc_set); // Or stop if we are rewriting.
   71.40  
   71.41  	LL_INFOS() << "Saving snapshot to " << filepath << LL_ENDL;
   71.42  	return image->save(filepath);
    72.1 --- a/indra/newview/llvoicevivox.cpp	Thu Mar 01 09:34:25 2018 -0800
    72.2 +++ b/indra/newview/llvoicevivox.cpp	Thu Mar 01 14:33:47 2018 -0800
    72.3 @@ -887,13 +887,8 @@
    72.4  bool LLVivoxVoiceClient::provisionVoiceAccount()
    72.5  {
    72.6      LL_INFOS("Voice") << "Provisioning voice account." << LL_ENDL;
    72.7 -    while (!gAgent.getRegion())
    72.8 -    {
    72.9 -        // *TODO* Set up a call back on agent that sends a message to a pump we can use to wake up.
   72.10 -        llcoro::suspend();
   72.11 -    }
   72.12 -
   72.13 -    while (!gAgent.getRegion()->capabilitiesReceived())
   72.14 +
   72.15 +    while (!gAgent.getRegion() || !gAgent.getRegion()->capabilitiesReceived())
   72.16      {
   72.17          // *TODO* Pump a message for wake up.
   72.18          llcoro::suspend();
    73.1 --- a/indra/newview/llvovolume.cpp	Thu Mar 01 09:34:25 2018 -0800
    73.2 +++ b/indra/newview/llvovolume.cpp	Thu Mar 01 14:33:47 2018 -0800
    73.3 @@ -628,7 +628,7 @@
    73.4  		if (mDrawable.notNull() && !isVisible() && !mDrawable->isActive())
    73.5  		{ //delete vertex buffer to free up some VRAM
    73.6  			LLSpatialGroup* group  = mDrawable->getSpatialGroup();
    73.7 -			if (group)
    73.8 +			if (group && (group->mVertexBuffer.notNull() || !group->mBufferMap.empty() || !group->mDrawMap.empty()))
    73.9  			{
   73.10  				group->destroyGL(true);
   73.11  
    74.1 --- a/indra/newview/llwearableitemslist.cpp	Thu Mar 01 09:34:25 2018 -0800
    74.2 +++ b/indra/newview/llwearableitemslist.cpp	Thu Mar 01 14:33:47 2018 -0800
    74.3 @@ -645,7 +645,7 @@
    74.4  		setRightMouseDownCallback(boost::bind(&LLWearableItemsList::onRightClick, this, _2, _3));
    74.5  	}
    74.6  	mWornIndicationEnabled = p.worn_indication_enabled;
    74.7 -	setNoItemsCommentText(LLTrans::getString("LoadingData"));
    74.8 +	setNoItemsCommentText(LLTrans::getString("NoneFound"));
    74.9  }
   74.10  
   74.11  // virtual
    75.1 --- a/indra/newview/llworldmapview.cpp	Thu Mar 01 09:34:25 2018 -0800
    75.2 +++ b/indra/newview/llworldmapview.cpp	Thu Mar 01 14:33:47 2018 -0800
    75.3 @@ -1750,8 +1750,10 @@
    75.4  		case MAP_ITEM_LAND_FOR_SALE:
    75.5  		case MAP_ITEM_LAND_FOR_SALE_ADULT:
    75.6  			{
    75.7 +				LLVector3d pos_global = viewPosToGlobal(x, y);
    75.8 +				LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global);
    75.9  				LLFloaterReg::hideInstance("world_map");
   75.10 -				LLFloaterReg::showInstance("search", LLSD().with("category", "destinations").with("query", id));
   75.11 +				LLFloaterReg::showInstance("search", LLSD().with("category", "land").with("query", info->getName()));
   75.12  				break;
   75.13  			}
   75.14  		case MAP_ITEM_CLASSIFIED:
    76.1 --- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml	Thu Mar 01 09:34:25 2018 -0800
    76.2 +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml	Thu Mar 01 14:33:47 2018 -0800
    76.3 @@ -47,7 +47,6 @@
    76.4       top="20"
    76.5       width="500">
    76.6          <panel
    76.7 -         border="none"
    76.8           height="150"
    76.9           label="Search"
   76.10           layout="topleft"
   76.11 @@ -108,7 +107,6 @@
   76.12            </scroll_list>
   76.13          </panel>
   76.14          <panel
   76.15 -         border="none"
   76.16           height="150"
   76.17           label="Friends"
   76.18           layout="topleft"
   76.19 @@ -144,7 +142,6 @@
   76.20              <scroll_list
   76.21               follows="all"
   76.22               height="120"
   76.23 -             border="false"
   76.24               layout="topleft"
   76.25               left="0"
   76.26               name="Friends"
   76.27 @@ -154,7 +151,6 @@
   76.28          </panel>
   76.29  
   76.30          <panel
   76.31 -         border="none"
   76.32           height="150"
   76.33           label="Near Me"
   76.34           layout="topleft"
   76.35 @@ -213,7 +209,6 @@
   76.36               draw_heading="true"
   76.37               follows="all"
   76.38               height="100"
   76.39 -             border="false"
   76.40               layout="topleft"
   76.41               left="0"
   76.42               name="NearMe"
    77.1 --- a/indra/newview/skins/default/xui/en/notifications.xml	Thu Mar 01 09:34:25 2018 -0800
    77.2 +++ b/indra/newview/skins/default/xui/en/notifications.xml	Thu Mar 01 14:33:47 2018 -0800
    77.3 @@ -5928,7 +5928,7 @@
    77.4     icon="alertmodal.tga"
    77.5     name="ConfirmEmptyTrash"
    77.6     type="alertmodal">
    77.7 -[COUNT] items will be permanently deleted. Are you sure you want to permanently delete the contents of your Trash?
    77.8 +[COUNT] items and folders will be permanently deleted. Are you sure you want to permanently delete the contents of your Trash?
    77.9      <tag>confirm</tag>
   77.10      <usetemplate
   77.11       name="okcancelbuttons"
    78.1 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml	Thu Mar 01 09:34:25 2018 -0800
    78.2 +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml	Thu Mar 01 14:33:47 2018 -0800
    78.3 @@ -13,26 +13,27 @@
    78.4    </panel.string>
    78.5    <panel.string
    78.6     name="ItemcountFetching">
    78.7 -    Fetching [ITEM_COUNT] Items... [FILTER]
    78.8 +    Fetching [ITEM_COUNT] Items and [CATEGORY_COUNT] Folders... [FILTER]
    78.9    </panel.string>
   78.10    <panel.string
   78.11     name="ItemcountCompleted">
   78.12 -    [ITEM_COUNT] Items [FILTER]
   78.13 +    [ITEM_COUNT] Items and [CATEGORY_COUNT] Folders [FILTER]
   78.14    </panel.string>
   78.15    <panel.string
   78.16     name="ItemcountUnknown">
   78.17 -    Fetched [ITEM_COUNT] Items [FILTER]
   78.18 +    Fetched [ITEM_COUNT] Items and [CATEGORY_COUNT] Folders [FILTER]
   78.19    </panel.string>
   78.20    <text
   78.21  		     type="string"
   78.22  		     length="1"
   78.23 -		     follows="left|top"
   78.24 +		     follows="left|top|right"
   78.25  		     height="13"
   78.26  		     layout="topleft"
   78.27      		 left="12"
   78.28  		     name="ItemcountText"
   78.29  		     font="SansSerifMedium"
   78.30  		     text_color="EmphasisColor"
   78.31 +		     use_ellipses="true"
   78.32  		     top_pad="0"
   78.33  		     width="300">
   78.34      Items:
    79.1 --- a/indra/newview/skins/default/xui/en/panel_notification.xml	Thu Mar 01 09:34:25 2018 -0800
    79.2 +++ b/indra/newview/skins/default/xui/en/panel_notification.xml	Thu Mar 01 14:33:47 2018 -0800
    79.3 @@ -71,7 +71,6 @@
    79.4        mouse_opaque="false"
    79.5        name="text_editor_box"
    79.6        read_only="true"
    79.7 -      tab_stop="false"
    79.8        text_color="White"
    79.9        text_readonly_color="White"
   79.10        top="10"
    80.1 --- a/indra/newview/skins/default/xui/en/strings.xml	Thu Mar 01 09:34:25 2018 -0800
    80.2 +++ b/indra/newview/skins/default/xui/en/strings.xml	Thu Mar 01 14:33:47 2018 -0800
    80.3 @@ -2329,7 +2329,7 @@
    80.4  	<string name="InventoryMarketplaceListingsNoItems">
    80.5          Drag folders to this area to list them for sale on the [[MARKETPLACE_DASHBOARD_URL] Marketplace].
    80.6  	</string>
    80.7 -
    80.8 +	<string name="InventoryItemsCount">( [ITEMS_COUNT] Items )</string>
    80.9  	<string name="Marketplace Validation Log"></string>
   80.10  	<string name="Marketplace Validation Warning Stock">stock folder must be contained by a version folder</string>
   80.11  	<string name="Marketplace Validation Error Mixed Stock">: Error: all items in a stock folder must be no-copy and of the same type</string>

mercurial