diff --git a/autobuild.xml b/autobuild.xml
index 6209de299485147965a8d13496f0c4636cedb936..13c9e7ec35cc6f91dd67220f47c25001ecfda5a3 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -384,11 +384,11 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>f6835c4d7745cd1cadfbce47b40331d08affb532</string>
+              <string>e03eb77224290c875ff84f75b7fe3d0e7c162c94</string>
               <key>hash_algorithm</key>
               <string>sha1</string>
               <key>url</key>
-              <string>https://github.com/secondlife/3p-dictionaries/releases/download/v1.0.1-dev2.gf887629-f887629/dictionaries-common-None.tar.zst</string>
+              <string>https://github.com/secondlife/3p-dictionaries/releases/download/v1-a01bb6c/dictionaries-1.a01bb6c-common-a01bb6c.tar.zst</string>
             </map>
             <key>name</key>
             <string>common</string>
@@ -401,7 +401,7 @@
         <key>copyright</key>
         <string>Copyright 2014 Apache OpenOffice software</string>
         <key>version</key>
-        <string>None</string>
+        <string>1.a01bb6c</string>
         <key>name</key>
         <string>dictionaries</string>
         <key>description</key>
@@ -568,11 +568,11 @@
               <key>creds</key>
               <string>github</string>
               <key>hash</key>
-              <string>fb6797ff93b6e881b060d2a8b396d8d7477834ee</string>
+              <string>a2074b67de7ad4c04b5ca8f8f161506add9697b2</string>
               <key>hash_algorithm</key>
               <string>sha1</string>
               <key>url</key>
-              <string>https://api.github.com/repos/secondlife/3p-fmodstudio/releases/assets/108908444</string>
+              <string>https://api.github.com/repos/secondlife/3p-fmodstudio/releases/assets/149207589</string>
             </map>
             <key>name</key>
             <string>darwin64</string>
@@ -584,11 +584,11 @@
               <key>creds</key>
               <string>github</string>
               <key>hash</key>
-              <string>a378bd1604aa97ca763140911f9f4e463ced85c0</string>
+              <string>8c1b701648c077220dbc576c3d9aefbef47f8324</string>
               <key>hash_algorithm</key>
               <string>sha1</string>
               <key>url</key>
-              <string>https://api.github.com/repos/secondlife/3p-fmodstudio/releases/assets/108908446</string>
+              <string>https://api.github.com/repos/secondlife/3p-fmodstudio/releases/assets/149207592</string>
             </map>
             <key>name</key>
             <string>linux64</string>
@@ -600,11 +600,11 @@
               <key>creds</key>
               <string>github</string>
               <key>hash</key>
-              <string>72304491d86bd797b840999b255358f195b06609</string>
+              <string>7e0c3d50e8b99d8735c6c9596a72ded9ee2bc1c8</string>
               <key>hash_algorithm</key>
               <string>sha1</string>
               <key>url</key>
-              <string>https://api.github.com/repos/secondlife/3p-fmodstudio/releases/assets/108908456</string>
+              <string>https://api.github.com/repos/secondlife/3p-fmodstudio/releases/assets/149207594</string>
             </map>
             <key>name</key>
             <string>windows64</string>
@@ -617,7 +617,7 @@
         <key>copyright</key>
         <string>FMOD Studio by Firelight Technologies Pty Ltd.</string>
         <key>version</key>
-        <string>2.02.13.578928</string>
+        <string>2.02.20.c78ef55</string>
         <key>name</key>
         <string>fmodstudio</string>
         <key>description</key>
@@ -768,11 +768,11 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>6604c1cca515d287e697997a8d5593d1cae172a9</string>
+              <string>066625e7aa7f697a4b6cd461aad960c57181011f</string>
               <key>hash_algorithm</key>
               <string>sha1</string>
               <key>url</key>
-              <string>https://github.com/secondlife/3p-glh_linear/releases/download/v1.0.1-dev2.g3253ed7-3253ed7/glh_linear-common-None.tar.zst</string>
+              <string>https://github.com/secondlife/3p-glh_linear/releases/download/v1.0.1-dev4-984c397/glh_linear-1.0.1-dev4-common-984c397.tar.zst</string>
             </map>
             <key>name</key>
             <string>common</string>
@@ -785,7 +785,7 @@
         <key>copyright</key>
         <string>Copyright (c) 2000 Cass Everitt</string>
         <key>version</key>
-        <string>None</string>
+        <string>1.0.1-dev4</string>
         <key>name</key>
         <string>glh_linear</string>
         <key>description</key>
@@ -904,11 +904,11 @@
               <key>creds</key>
               <string>github</string>
               <key>hash</key>
-              <string>a193ff65d6db48626d65d96c6124c6efca85e8ec</string>
+              <string>ae2c2a215b1bc2e3f37a67e301926dc405902d1a</string>
               <key>hash_algorithm</key>
               <string>sha1</string>
               <key>url</key>
-              <string>https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/108912596</string>
+              <string>https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/136778143</string>
             </map>
             <key>name</key>
             <string>darwin64</string>
@@ -932,11 +932,11 @@
               <key>creds</key>
               <string>github</string>
               <key>hash</key>
-              <string>ebfb82b6143874e7938b9d1e8a70d0a2e28aa818</string>
+              <string>0393dd75c58f7046bed47e62a8884a78cb02a5c3</string>
               <key>hash_algorithm</key>
               <string>sha1</string>
               <key>url</key>
-              <string>https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/108912599</string>
+              <string>https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/136778145</string>
             </map>
             <key>name</key>
             <string>windows64</string>
@@ -1190,11 +1190,11 @@
               <key>creds</key>
               <string>github</string>
               <key>hash</key>
-              <string>bcc7e2c34896fc9cbc41828dee8a4ddf54f10453</string>
+              <string>ad72fa1d103df777906f0d98f3e882b9916aeada</string>
               <key>hash_algorithm</key>
               <string>sha1</string>
               <key>url</key>
-              <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/108298968</string>
+              <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/136774118</string>
             </map>
             <key>name</key>
             <string>darwin64</string>
@@ -1206,11 +1206,11 @@
               <key>creds</key>
               <string>github</string>
               <key>hash</key>
-              <string>9de772df2ed12e9c742df6c90670c7cbbb9c93a6</string>
+              <string>e46e4ac93a237b5c4a14183766f76ba5d58935a2</string>
               <key>hash_algorithm</key>
               <string>sha1</string>
               <key>url</key>
-              <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/108298969</string>
+              <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/136774125</string>
             </map>
             <key>name</key>
             <string>linux64</string>
@@ -1222,15 +1222,31 @@
               <key>creds</key>
               <string>github</string>
               <key>hash</key>
-              <string>92533ff0f8c1881ad85e75800f9072c413ccf7b7</string>
+              <string>bb37557f78c72b26580a521f8b8dabfa1b34e6e6</string>
               <key>hash_algorithm</key>
               <string>sha1</string>
               <key>url</key>
-              <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/108298970</string>
+              <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/136774126</string>
             </map>
             <key>name</key>
             <string>windows64</string>
           </map>
+          <key>linux</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>creds</key>
+              <string>github</string>
+              <key>hash</key>
+              <string>711b82f9f588d3a125af7dcd8c81f93d9c343a7d</string>
+              <key>hash_algorithm</key>
+              <string>sha1</string>
+              <key>url</key>
+              <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/136774121</string>
+            </map>
+            <key>name</key>
+            <string>linux</string>
+          </map>
         </map>
         <key>license</key>
         <string>Kakadu</string>
@@ -1239,7 +1255,7 @@
         <key>copyright</key>
         <string>Kakadu software</string>
         <key>version</key>
-        <string>7.10.4.539108</string>
+        <string>7.10.4.4b9ec5f</string>
         <key>name</key>
         <string>kdu</string>
         <key>description</key>
@@ -1531,6 +1547,15 @@
       </map>
       <key>llca</key>
       <map>
+        <key>copyright</key>
+        <string>Copyright (c) 2016, Linden Research, Inc.; data provided by the Mozilla NSS Project.
+      </string>
+        <key>license</key>
+        <string>mit</string>
+        <key>license_file</key>
+        <string>LICENSES/ca-license.txt</string>
+        <key>name</key>
+        <string>llca</string>
         <key>platforms</key>
         <map>
           <key>common</key>
@@ -1538,27 +1563,18 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>3a3e14563cd5fc019c3f139b82aa46ec79847709</string>
+              <string>a9503e1b4e1d9790cf29d18a3d9ab39e6a515679</string>
               <key>hash_algorithm</key>
               <string>sha1</string>
               <key>url</key>
-              <string>https://github.com/secondlife/llca/releases/download/v202312051403.17-0f5d9c3/llca-202312051404.0-common-0f5d9c3.tar.zst</string>
+              <string>https://github.com/secondlife/llca/releases/download/v202402012004.0-0f5d9c3/llca-202402012004.0-common-0f5d9c3.tar.zst</string>
             </map>
             <key>name</key>
             <string>common</string>
           </map>
         </map>
-        <key>license</key>
-        <string>mit</string>
-        <key>license_file</key>
-        <string>LICENSES/ca-license.txt</string>
-        <key>copyright</key>
-        <string>Copyright (c) 2016, Linden Research, Inc.; data provided by the Mozilla NSS Project.
-      </string>
         <key>version</key>
-        <string>202312051404.0</string>
-        <key>name</key>
-        <string>llca</string>
+        <string>202402012004.0</string>
       </map>
       <key>llphysicsextensions_source</key>
       <map>
diff --git a/doc/contributions.txt b/doc/contributions.txt
index 5db05c872060f208307744dce1f23bb5e570d0ea..a14ffa24fd177e436dcd5a270019d7472f1a1c20 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -64,6 +64,8 @@ Aimee Trescothick
 	VWR-14711
 	VWR-14712
 	VWR-15454
+AiraYumi
+	SL-20781 (github PR #613)
 Alejandro Rosenthal
 	VWR-1184
 Aleric Inglewood
@@ -847,6 +849,7 @@ Kadah Coba
 Jondan Lundquist
 Joosten Briebers
     MAINT-7074
+    BUG-225288
 Josef Munster
 Josette Windlow
 Juilan Tripsa
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index 18b03c1f8964df361db625645e72e3d0685a6467..b430c4c6aaf9f81c24c5825d127fb98786078565 100644
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -24,12 +24,6 @@
  * $/LicenseInfo$
  */
 
-#if LL_MSVC
-// disable warning about boost::lexical_cast returning uninitialized data
-// when it fails to parse the string
-#pragma warning (disable:4701)
-#endif
-
 #include "linden_common.h"
 
 #include "llavatarappearance.h"
@@ -46,14 +40,6 @@
 #include "boost/bind.hpp"
 #include "boost/tokenizer.hpp"
 
-
-#if LL_MSVC
-// disable boost::lexical_cast warning
-#pragma warning (disable:4702)
-#endif
-
-#include <boost/lexical_cast.hpp>
-
 using namespace LLAvatarAppearanceDefines;
 
 //-----------------------------------------------------------------------------
@@ -230,7 +216,7 @@ void LLAvatarAppearance::initInstance()
 		for (U32 lod = 0; lod < mesh_dict->mLOD; lod++)
 		{
 			LLAvatarJointMesh* mesh = createAvatarJointMesh();
-			std::string mesh_name = "m" + mesh_dict->mName + boost::lexical_cast<std::string>(lod);
+			std::string mesh_name = "m" + mesh_dict->mName + std::to_string(lod);
 			// We pre-pended an m - need to capitalize first character for camelCase
 			mesh_name[1] = toupper(mesh_name[1]);
 			mesh->setName(mesh_name);
diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp
index a387bb23cd6a604edb3e03b103acbcb46188edfb..ece0a12a7a157146a5b9d40134dcb9cf2b038420 100644
--- a/indra/llaudio/llaudioengine.cpp
+++ b/indra/llaudio/llaudioengine.cpp
@@ -398,7 +398,7 @@ void LLAudioEngine::idle()
 	for (source_map::value_type& src_pair : mAllSources)
 	{
 		LLAudioSource *sourcep = src_pair.second;
-		if (sourcep->isMuted() && sourcep->isSyncMaster() && sourcep->getPriority() > max_sm_priority)
+		if (!sourcep->isMuted() && sourcep->isSyncMaster() && sourcep->getPriority() > max_sm_priority)
 		{
 			sync_masterp = sourcep;
 			master_channelp = sync_masterp->getChannel();
diff --git a/indra/llcommon/lldoubledispatch.h b/indra/llcommon/lldoubledispatch.h
index 8ed295b6f133dc72190ba675df603db92fee6b57..ce6731e86463f3784fbdde6505d68201639df58f 100644
--- a/indra/llcommon/lldoubledispatch.h
+++ b/indra/llcommon/lldoubledispatch.h
@@ -255,7 +255,7 @@ class LLDoubleDispatch
     };
 
     /// shared_ptr manages Entry lifespan for us
-    typedef boost::shared_ptr<EntryBase> EntryPtr;
+    typedef std::shared_ptr<EntryBase> EntryPtr;
     /// use a @c list to make it easy to insert
     typedef std::list<EntryPtr> DispatchTable;
     DispatchTable mDispatch;
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index 3de641fcba6d2fc04d9d8637aa5176bb11f75d09..0f48ce16b2f747f9c1dbead3d44579283cf20303 100644
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -1070,7 +1070,7 @@ namespace LLError
     //
     // NOTE!!! Requires external mutex lock!!!
     template <typename RECORDER>
-    std::pair<boost::shared_ptr<RECORDER>, Recorders::iterator>
+    std::pair<std::shared_ptr<RECORDER>, Recorders::iterator>
     findRecorderPos(SettingsConfigPtr &s)
     {
         // Since we promise to return an iterator, use a classic iterator
@@ -1081,7 +1081,7 @@ namespace LLError
             // *it is a RecorderPtr, a shared_ptr<Recorder>. Use a
             // dynamic_pointer_cast to try to downcast to test if it's also a
             // shared_ptr<RECORDER>.
-            auto ptr = boost::dynamic_pointer_cast<RECORDER>(*it);
+            auto ptr = std::dynamic_pointer_cast<RECORDER>(*it);
             if (ptr)
             {
                 // found the entry we want
@@ -1101,7 +1101,7 @@ namespace LLError
     // shared_ptr might be empty (operator!() returns true) if there was no
     // such RECORDER subclass instance in mRecorders.
     template <typename RECORDER>
-    boost::shared_ptr<RECORDER> findRecorder()
+    std::shared_ptr<RECORDER> findRecorder()
     {
         SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig();
         LLMutexLock lock(&s->mRecorderMutex);
@@ -1134,7 +1134,7 @@ namespace LLError
 
 		if (!file_name.empty())
 		{
-			boost::shared_ptr<RecordToFile> recordToFile(new RecordToFile(file_name));
+			std::shared_ptr<RecordToFile> recordToFile(new RecordToFile(file_name));
 			if (recordToFile->okay())
 			{
 				addRecorder(recordToFile);
diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h
index 57f10b78950e7d7f9a8455ac180377e527241a76..77b187a80fe2608e22eb46ebb8a43783740bd3d2 100644
--- a/indra/llcommon/llerrorcontrol.h
+++ b/indra/llcommon/llerrorcontrol.h
@@ -174,7 +174,7 @@ namespace LLError
 		bool mWantsMultiline;
 	};
 
-	typedef boost::shared_ptr<Recorder> RecorderPtr;
+	typedef std::shared_ptr<Recorder> RecorderPtr;
 
     /**
      * Instantiate GenericRecorder with a callable(level, message) to get
diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp
index 1a305ec3dc453de445f2d00dbf9ac9c1eb5635a9..70931f3a657d020d6a54e1c61ee449a2cd1cb293 100644
--- a/indra/llcommon/llevents.cpp
+++ b/indra/llcommon/llevents.cpp
@@ -211,12 +211,21 @@ void LLEventPumps::clear()
     }
 }
 
-void LLEventPumps::reset()
+void LLEventPumps::reset(bool log_pumps)
 {
     // Reset every known LLEventPump instance. Leave it up to each instance to
     // decide what to do with the reset() call.
+    if (log_pumps)
+    {
+        LL_INFOS() << "Resetting " << (S32)mPumpMap.size() << " pumps" << LL_ENDL;
+    }
+
     for (PumpMap::value_type& pair : mPumpMap)
     {
+        if (log_pumps)
+        {
+            LL_INFOS() << "Resetting pump " << pair.first << LL_ENDL;
+        }
         pair.second->reset();
     }
 }
@@ -373,9 +382,11 @@ std::string LLEventPump::inventName(const std::string& pfx)
 
 void LLEventPump::clear()
 {
+    LLMutexLock lock(&mConnectionListMutex);
     // Destroy the original LLStandardSignal instance, replacing it with a
     // whole new one.
     mSignal = std::make_shared<LLStandardSignal>();
+
     mConnections.clear();
 }
 
@@ -383,6 +394,7 @@ void LLEventPump::reset()
 {
     // Resetting mSignal is supposed to disconnect everything on its own
     // But due to crash on 'reset' added explicit cleanup to get more data
+    LLMutexLock lock(&mConnectionListMutex);
     ConnectionMap::const_iterator iter = mConnections.begin();
     ConnectionMap::const_iterator end = mConnections.end();
     while (iter!=end)
@@ -407,6 +419,8 @@ LLBoundListener LLEventPump::listen_impl(const std::string& name, const LLEventL
         return LLBoundListener();
     }
 
+    LLMutexLock lock(&mConnectionListMutex);
+
     float nodePosition = 1.0;
 
     // if the supplied name is empty we are not interested in the ordering mechanism 
@@ -566,8 +580,9 @@ LLBoundListener LLEventPump::listen_impl(const std::string& name, const LLEventL
     return bound;
 }
 
-LLBoundListener LLEventPump::getListener(const std::string& name) const
+LLBoundListener LLEventPump::getListener(const std::string& name)
 {
+    LLMutexLock lock(&mConnectionListMutex);
     ConnectionMap::const_iterator found = mConnections.find(name);
     if (found != mConnections.end())
     {
@@ -579,6 +594,7 @@ LLBoundListener LLEventPump::getListener(const std::string& name) const
 
 void LLEventPump::stopListening(const std::string& name)
 {
+    LLMutexLock lock(&mConnectionListMutex);
     ConnectionMap::iterator found = mConnections.find(name);
     if (found != mConnections.end())
     {
diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h
index c1dbf4392f730fa1dc29b8d117bfebb6cd65233f..bebcfacdcbfc7514c98b0ade1f0682b90c7df113 100644
--- a/indra/llcommon/llevents.h
+++ b/indra/llcommon/llevents.h
@@ -332,7 +332,7 @@ class LL_COMMON_API LLEventPumps: public LLSingleton<LLEventPumps>,
      * Reset all known LLEventPump instances
      * workaround for DEV-35406 crash on shutdown
      */
-    void reset();
+    void reset(bool log_pumps = false);
 
 private:
     friend class LLEventPump;
@@ -558,7 +558,7 @@ class LL_COMMON_API LLEventPump: public LLEventTrackable
 
     /// Get the LLBoundListener associated with the passed name (dummy
     /// LLBoundListener if not found)
-    virtual LLBoundListener getListener(const std::string& name) const;
+    virtual LLBoundListener getListener(const std::string& name);
     /**
      * Instantiate one of these to block an existing connection:
      * @code
@@ -601,6 +601,7 @@ class LL_COMMON_API LLEventPump: public LLEventTrackable
     LLHandle<LLEventPumps> mRegistry;
 
     std::string mName;
+    LLMutex mConnectionListMutex;
 
 protected:
     virtual LLBoundListener listen_impl(const std::string& name, const LLEventListener&,
diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h
index 9edc7e40f36b5e8e28c2ad8efdc6ea0810909f55..e0d0ab9ac73bb4ea0f9b1fea463a01c7da0149f3 100644
--- a/indra/llcommon/llinitparam.h
+++ b/indra/llcommon/llinitparam.h
@@ -627,7 +627,7 @@ namespace LLInitParam
 		UserData*			mUserData;
 	};
 
-	typedef boost::shared_ptr<ParamDescriptor> ParamDescriptorPtr;
+	typedef std::shared_ptr<ParamDescriptor> ParamDescriptorPtr;
 
 	// each derived Block class keeps a static data structure maintaining offsets to various params
 	class LL_COMMON_API BlockDescriptor
diff --git a/indra/llcommon/llleap.cpp b/indra/llcommon/llleap.cpp
index 8f88e728ce8f2a6ecaf3abb6912581c2abd3e576..b2b1162f635561bacd3f905a44e0097a8ab337de 100644
--- a/indra/llcommon/llleap.cpp
+++ b/indra/llcommon/llleap.cpp
@@ -462,10 +462,10 @@ class LLLeapImpl: public LLLeap
     LLProcessPtr mChild;
     LLTempBoundListener
         mStdinConnection, mStdoutConnection, mStdoutDataConnection, mStderrConnection;
-    boost::scoped_ptr<LLEventPump::Blocker> mBlocker;
+    std::unique_ptr<LLEventPump::Blocker> mBlocker;
     LLProcess::ReadPipe::size_type mExpect;
     LLError::RecorderPtr mRecorder;
-    boost::scoped_ptr<LLLeapListener> mListener;
+    std::unique_ptr<LLLeapListener> mListener;
 };
 
 // These must follow the declaration of LLLeapImpl, so they may as well be last.
diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp
index 7cdf7254ffaebeaf5ad89e870e47820af0213428..574b9b8b3b3b997115b5ed19ccc50bc6214d79e9 100644
--- a/indra/llcommon/llmemory.cpp
+++ b/indra/llcommon/llmemory.cpp
@@ -38,6 +38,7 @@
 #include <mach/mach_host.h>
 #elif LL_LINUX
 # include <unistd.h>
+# include <sys/resource.h>
 #endif
 
 #include "llmemory.h"
@@ -273,33 +274,16 @@ U64 LLMemory::getCurrentRSS()
 
 U64 LLMemory::getCurrentRSS()
 {
-	static const char statPath[] = "/proc/self/stat";
-	LLFILE *fp = LLFile::fopen(statPath, "r");
-	U64 rss = 0;
+	struct rusage usage;
 
-	if (fp == NULL)
-	{
-		LL_WARNS() << "couldn't open " << statPath << LL_ENDL;
+	if (getrusage(RUSAGE_SELF, &usage) != 0) {
+		// Error handling code could be here
 		return 0;
 	}
 
-	// Eee-yew!	 See Documentation/filesystems/proc.txt in your
-	// nearest friendly kernel tree for details.
-	
-	{
-		int ret = fscanf(fp, "%*d (%*[^)]) %*c %*d %*d %*d %*d %*d %*d %*d "
-						 "%*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %Lu",
-						 &rss);
-		if (ret != 1)
-		{
-			LL_WARNS() << "couldn't parse contents of " << statPath << LL_ENDL;
-			rss = 0;
-		}
-	}
-	
-	fclose(fp);
-
-	return rss;
+	// ru_maxrss (since Linux 2.6.32)
+	// This is the maximum resident set size used (in kilobytes).
+	return usage.ru_maxrss * 1024;
 }
 
 #else
diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp
index 0d657622844eb3155076e9c73118f7d4da88e410..0d6a147da3b43f1d911557f5f456c4382ea1e81e 100644
--- a/indra/llcommon/llprocess.cpp
+++ b/indra/llcommon/llprocess.cpp
@@ -36,7 +36,6 @@
 #include "llevents.h"
 #include "llexception.h"
 
-#include <boost/foreach.hpp>
 #include <boost/bind.hpp>
 #include <boost/asio/streambuf.hpp>
 #include <boost/asio/buffers_iterator.hpp>
@@ -587,7 +586,7 @@ LLProcess::LLProcess(const LLSDOrParams& params):
 	// apr_procattr_child_err_set()), or accepting a filename, opening it and
 	// passing that apr_file_t (simple <, >, 2> redirect emulation).
 	std::vector<apr_int32_t> select;
-	BOOST_FOREACH(const FileParam& fparam, params.files)
+	for (const FileParam& fparam : params.files)
 	{
 		// Every iteration, we're going to append an item to 'select'. At the
 		// top of the loop, its size() is, in effect, an index. Use that to
@@ -684,7 +683,7 @@ LLProcess::LLProcess(const LLSDOrParams& params):
 	argv.push_back(params.executable().c_str());
 
 	// Add arguments. See above remarks about c_str().
-	BOOST_FOREACH(const std::string& arg, params.args)
+	for (const std::string& arg : params.args)
 	{
 		argv.push_back(arg.c_str());
 	}
@@ -961,7 +960,7 @@ void LLProcess::handle_status(int reason, int status)
 		// only be performed if in fact we're going to produce the log message.
 		LL_DEBUGS("LLProcess") << empty;
 		std::string reason_str;
-		BOOST_FOREACH(const ReasonCode& rcp, reasons)
+		for (const ReasonCode& rcp : reasons)
 		{
 			if (reason == rcp.code)
 			{
@@ -1151,7 +1150,7 @@ std::ostream& operator<<(std::ostream& out, const LLProcess::Params& params)
 		out << "cd " << LLStringUtil::quote(params.cwd) << ": ";
 	}
 	out << LLStringUtil::quote(params.executable);
-	BOOST_FOREACH(const std::string& arg, params.args)
+	for (const std::string& arg : params.args)
 	{
 		out << ' ' << LLStringUtil::quote(arg);
 	}
diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h
index 0842f2eb07ab3d34a1cbbbddbc419cec7e9f6cdd..c57821bf52ec849953e53790c1d204f967cc065a 100644
--- a/indra/llcommon/llprocess.h
+++ b/indra/llcommon/llprocess.h
@@ -51,7 +51,7 @@ class LLEventPump;
 class LLProcess;
 /// LLProcess instances are created on the heap by static factory methods and
 /// managed by ref-counted pointers.
-typedef boost::shared_ptr<LLProcess> LLProcessPtr;
+typedef std::shared_ptr<LLProcess> LLProcessPtr;
 
 /**
  * LLProcess handles launching an external process with specified command line
diff --git a/indra/llcommon/llrun.h b/indra/llcommon/llrun.h
index d610f86234f63f6c256d208ff7cd2a529e5f4a3d..42e3d9b47a8abd189344e450a621cd9242310839 100644
--- a/indra/llcommon/llrun.h
+++ b/indra/llcommon/llrun.h
@@ -48,7 +48,7 @@ class LL_COMMON_API LLRunner
 	/**
 	 * @brief The pointer to a runnable.
 	 */
-	typedef boost::shared_ptr<LLRunnable> run_ptr_t;
+	typedef std::shared_ptr<LLRunnable> run_ptr_t;
 
 	/**
 	 * @brief The handle for use in the API.
diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h
index ad54d1b0be6c3c4c962826d11f25c46666a39cbd..fdcc052bd03c505b5fc1ddc2727de490f471a71a 100644
--- a/indra/llcommon/llsdutil.h
+++ b/indra/llcommon/llsdutil.h
@@ -478,9 +478,9 @@ namespace llsd
 {
 
 /*****************************************************************************
-*   BOOST_FOREACH() helpers for LLSD
+*   range-based for-loop helpers for LLSD
 *****************************************************************************/
-/// Usage: BOOST_FOREACH(LLSD item, inArray(someLLSDarray)) { ... }
+/// Usage: for (LLSD item : inArray(someLLSDarray)) { ... }
 class inArray
 {
 public:
@@ -503,7 +503,7 @@ class inArray
 /// MapEntry is what you get from dereferencing an LLSD::map_[const_]iterator.
 typedef std::map<LLSD::String, LLSD>::value_type MapEntry;
 
-/// Usage: BOOST_FOREACH([const] MapEntry& e, inMap(someLLSDmap)) { ... }
+/// Usage: for([const] MapEntry& e : inMap(someLLSDmap)) { ... }
 class inMap
 {
 public:
diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp
index 6b1986d0e9191d8702a920e7b6bf26e5d0e6e522..5f1a89670e5606c043f54463d25b366cd993f7bf 100644
--- a/indra/llcommon/llsingleton.cpp
+++ b/indra/llcommon/llsingleton.cpp
@@ -32,7 +32,6 @@
 #include "lldependencies.h"
 #include "llexception.h"
 #include "llcoros.h"
-#include <boost/foreach.hpp>
 #include <algorithm>
 #include <iostream>                 // std::cerr in dire emergency
 #include <sstream>
@@ -411,7 +410,7 @@ void LLSingletonBase::cleanup_()
 void LLSingletonBase::deleteAll()
 {
     // It's essential to traverse these in dependency order.
-    BOOST_FOREACH(LLSingletonBase* sp, dep_sort())
+    for (LLSingletonBase* sp : dep_sort())
     {
         // Capture the class name first: in case of exception, don't count on
         // being able to extract it later.
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index bfbf25d9abb23d93a9e3db62aaf1ec545348b4bc..be00aa277b69cf4097fd1d031b55fa80a97bc6a3 100644
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -1208,7 +1208,7 @@ void LLStringUtilBase<T>::getTokens(const string_type& string, std::vector<strin
 {
 	// This overload must deal with escapes. Delegate that to InEscString
 	// (unless there ARE no escapes).
-	boost::scoped_ptr< LLStringUtilBaseImpl::InString<T> > instrp;
+	std::unique_ptr< LLStringUtilBaseImpl::InString<T> > instrp;
 	if (escapes.empty())
 		instrp.reset(new LLStringUtilBaseImpl::InString<T>(string.begin(), string.end()));
 	else
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 2bf12fb0eb13f83fd87ebe5599d8f411bd422875..42400e90af0f56216cd468054319ed92bab2a235 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -49,7 +49,6 @@
 #include "llsdutil.h"
 #include <boost/bind.hpp>
 #include <boost/circular_buffer.hpp>
-#include <boost/foreach.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/range.hpp>
 #include <boost/utility/enable_if.hpp>
@@ -905,9 +904,9 @@ void LLMemoryInfo::stream(std::ostream& s) const
 
 	// Max key length
 	size_t key_width(0);
-	BOOST_FOREACH(const MapEntry& pair, inMap(mStatsMap))
+	for (const auto& [key, value] : inMap(mStatsMap))
 	{
-		size_t len(pair.first.length());
+		size_t len(key.length());
 		if (len > key_width)
 		{
 			key_width = len;
@@ -915,10 +914,9 @@ void LLMemoryInfo::stream(std::ostream& s) const
 	}
 
 	// Now stream stats
-	BOOST_FOREACH(const MapEntry& pair, inMap(mStatsMap))
+	for (const auto& [key, value] : inMap(mStatsMap))
 	{
-		s << pfx << std::setw(narrow<size_t>(key_width+1)) << (pair.first + ':') << ' ';
-		LLSD value(pair.second);
+		s << pfx << std::setw(narrow<size_t>(key_width+1)) << (key + ':') << ' ';
 		if (value.isInteger())
 			s << std::setw(12) << value.asInteger();
 		else if (value.isReal())
diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp
index 148c18aabea3c82c826d5585d50259c4ed8a1b9e..b4cdbdc6bf1cd3659b9a317dbabee0afcb1cf40b 100644
--- a/indra/llcommon/tests/llerror_test.cpp
+++ b/indra/llcommon/tests/llerror_test.cpp
@@ -153,27 +153,27 @@ namespace tut
 
 		int countMessages()
 		{
-			return boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->countMessages();
+			return std::dynamic_pointer_cast<TestRecorder>(mRecorder)->countMessages();
 		}
 
 		void clearMessages()
 		{
-			boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->clearMessages();
+			std::dynamic_pointer_cast<TestRecorder>(mRecorder)->clearMessages();
 		}
 
 		void setWantsTime(bool t)
             {
-                boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->showTime(t);
+                std::dynamic_pointer_cast<TestRecorder>(mRecorder)->showTime(t);
             }
 
 		void setWantsMultiline(bool t)
             {
-                boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->showMultiline(t);
+                std::dynamic_pointer_cast<TestRecorder>(mRecorder)->showMultiline(t);
             }
 
 		std::string message(int n)
 		{
-			return boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->message(n);
+			return std::dynamic_pointer_cast<TestRecorder>(mRecorder)->message(n);
 		}
 
 		void ensure_message_count(int expectedCount)
@@ -497,12 +497,12 @@ namespace
 	void testLogName(LLError::RecorderPtr recorder, LogFromFunction f,
 		const std::string& class_name = "")
 	{
-		boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->clearMessages();
+		std::dynamic_pointer_cast<tut::TestRecorder>(recorder)->clearMessages();
 		std::string name = f(false);
 		f(true);
 
-		std::string messageWithoutName = boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(0);
-		std::string messageWithName = boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(1);
+		std::string messageWithoutName = std::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(0);
+		std::string messageWithName = std::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(1);
 
 		ensure_has(name + " logged without name",
 			messageWithoutName, name);
@@ -691,13 +691,13 @@ namespace tut
 		LL_INFOS() << "boo" << LL_ENDL;
 
 		ensure_message_field_equals(0, MSG_FIELD, "boo");
-		ensure_equals("alt recorder count", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 1);
-		ensure_contains("alt recorder message 0", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(0), "boo");
+		ensure_equals("alt recorder count", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 1);
+		ensure_contains("alt recorder message 0", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(0), "boo");
 
 		LLError::setTimeFunction(roswell);
 
 		LLError::RecorderPtr anotherRecorder(new TestRecorder());
-		boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->showTime(true);
+		std::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->showTime(true);
 		LLError::addRecorder(anotherRecorder);
 
 		LL_INFOS() << "baz" << LL_ENDL;
@@ -705,10 +705,10 @@ namespace tut
 		std::string when = roswell();
 
 		ensure_message_does_not_contain(1, when);
-		ensure_equals("alt recorder count", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 2);
-		ensure_does_not_contain("alt recorder message 1", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(1), when);
-		ensure_equals("another recorder count", boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->countMessages(), 1);
-		ensure_contains("another recorder message 0", boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->message(0), when);
+		ensure_equals("alt recorder count", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 2);
+		ensure_does_not_contain("alt recorder message 1", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(1), when);
+		ensure_equals("another recorder count", std::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->countMessages(), 1);
+		ensure_contains("another recorder message 0", std::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->message(0), when);
 
 		LLError::removeRecorder(altRecorder);
 		LLError::removeRecorder(anotherRecorder);
diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp
index 032923a1083e8a59940959f0e2e9a2192067f4e7..01104545c6108baa057e5941e3242b0b909ffa29 100644
--- a/indra/llcommon/tests/lleventcoro_test.cpp
+++ b/indra/llcommon/tests/lleventcoro_test.cpp
@@ -101,7 +101,7 @@ namespace tut
         int which;
         LLTestApp testApp;
 
-        void explicit_wait(boost::shared_ptr<LLCoros::Promise<std::string>>& cbp);
+        void explicit_wait(std::shared_ptr<LLCoros::Promise<std::string>>& cbp);
         void waitForEventOn1();
         void coroPump();
         void postAndWait1();
@@ -111,7 +111,7 @@ namespace tut
     typedef coroutine_group::object object;
     coroutine_group coroutinegrp("coroutine");
 
-    void test_data::explicit_wait(boost::shared_ptr<LLCoros::Promise<std::string>>& cbp)
+    void test_data::explicit_wait(std::shared_ptr<LLCoros::Promise<std::string>>& cbp)
     {
         BEGIN
         {
@@ -127,7 +127,7 @@ namespace tut
             // For test purposes, instead of handing 'callback' (or an
             // adapter) off to some I/O subsystem, we'll just pass it back to
             // our caller.
-            cbp = boost::make_shared<LLCoros::Promise<std::string>>();
+            cbp = std::make_shared<LLCoros::Promise<std::string>>();
             LLCoros::Future<std::string> future = LLCoros::getFuture(*cbp);
 
             // calling get() on the future causes us to suspend
@@ -146,7 +146,7 @@ namespace tut
         DEBUG;
 
         // Construct the coroutine instance that will run explicit_wait.
-        boost::shared_ptr<LLCoros::Promise<std::string>> respond;
+        std::shared_ptr<LLCoros::Promise<std::string>> respond;
         LLCoros::instance().launch("test<1>",
                                    [this, &respond](){ explicit_wait(respond); });
         mSync.bump();
diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp
index 5daa29adf44386ce3ee2ca3670e08ca012a3f37f..95af9c2a50db8f2e806e3301e7d474443f5c6359 100644
--- a/indra/llcommon/tests/llinstancetracker_test.cpp
+++ b/indra/llcommon/tests/llinstancetracker_test.cpp
@@ -94,7 +94,7 @@ namespace tut
             ensure("couldn't find stack Keyed", bool(found));
             ensure_equals("found wrong Keyed instance", found.get(), &one);
             {
-                boost::scoped_ptr<Keyed> two(new Keyed("two"));
+                std::unique_ptr<Keyed> two(new Keyed("two"));
                 ensure_equals(Keyed::instanceCount(), 2);
                 auto found = Keyed::getInstance("two");
                 ensure("couldn't find heap Keyed", bool(found));
@@ -118,7 +118,7 @@ namespace tut
             std::weak_ptr<Unkeyed> found = one.getWeak();
             ensure(! found.expired());
             {
-                boost::scoped_ptr<Unkeyed> two(new Unkeyed);
+                std::unique_ptr<Unkeyed> two(new Unkeyed);
                 ensure_equals(Unkeyed::instanceCount(), 2);
             }
             ensure_equals(Unkeyed::instanceCount(), 1);
diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp
index b6b297b8d7bfafdfb790837b72345d7a55ba2a52..628f046f55d163d3088109a60a7487957b31af3d 100644
--- a/indra/llcommon/tests/llprocess_test.cpp
+++ b/indra/llcommon/tests/llprocess_test.cpp
@@ -21,7 +21,6 @@
 // external library headers
 #include "llapr.h"
 #include "apr_thread_proc.h"
-#include <boost/foreach.hpp>
 #include <boost/function.hpp>
 #include <boost/algorithm/string/find_iterator.hpp>
 #include <boost/algorithm/string/finder.hpp>
@@ -323,7 +322,7 @@ namespace tut
     {
 /*==========================================================================*|
         std::string reason_str;
-        BOOST_FOREACH(const ReasonCode& rcp, reasons)
+        for (const ReasonCode& rcp : reasons)
         {
             if (reason == rcp.code)
             {
@@ -554,7 +553,7 @@ namespace tut
         catch (const failure&)
         {
             std::cout << "History:\n";
-            BOOST_FOREACH(const Item& item, history)
+            for (const Item& item : history)
             {
                 std::string what(item.what);
                 if ((! what.empty()) && what[what.length() - 1] == '\n')
diff --git a/indra/llcommon/tests/llstreamqueue_test.cpp b/indra/llcommon/tests/llstreamqueue_test.cpp
index 050ad5c5bff287ddc7bdad0f7ed7f59997c9f123..8af057328b49a1a537641f9462b9b365c62ddff3 100644
--- a/indra/llcommon/tests/llstreamqueue_test.cpp
+++ b/indra/llcommon/tests/llstreamqueue_test.cpp
@@ -15,9 +15,6 @@
 #include "llstreamqueue.h"
 // STL headers
 #include <vector>
-// std headers
-// external library headers
-#include <boost/foreach.hpp>
 // other Linden headers
 #include "../test/lltut.h"
 #include "stringize.h"
@@ -133,7 +130,7 @@ namespace tut
         std::streamsize leave(5);   // len("craft") above
         std::streamsize skip(total - leave);
         std::streamsize written(0);
-        BOOST_FOREACH(const std::string& block, blocks)
+        for (const std::string& block : blocks)
         {
             written += strq.write(&block[0], block.length());
             ensure_equals("size() after write()", strq.size(), written);
@@ -152,7 +149,7 @@ namespace tut
     {
         set_test_name("concatenate blocks");
         std::string blocks[] = { "abcd", "efghij", "klmnopqrs" };
-        BOOST_FOREACH(const std::string& block, blocks)
+        for (const std::string& block : blocks)
         {
             strq.write(&block[0], block.length());
         }
@@ -170,7 +167,7 @@ namespace tut
     {
         set_test_name("split blocks");
         std::string blocks[] = { "abcdefghijklm", "nopqrstuvwxyz" };
-        BOOST_FOREACH(const std::string& block, blocks)
+        for (const std::string& block : blocks)
         {
             strq.write(&block[0], block.length());
         }
diff --git a/indra/llcommon/tests/lltreeiterators_test.cpp b/indra/llcommon/tests/lltreeiterators_test.cpp
index 1d619867d480c7f120788fe8a141f58b3ab655ab..b9c7a70c07b06b0ca4fba802e451e79e8a0df642 100644
--- a/indra/llcommon/tests/lltreeiterators_test.cpp
+++ b/indra/llcommon/tests/lltreeiterators_test.cpp
@@ -38,7 +38,6 @@
 // external library headers
 #include <boost/bind.hpp>
 #include <boost/range/iterator_range.hpp>
-#include <boost/foreach.hpp>
 
 // associated header
 #include "../lltreeiterators.h"
@@ -402,7 +401,7 @@ class TreeNode: public LLRefCount
  *
  * Example:
  * @code
- * BOOST_FOREACH(TreeNodePtr node, getRootRange<LLTreeIter::UP>(somenode))
+ * for (TreeNodePtr node : getRootRange<LLTreeIter::UP>(somenode))
  * {
  *     std::cout << node->name() << '\n';
  * }
@@ -424,7 +423,7 @@ getRootRange(const TreeNodePtr& node)
  *
  * Example:
  * @code
- * BOOST_FOREACH(TreeNodePtr node, getWalkRange<LLTreeIter::DFS_PRE>(root))
+ * for (TreeNodePtr node : getWalkRange<LLTreeIter::DFS_PRE>(root))
  * {
  *     std::cout << node->name() << '\n';
  * }
@@ -520,7 +519,7 @@ class EnhancedTreeNode: public LLRefCount
      *
      * Example usage:
      * @code
-     * BOOST_FOREACH(EnhancedTreeNodePtr node, somenode->getRootRange<LLTreeIter::UP>())
+     * for (EnhancedTreeNodePtr node : somenode->getRootRange<LLTreeIter::UP>())
      * {
      *     std::cout << node->name() << '\n';
      * }
@@ -564,7 +563,7 @@ class EnhancedTreeNode: public LLRefCount
      *
      * Example usage:
      * @code
-     * BOOST_FOREACH(EnhancedTreeNodePtr node, somenode->getWalkRange<LLTreeIter::DFS_PRE>())
+     * for (EnhancedTreeNodePtr node : somenode->getWalkRange<LLTreeIter::DFS_PRE>())
      * {
      *     std::cout << node->name() << '\n';
      * }
@@ -644,7 +643,7 @@ LLLinkedIter<PlainTree> PlainTree_child_end(PlainTree* node)
  *
  * Example:
  * @code
- * BOOST_FOREACH(PlainTree* node, getRootRange<LLTreeIter::UP>(somenode))
+ * for (PlainTree* node : getRootRange<LLTreeIter::UP>(somenode))
  * {
  *     std::cout << node->name() << '\n';
  * }
@@ -668,7 +667,7 @@ getRootRange(PlainTree* node)
  *
  * Example:
  * @code
- * BOOST_FOREACH(PlainTree* node, getWalkRange<LLTreeIter::DFS_PRE>(root))
+ * for (PlainTree* node : getWalkRange<LLTreeIter::DFS_PRE>(root))
  * {
  *     std::cout << node->name() << '\n';
  * }
@@ -1103,18 +1102,18 @@ namespace tut
         // This test function illustrates the looping techniques described in the
         // comments for the getRootRange() free function, the
         // EnhancedTreeNode::root_range template and the
-        // EnhancedTreeNode::getRootRange() method. Obviously the BOOST_FOREACH()
+        // EnhancedTreeNode::getRootRange() method. Obviously the for()
         // forms are more succinct.
         TreeNodePtr tnroot(example_tree<TreeNode>());
         TreeNodePtr tnB2b(get_B2b<TreeNode, TreeNode::child_iterator>
                           (tnroot, boost::bind(&TreeNode::child_begin, _1)));
     
-        std::string desc1("BOOST_FOREACH(TreeNodePr, getRootRange<LLTreeIter::UP>(tnB2b))");
+        std::string desc1("for (TreeNodePr : getRootRange<LLTreeIter::UP>(tnB2b))");
 //      std::cout << desc1 << "\n";
         // Although we've commented out the output statement, ensure that the
         // loop construct is still valid, as promised by the getRootRange()
         // documentation.
-        BOOST_FOREACH(TreeNodePtr node, getRootRange<LLTreeIter::UP>(tnB2b))
+        for (TreeNodePtr node : getRootRange<LLTreeIter::UP>(tnB2b))
         {
 //          std::cout << node->name() << '\n';
         }
@@ -1137,9 +1136,9 @@ namespace tut
 //          std::cout << (*ri)->name() << '\n';
         }
 
-        std::string desc2("BOOST_FOREACH(EnhancedTreeNodePtr node, etnB2b->getRootRange<LLTreeIter::UP>())");
+        std::string desc2("for (EnhancedTreeNodePtr node : etnB2b->getRootRange<LLTreeIter::UP>())");
 //      std::cout << desc2 << '\n';
-        BOOST_FOREACH(EnhancedTreeNodePtr node, etnB2b->getRootRange<LLTreeIter::UP>())
+        for (EnhancedTreeNodePtr node : etnB2b->getRootRange<LLTreeIter::UP>())
         {
 //          std::cout << node->name() << '\n';
         }
diff --git a/indra/llcommon/tests/wrapllerrs.h b/indra/llcommon/tests/wrapllerrs.h
index d657b329bbb182f1a44d71fc68793ae0a955d483..6978c296b39a3a1077fda95c6b9a62dbfd366bf6 100644
--- a/indra/llcommon/tests/wrapllerrs.h
+++ b/indra/llcommon/tests/wrapllerrs.h
@@ -218,12 +218,12 @@ class CaptureLog : public boost::noncopyable
     /// for the sought string.
     std::string messageWith(const std::string& search, bool required=true)
     {
-        return boost::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->messageWith(search, required);
+        return std::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->messageWith(search, required);
     }
 
     std::ostream& streamto(std::ostream& out) const
     {
-        return boost::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->streamto(out);
+        return std::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->streamto(out);
     }
 
     friend inline std::ostream& operator<<(std::ostream& out, const CaptureLog& self)
diff --git a/indra/llcorehttp/_httplibcurl.h b/indra/llcorehttp/_httplibcurl.h
index a71eae59c087eed0900f26046eb6165b4611c044..61ecc492af0b60cbebe1b8bb969f4c86c3a476cd 100644
--- a/indra/llcorehttp/_httplibcurl.h
+++ b/indra/llcorehttp/_httplibcurl.h
@@ -65,7 +65,7 @@ class HttpLibcurl
 	void operator=(const HttpLibcurl &);		// Not defined
 
 public:
-    typedef boost::shared_ptr<HttpOpRequest> opReqPtr_t;
+    typedef std::shared_ptr<HttpOpRequest> opReqPtr_t;
 
 	/// Give cycles to libcurl to run active requests.  Completed
 	/// operations (successful or failed) will be retried or handed
diff --git a/indra/llcorehttp/_httpoperation.cpp b/indra/llcorehttp/_httpoperation.cpp
index 3b6401813206824e5b74e7eb87f33e92d05d89b2..c3a9bcaf5463af3d1a67be1ace532c359aa8733a 100644
--- a/indra/llcorehttp/_httpoperation.cpp
+++ b/indra/llcorehttp/_httpoperation.cpp
@@ -58,7 +58,7 @@ HttpOperation::handleMap_t  HttpOperation::mHandleMap;
 LLCoreInt::HttpMutex	    HttpOperation::mOpMutex;
 
 HttpOperation::HttpOperation():
-    boost::enable_shared_from_this<HttpOperation>(),
+    std::enable_shared_from_this<HttpOperation>(),
     mReplyQueue(),
     mUserHandler(),
     mReqPolicy(HttpRequest::DEFAULT_POLICY_ID),
diff --git a/indra/llcorehttp/_httpoperation.h b/indra/llcorehttp/_httpoperation.h
index 8c1364bab4ef1a6e489dc6c15faca325f00bf7bb..b07ef76d495856b416fe4b918a8695c99fa7d54a 100644
--- a/indra/llcorehttp/_httpoperation.h
+++ b/indra/llcorehttp/_httpoperation.h
@@ -69,12 +69,12 @@ class HttpService;
 /// and those interfaces establish the access rules.
 
 class HttpOperation : private boost::noncopyable,
-    public boost::enable_shared_from_this<HttpOperation>
+    public std::enable_shared_from_this<HttpOperation>
 {
 public:
-    typedef boost::shared_ptr<HttpOperation> ptr_t;
-    typedef boost::weak_ptr<HttpOperation> wptr_t;
-    typedef boost::shared_ptr<HttpReplyQueue> HttpReplyQueuePtr_t;
+    typedef std::shared_ptr<HttpOperation> ptr_t;
+    typedef std::weak_ptr<HttpOperation> wptr_t;
+    typedef std::shared_ptr<HttpReplyQueue> HttpReplyQueuePtr_t;
 
 	/// Threading:  called by consumer thread.
 	HttpOperation();
@@ -157,12 +157,12 @@ class HttpOperation : private boost::noncopyable,
     HttpHandle getHandle();
 
     template< class OPT >
-    static boost::shared_ptr< OPT > fromHandle(HttpHandle handle)
+    static std::shared_ptr< OPT > fromHandle(HttpHandle handle)
     {
         ptr_t ptr = findByHandle(handle);
         if (!ptr)
-            return boost::shared_ptr< OPT >();
-        return boost::dynamic_pointer_cast< OPT >(ptr);
+            return std::shared_ptr< OPT >();
+        return std::dynamic_pointer_cast< OPT >(ptr);
     }
 	
 protected:
diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp
index d60eb6c95faff241ed8edfc33fbf62bf4398aaa2..324714621222c8f6ddcff6261d1b93d57f6866ac 100644
--- a/indra/llcorehttp/_httpoprequest.cpp
+++ b/indra/llcorehttp/_httpoprequest.cpp
@@ -201,7 +201,7 @@ HttpOpRequest::~HttpOpRequest()
 void HttpOpRequest::stageFromRequest(HttpService * service)
 {
     LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
-    HttpOpRequest::ptr_t self(boost::dynamic_pointer_cast<HttpOpRequest>(shared_from_this()));
+    HttpOpRequest::ptr_t self(std::dynamic_pointer_cast<HttpOpRequest>(shared_from_this()));
     service->getPolicy().addOp(self);			// transfers refcount
 }
 
@@ -209,7 +209,7 @@ void HttpOpRequest::stageFromRequest(HttpService * service)
 void HttpOpRequest::stageFromReady(HttpService * service)
 {
     LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
-    HttpOpRequest::ptr_t self(boost::dynamic_pointer_cast<HttpOpRequest>(shared_from_this()));
+    HttpOpRequest::ptr_t self(std::dynamic_pointer_cast<HttpOpRequest>(shared_from_this()));
     service->getTransport().addOp(self);		// transfers refcount
 }
 
@@ -290,7 +290,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request)
 // HttpOpRequest::ptr_t HttpOpRequest::fromHandle(HttpHandle handle)
 // {
 // 
-//     return boost::dynamic_pointer_cast<HttpOpRequest>((static_cast<HttpOpRequest *>(handle))->shared_from_this());
+//     return std::dynamic_pointer_cast<HttpOpRequest>((static_cast<HttpOpRequest *>(handle))->shared_from_this());
 // }
 
 
diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h
index ec84822cf46b085d12c5f2207b7c151197246b70..626064329d011b525fac470b000364dca3fdcd38 100644
--- a/indra/llcorehttp/_httpoprequest.h
+++ b/indra/llcorehttp/_httpoprequest.h
@@ -66,7 +66,7 @@ class BufferArray;
 class HttpOpRequest : public HttpOperation
 {
 public:
-    typedef boost::shared_ptr<HttpOpRequest> ptr_t;
+    typedef std::shared_ptr<HttpOpRequest> ptr_t;
 
 	HttpOpRequest();
 
diff --git a/indra/llcorehttp/_httpopsetget.h b/indra/llcorehttp/_httpopsetget.h
index eabd41e79f29496cd3f8fd886390042010cb17df..04ab2446ef1c6eac35f0a30d4716ad25f0d22699 100644
--- a/indra/llcorehttp/_httpopsetget.h
+++ b/indra/llcorehttp/_httpopsetget.h
@@ -53,7 +53,7 @@ namespace LLCore
 class HttpOpSetGet : public HttpOperation
 {
 public:
-    typedef boost::shared_ptr<HttpOpSetGet> ptr_t;
+    typedef std::shared_ptr<HttpOpSetGet> ptr_t;
 
 	HttpOpSetGet();
 
diff --git a/indra/llcorehttp/_httppolicy.h b/indra/llcorehttp/_httppolicy.h
index 0b8806a3e2f7be19fae4dd30b4bc7b32b043c060..955f757c938d0a134a6ed20773bb30dee8cb635a 100644
--- a/indra/llcorehttp/_httppolicy.h
+++ b/indra/llcorehttp/_httppolicy.h
@@ -60,7 +60,7 @@ class HttpPolicy
 	void operator=(const HttpPolicy &);			// Not defined
 
 public:
-    typedef boost::shared_ptr<HttpOpRequest> opReqPtr_t;
+    typedef std::shared_ptr<HttpOpRequest> opReqPtr_t;
 
 	/// Threading:  called by init thread.
 	HttpRequest::policy_t createPolicyClass();
diff --git a/indra/llcorehttp/_httpreplyqueue.h b/indra/llcorehttp/_httpreplyqueue.h
index 33e205c1c961092e347990b38b3e9d56d54bfb69..2de26249ef671b115cf5f909a3441e37d220e339 100644
--- a/indra/llcorehttp/_httpreplyqueue.h
+++ b/indra/llcorehttp/_httpreplyqueue.h
@@ -63,8 +63,8 @@ class HttpReplyQueue : private boost::noncopyable
 {
 
 public:
-    typedef boost::shared_ptr<HttpOperation>    opPtr_t;
-    typedef boost::shared_ptr<HttpReplyQueue>   ptr_t;
+    typedef std::shared_ptr<HttpOperation>    opPtr_t;
+    typedef std::shared_ptr<HttpReplyQueue>   ptr_t;
 
 	HttpReplyQueue();
     virtual ~HttpReplyQueue();		
diff --git a/indra/llcorehttp/_httprequestqueue.h b/indra/llcorehttp/_httprequestqueue.h
index f0296f30e38a0690123f71402055471875ff870c..52369df174bf1bfe535e6a7ab8ac68d7cdc0df66 100644
--- a/indra/llcorehttp/_httprequestqueue.h
+++ b/indra/llcorehttp/_httprequestqueue.h
@@ -61,7 +61,7 @@ class HttpRequestQueue : public LLCoreInt::RefCounted
 	void operator=(const HttpRequestQueue &);			// Not defined
 
 public:
-    typedef boost::shared_ptr<HttpOperation> opPtr_t;
+    typedef std::shared_ptr<HttpOperation> opPtr_t;
 
 	static void init();
 	static void term();
diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h
index 18505e0aad2aa56759be91f7ce747be7e809b11f..7fe5c48edfbf13421e2215967b93895b8d962cfb 100644
--- a/indra/llcorehttp/httpcommon.h
+++ b/indra/llcorehttp/httpcommon.h
@@ -301,24 +301,24 @@ struct HttpStatus
 	
 	HttpStatus()
 	{
-		mDetails = boost::shared_ptr<Details>(new Details(LLCORE, HE_SUCCESS));
+		mDetails = std::shared_ptr<Details>(new Details(LLCORE, HE_SUCCESS));
     }
 
 	HttpStatus(type_enum_t type, short status)
 	{
-        mDetails = boost::shared_ptr<Details>(new Details(type, status));
+        mDetails = std::shared_ptr<Details>(new Details(type, status));
 	}
 	
 	HttpStatus(int http_status)
 	{
-        mDetails = boost::shared_ptr<Details>(new Details(http_status, 
+        mDetails = std::shared_ptr<Details>(new Details(http_status, 
 			(http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR));
 		llassert(http_status >= 100 && http_status <= 999);
 	}
 
 	HttpStatus(int http_status, const std::string &message)
 	{
-        mDetails = boost::shared_ptr<Details>(new Details(http_status,
+        mDetails = std::shared_ptr<Details>(new Details(http_status,
 			(http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR));
 		llassert(http_status >= 100 && http_status <= 999);
 		mDetails->mMessage = message;
@@ -341,7 +341,7 @@ struct HttpStatus
 
     HttpStatus & clone(const HttpStatus &rhs)
     {
-        mDetails = boost::shared_ptr<Details>(new Details(*rhs.mDetails));
+        mDetails = std::shared_ptr<Details>(new Details(*rhs.mDetails));
         return *this;
     }
 	
@@ -490,14 +490,14 @@ struct HttpStatus
 		LLSD		mErrorData;
 	};
 
-    boost::shared_ptr<Details> mDetails;
+    std::shared_ptr<Details> mDetails;
 
 }; // end struct HttpStatus
 
 ///  A namespace for several free methods and low level utilities. 
 namespace LLHttp
 {
-    typedef boost::shared_ptr<CURL> CURL_ptr;
+    typedef std::shared_ptr<CURL> CURL_ptr;
 
     void initialize();
     void cleanup();
diff --git a/indra/llcorehttp/httphandler.h b/indra/llcorehttp/httphandler.h
index 65e043f5d3546baf4ce1cfefebfa2001eb220d62..4cfb2598c74b3ee8f4df46c56edd6ad061a85924 100644
--- a/indra/llcorehttp/httphandler.h
+++ b/indra/llcorehttp/httphandler.h
@@ -58,8 +58,8 @@ class HttpResponse;
 class HttpHandler 
 {
 public:
-    typedef boost::shared_ptr<HttpHandler>  ptr_t;
-    typedef boost::weak_ptr<HttpHandler>    wptr_t;
+    typedef std::shared_ptr<HttpHandler>  ptr_t;
+    typedef std::weak_ptr<HttpHandler>    wptr_t;
 
 	virtual ~HttpHandler()
 	{ }
diff --git a/indra/llcorehttp/httpheaders.h b/indra/llcorehttp/httpheaders.h
index b9168cb6ec86eff22e4e68eae33460cef2d4f8c9..e7cf4037bfffb3f585c60c4a48797117f223ab8b 100644
--- a/indra/llcorehttp/httpheaders.h
+++ b/indra/llcorehttp/httpheaders.h
@@ -85,7 +85,7 @@ class HttpHeaders: private boost::noncopyable
 	typedef container_t::const_reverse_iterator const_reverse_iterator;
 	typedef container_t::value_type value_type;
 	typedef container_t::size_type size_type;
-    typedef boost::shared_ptr<HttpHeaders> ptr_t;
+    typedef std::shared_ptr<HttpHeaders> ptr_t;
 
 public:
 	/// @post In addition to the instance, caller has a refcount
diff --git a/indra/llcorehttp/httpoptions.h b/indra/llcorehttp/httpoptions.h
index 41f71896b0294077ba77c79c1e3a1b7f5a01ad5c..fa993c857bd54bd218fdf697d7195b9fb5fbd8d7 100644
--- a/indra/llcorehttp/httpoptions.h
+++ b/indra/llcorehttp/httpoptions.h
@@ -60,7 +60,7 @@ class HttpOptions : private boost::noncopyable
 public:
 	HttpOptions();
 
-	typedef boost::shared_ptr<HttpOptions> ptr_t;
+	typedef std::shared_ptr<HttpOptions> ptr_t;
 
     virtual ~HttpOptions();						// Use release()
 
diff --git a/indra/llcorehttp/httprequest.h b/indra/llcorehttp/httprequest.h
index ca4b9e92bca1bd4a5913a1b6c01733538976477f..857a034a7b5dde0901bbea2a47aeb1b7d2e51350 100644
--- a/indra/llcorehttp/httprequest.h
+++ b/indra/llcorehttp/httprequest.h
@@ -96,8 +96,8 @@ class HttpRequest
 public:
 	typedef unsigned int policy_t;
 	
-	typedef boost::shared_ptr<HttpRequest> ptr_t;
-    typedef boost::weak_ptr<HttpRequest>   wptr_t;
+	typedef std::shared_ptr<HttpRequest> ptr_t;
+    typedef std::weak_ptr<HttpRequest>   wptr_t;
 public:
 	/// @name PolicyMethods
 	/// @{
@@ -627,7 +627,7 @@ class HttpRequest
 protected:
 
 private:
-    typedef boost::shared_ptr<HttpReplyQueue> HttpReplyQueuePtr_t;
+    typedef std::shared_ptr<HttpReplyQueue> HttpReplyQueuePtr_t;
 
 	/// @name InstanceData
 	///
diff --git a/indra/llcorehttp/httpresponse.h b/indra/llcorehttp/httpresponse.h
index b834085e5cb23b0ce08dce05587321454b42e724..ef98fbef2b5f2c51367aab1948be2d816f6a549a 100644
--- a/indra/llcorehttp/httpresponse.h
+++ b/indra/llcorehttp/httpresponse.h
@@ -72,7 +72,7 @@ class HttpResponse : public LLCoreInt::RefCounted
 	/// Statistics for the HTTP 
 	struct TransferStats
 	{
-		typedef boost::shared_ptr<TransferStats> ptr_t;
+		typedef std::shared_ptr<TransferStats> ptr_t;
 
 		TransferStats() : mSizeDownload(0.0), mTotalTime(0.0), mSpeedDownload(0.0) {}
 		F64 mSizeDownload;
diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp
index 69b23f9cf882c43afa137e919f2cc35a7b772f06..41fbb97175a9577b7148263fcd08a47f6443000f 100644
--- a/indra/llfilesystem/lldir.cpp
+++ b/indra/llfilesystem/lldir.cpp
@@ -44,7 +44,6 @@
 #include "stringize.h"
 #include "llstring.h"
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/range/begin.hpp>
 #include <boost/range/end.hpp>
 #include <boost/assign/list_of.hpp>
@@ -691,10 +690,10 @@ void LLDir::walkSearchSkinDirs(const std::string& subdir,
 							   const std::string& filename,
 							   const FUNCTION& function) const
 {
-	BOOST_FOREACH(std::string skindir, mSearchSkinDirs)
+	for (const std::string& skindir : mSearchSkinDirs)
 	{
 		std::string subdir_path(add(skindir, subdir));
-		BOOST_FOREACH(std::string subsubdir, subsubdirs)
+		for (const std::string& subsubdir : subsubdirs)
 		{
 			std::string full_path(add(subdir_path, subsubdir, filename));
 			if (fileExists(full_path))
@@ -843,7 +842,7 @@ std::vector<std::string> LLDir::findSkinnedFilenames(const std::string& subdir,
 		// current language, copy them -- in proper order -- into results.
 		// Don't drive this by walking the map itself: it matters that we
 		// generate results in the same order as subsubdirs.
-		BOOST_FOREACH(std::string subsubdir, subsubdirs)
+		for (const std::string& subsubdir : subsubdirs)
 		{
 			StringMap::const_iterator found(path_for.find(subsubdir));
 			if (found != path_for.end())
@@ -855,7 +854,7 @@ std::vector<std::string> LLDir::findSkinnedFilenames(const std::string& subdir,
 
 	LL_DEBUGS("LLDir") << empty;
 	const char* comma = "";
-	BOOST_FOREACH(std::string path, results)
+	for (const std::string& path : results)
 	{
 		LL_CONT << comma << "'" << path << "'";
 		comma = ", ";
diff --git a/indra/llfilesystem/tests/lldir_test.cpp b/indra/llfilesystem/tests/lldir_test.cpp
index 3cff622a4bac4091914f43a1220d4eb5d71f5a82..60265cade651a28a32e5675c31e01117934fbdd3 100644
--- a/indra/llfilesystem/tests/lldir_test.cpp
+++ b/indra/llfilesystem/tests/lldir_test.cpp
@@ -34,7 +34,6 @@
 
 #include "../test/lltut.h"
 #include "stringize.h"
-#include <boost/foreach.hpp>
 #include <boost/assign/list_of.hpp>
 
 using boost::assign::list_of;
@@ -109,7 +108,7 @@ struct LLDir_Dummy: public LLDir
 
             "install/skins/default/future/somefile.txt"
         };
-        BOOST_FOREACH(const char* path, preload)
+        for (const char* path : preload)
         {
             buildFilesystem(path);
         }
@@ -166,7 +165,7 @@ struct LLDir_Dummy: public LLDir
         LLStringUtil::getTokens(path, components, "/");
         // Ensure we have an entry representing every level of this path
         std::string partial;
-        BOOST_FOREACH(std::string component, components)
+        for (std::string component : components)
         {
             append(partial, component);
             mFilesystem.insert(partial);
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index 031471d1fecf3e73a9a7df60dd4263c8f2c5c1a6..f9393dea541842093ddbec341696af5d5352706e 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -2259,9 +2259,9 @@ bool LLImageFormatted::save(const std::string &filename)
 		return false;
 	}
 	
-	outfile.write(getData(), 	getDataSize());
+	S32 result = outfile.write(getData(), getDataSize());
 	outfile.close() ;
-	return true;
+    return (result != 0);
 }
 
 S8 LLImageFormatted::getCodec() const
diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp
index 8dba1641a6d20bbbc3bcce07e74e596b0af0e129..68598589b8b5a9ead8624d4b8bcfbc9103fe4b3e 100644
--- a/indra/llimage/llimagej2c.cpp
+++ b/indra/llimage/llimagej2c.cpp
@@ -48,7 +48,7 @@ std::string LLImageJ2C::getEngineInfo()
 {
 	// All known LLImageJ2CImpl implementation subclasses are cheap to
 	// construct.
-	boost::scoped_ptr<LLImageJ2CImpl> impl(fallbackCreateLLImageJ2CImpl());
+	std::unique_ptr<LLImageJ2CImpl> impl(fallbackCreateLLImageJ2CImpl());
 	return impl->getEngineInfo();
 }
 
diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h
index e196f7479ed0c83dd30b17e3a5db0db5f7c7d863..b30df6f77638463875b5c0b5f308c3f6dd092e42 100644
--- a/indra/llimage/llimagej2c.h
+++ b/indra/llimage/llimagej2c.h
@@ -95,7 +95,7 @@ class LLImageJ2C : public LLImageFormatted
 	S8  mRawDiscardLevel;
 	F32 mRate;
 	bool mReversible;
-	boost::scoped_ptr<LLImageJ2CImpl> mImpl;
+	std::unique_ptr<LLImageJ2CImpl> mImpl;
 	std::string mLastError;
 
     // Image compression/decompression tester
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 55bcc7c5b272655815eda4d0f14c5b295ea18a03..6334a35fd0ed3dd41895eb3151588b8cf5ed8b96 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -32,6 +32,7 @@
 #include "llinventorydefines.h"
 #include "llxorcipher.h"
 #include "llsd.h"
+#include "llsdserialize.h"
 #include "message.h"
 #include <boost/tokenizer.hpp>
 
@@ -217,7 +218,19 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream)
 		}
         else if (0 == strcmp("metadata", keyword))
         {
-            LLSD metadata(valuestr);
+            LLSD metadata;
+            if (strncmp("<llsd>", valuestr, 6) == 0)
+            {
+                std::istringstream stream(valuestr);
+                LLSDSerialize::fromXML(metadata, stream);
+            }
+            else
+            {
+                // next line likely contains metadata, but at the moment is not supported
+                // can do something like:
+                // LLSDSerialize::fromNotation(metadata, input_stream, -1);
+            }
+
             if (metadata.has("thumbnail"))
             {
                 const LLSD& thumbnail = metadata["thumbnail"];
@@ -693,7 +706,19 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
 		}
         else if (0 == strcmp("metadata", keyword))
         {
-            LLSD metadata(valuestr);
+            LLSD metadata;
+            if (strncmp("<llsd>", valuestr, 6) == 0)
+            {
+                std::istringstream stream(valuestr);
+                LLSDSerialize::fromXML(metadata, stream);
+            }
+            else
+            {
+                // next line likely contains metadata, but at the moment is not supported
+                // can do something like:
+                // LLSDSerialize::fromNotation(metadata, input_stream, -1);
+            }
+
             if (metadata.has("thumbnail"))
             {
                 const LLSD& thumbnail = metadata["thumbnail"];
@@ -802,9 +827,14 @@ BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL inclu
 
     if (mThumbnailUUID.notNull())
     {
+        // Max length is 255 chars, will have to export differently if it gets more data
+        // Ex: use newline and toNotation (uses {}) for unlimited size
         LLSD metadata;
         metadata["thumbnail"] = LLSD().with("asset_id", mThumbnailUUID);
-        output_stream << "\t\tmetadata\t" << metadata << "|\n";
+
+        output_stream << "\t\tmetadata\t";
+        LLSDSerialize::toXML(metadata, output_stream);
+        output_stream << "|\n";
     }
 
 	// Check for permissions to see the asset id, and if so write it
@@ -1303,7 +1333,19 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream)
 		}
         else if (0 == strcmp("metadata", keyword))
         {
-            LLSD metadata(valuestr);
+            LLSD metadata;
+            if (strncmp("<llsd>", valuestr, 6) == 0)
+            {
+                std::istringstream stream(valuestr);
+                LLSDSerialize::fromXML(metadata, stream);
+            }
+            else
+            {
+                // next line likely contains metadata, but at the moment is not supported
+                // can do something like:
+                // LLSDSerialize::fromNotation(metadata, input_stream, -1);
+            }
+
             if (metadata.has("thumbnail"))
             {
                 const LLSD& thumbnail = metadata["thumbnail"];
@@ -1343,9 +1385,12 @@ BOOL LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, BOOL)
 	output_stream << "\t\tname\t" << mName.c_str() << "|\n";
     if (mThumbnailUUID.notNull())
     {
+        // Only up to 255 chars
         LLSD metadata;
         metadata["thumbnail"] = LLSD().with("asset_id", mThumbnailUUID);
-        output_stream << "\t\tmetadata\t" << metadata << "|\n";
+        output_stream << "\t\tmetadata\t";
+        LLSDSerialize::toXML(metadata, output_stream);
+        output_stream << "|\n";
     }
 	output_stream << "\t}\n";
 	return TRUE;
diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h
index b57e4cc40e51519fae5eab0b9b08caaedb89d4de..fe3902380cfd17cb45298ffa078263a34c337070 100644
--- a/indra/llkdu/llimagej2ckdu.h
+++ b/indra/llkdu/llimagej2ckdu.h
@@ -113,10 +113,10 @@ class LLImageJ2CKDU : public LLImageJ2CImpl
 	};
 
 	// Encode variable
-	boost::scoped_ptr<LLKDUMemSource> mInputp;
+	std::unique_ptr<LLKDUMemSource> mInputp;
 	CodeStreamHolder mCodeStreamp;
-	boost::scoped_ptr<kdu_core::kdu_coords> mTPosp; // tile position
-	boost::scoped_ptr<kdu_core::kdu_dims> mTileIndicesp;
+	std::unique_ptr<kdu_core::kdu_coords> mTPosp; // tile position
+	std::unique_ptr<kdu_core::kdu_dims> mTileIndicesp;
 	int mBlocksSize;
 	int mPrecinctsSize;
 	int mLevels;
@@ -125,7 +125,7 @@ class LLImageJ2CKDU : public LLImageJ2CImpl
 	// We don't own this LLImageRaw. We're simply pointing to an instance
 	// passed into initDecode().
 	LLImageRaw *mRawImagep;
-	boost::scoped_ptr<LLKDUDecodeState> mDecodeState;
+	std::unique_ptr<LLKDUDecodeState> mDecodeState;
 };
 
 #endif
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index afed98ff363e982334880fa08d5a2879c1971952..71878b8cb68857df706fd412d38efeededfcd50b 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -1000,7 +1000,7 @@ class LLVolume : public LLRefCount
 	friend class LLVolumeLODGroup;
 
 protected:
-	~LLVolume(); // use unref
+	virtual ~LLVolume(); // use unref
 
 public:
 	typedef std::vector<LLVolumeFace> face_list_t;
diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp
index ebbaea9b12cfabd0b693878f3837fff30cb7ff53..c0a5e361b104131ca0fb6db9b62263714d96b999 100644
--- a/indra/llmessage/llcoproceduremanager.cpp
+++ b/indra/llmessage/llcoproceduremanager.cpp
@@ -95,7 +95,7 @@ class LLCoprocedurePool: private boost::noncopyable
 private:
     struct QueuedCoproc
     {
-        typedef boost::shared_ptr<QueuedCoproc> ptr_t;
+        typedef std::shared_ptr<QueuedCoproc> ptr_t;
 
         QueuedCoproc(const std::string &name, const LLUUID &id, CoProcedure_t proc) :
             mName(name),
@@ -115,7 +115,7 @@ class LLCoprocedurePool: private boost::noncopyable
     // Use shared_ptr to control the lifespan of our CoprocQueue_t instance
     // because the consuming coroutine might outlive this LLCoprocedurePool
     // instance.
-    typedef boost::shared_ptr<CoprocQueue_t> CoprocQueuePtr;
+    typedef std::shared_ptr<CoprocQueue_t> CoprocQueuePtr;
 
     std::string     mPoolName;
     size_t          mPoolSize, mActiveCoprocsCount, mPending;
@@ -301,7 +301,7 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size):
     mPoolSize(size),
     mActiveCoprocsCount(0),
     mPending(0),
-    mPendingCoprocs(boost::make_shared<CoprocQueue_t>(LLCoprocedureManager::DEFAULT_QUEUE_SIZE)),
+    mPendingCoprocs(std::make_shared<CoprocQueue_t>(LLCoprocedureManager::DEFAULT_QUEUE_SIZE)),
     mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID),
     mCoroMapping()
 {
@@ -384,7 +384,7 @@ LLUUID LLCoprocedurePool::enqueueCoprocedure(const std::string &name, LLCoproced
         LL_INFOS("CoProcMgr") << "Coprocedure(" << name << ") enqueuing with id=" << id.asString() << " in pool \"" << mPoolName << "\" at "
                               << mPending << LL_ENDL;
     }
-    auto pushed = mPendingCoprocs->try_push(boost::make_shared<QueuedCoproc>(name, id, proc));
+    auto pushed = mPendingCoprocs->try_push(std::make_shared<QueuedCoproc>(name, id, proc));
     if (pushed == boost::fibers::channel_op_status::success)
     {
         ++mPending;
diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h
index 6d0d68cf24e822c81025b00ab2fb2df989677e07..fc561c6b0f92e48fbf8e911a3e662ded3f5ce43d 100644
--- a/indra/llmessage/llcorehttputil.h
+++ b/indra/llmessage/llcorehttputil.h
@@ -263,8 +263,8 @@ class HttpCoroHandler : public LLCore::HttpHandler
 {
 public:
 
-    typedef boost::shared_ptr<HttpCoroHandler>  ptr_t;
-    typedef boost::weak_ptr<HttpCoroHandler>    wptr_t;
+    typedef std::shared_ptr<HttpCoroHandler>  ptr_t;
+    typedef std::weak_ptr<HttpCoroHandler>    wptr_t;
 
     HttpCoroHandler(LLEventStream &reply);
 
@@ -317,8 +317,8 @@ class HttpCoroutineAdapter
     static const std::string HTTP_RESULTS_CONTENT;
     static const std::string HTTP_RESULTS_RAW;
 
-    typedef boost::shared_ptr<HttpCoroutineAdapter> ptr_t;
-    typedef boost::weak_ptr<HttpCoroutineAdapter>   wptr_t;
+    typedef std::shared_ptr<HttpCoroutineAdapter> ptr_t;
+    typedef std::weak_ptr<HttpCoroutineAdapter>   wptr_t;
 
     HttpCoroutineAdapter(const std::string &name, LLCore::HttpRequest::policy_t policyId);
     ~HttpCoroutineAdapter();
diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp
index 9f7768f78ec6f13c7f4fdc75b389ac11f72f9ed8..b7013dbb6eb3e20c5caabb8a4c580e360c070db1 100644
--- a/indra/llmessage/lldatapacker.cpp
+++ b/indra/llmessage/lldatapacker.cpp
@@ -298,6 +298,13 @@ BOOL LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char
 	}
 
 	htolememcpy(&size, mCurBufferp, MVT_S32, 4);
+
+    if (size < 0)
+    {
+        LL_WARNS() << "LLDataPackerBinaryBuffer::unpackBinaryData unpacked invalid size, aborting!" << LL_ENDL;
+        return FALSE;
+    }
+
 	mCurBufferp += 4;
 
 	if (!verifyLength(size, name))
diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h
index 8be4c64dfca9d48fc75960c579bc0617b71fb375..3ee45da2e75fbe977ed6e0cbb098886cb7bf6550 100644
--- a/indra/llmessage/llexperiencecache.h
+++ b/indra/llmessage/llexperiencecache.h
@@ -112,7 +112,7 @@ class LLExperienceCache: public LLSingleton < LLExperienceCache >
 
     // Callback types for get() 
     typedef boost::signals2::signal < void(const LLSD &) > callback_signal_t;
-	typedef boost::shared_ptr<callback_signal_t> signal_ptr;
+	typedef std::shared_ptr<callback_signal_t> signal_ptr;
 	// May have multiple callbacks for a single ID, which are
 	// represented as multiple slots bound to the signal.
 	// Avoid copying signals via pointers.
diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp
index c707c7ad09a0d77ca71a5ed2d48877da5ecd175f..e302dd2b5e24beaec398669558ce0db5bf84632f 100644
--- a/indra/llmessage/lliohttpserver.cpp
+++ b/indra/llmessage/lliohttpserver.cpp
@@ -982,7 +982,7 @@ LLHTTPNode& LLIOHTTPServer::create(
     }
 
     LLHTTPResponseFactory* factory = new LLHTTPResponseFactory;
-	boost::shared_ptr<LLChainIOFactory> factory_ptr(factory);
+	std::shared_ptr<LLChainIOFactory> factory_ptr(factory);
 
     LLIOServerSocket* server = new LLIOServerSocket(pool, socket, factory_ptr);
 
diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h
index 7fd4cee8ba97e194574b86a4c61e15876e645a71..e6ac8ebfc2936b7bf5ca6c3c150717e92ffd4774 100644
--- a/indra/llmessage/lliopipe.h
+++ b/indra/llmessage/lliopipe.h
@@ -89,7 +89,7 @@ class LLIOPipe
 	/** 
 	 * @brief Scattered memory container.
 	 */
-	typedef boost::shared_ptr<LLBufferArray> buffer_ptr_t;
+	typedef std::shared_ptr<LLBufferArray> buffer_ptr_t;
 
 	/** 
 	 * @brief Enumeration for IO return codes
diff --git a/indra/llmessage/lliosocket.h b/indra/llmessage/lliosocket.h
index 303d80eb142982c40daa1592d865fc06b52e19cd..a62b3c0204374059041dd125047d9a4db7491804 100644
--- a/indra/llmessage/lliosocket.h
+++ b/indra/llmessage/lliosocket.h
@@ -65,7 +65,7 @@ class LLSocket
 	/** 
 	 * @brief Reference counted shared pointers to sockets.
 	 */
-	typedef boost::shared_ptr<LLSocket> ptr_t;
+	typedef std::shared_ptr<LLSocket> ptr_t;
 
 	/** 
 	 * @brief Type of socket to create.
@@ -305,7 +305,7 @@ class LLIOServerSocket : public LLIOPipe
 {
 public:
 	typedef LLSocket::ptr_t socket_t;
-	typedef boost::shared_ptr<LLChainIOFactory> factory_t;
+	typedef std::shared_ptr<LLChainIOFactory> factory_t;
 	LLIOServerSocket(apr_pool_t* pool, socket_t listener, factory_t reactor);
 	virtual ~LLIOServerSocket();
 
diff --git a/indra/llmessage/llservice.h b/indra/llmessage/llservice.h
index 9c09aeb44ca42bf5408391a12c488f8c4ffcb135..f215acab56ea1d71f6ecfd4462d688a4a5e37718 100644
--- a/indra/llmessage/llservice.h
+++ b/indra/llmessage/llservice.h
@@ -116,7 +116,7 @@ class LLService : public LLIOPipe
 public:
 	//typedef boost::intrusive_ptr<LLServiceCreator> creator_t;
 	//typedef boost::intrusive_ptr<LLService> service_t;
-	typedef boost::shared_ptr<LLChainIOFactory> creator_t;
+	typedef std::shared_ptr<LLChainIOFactory> creator_t;
 
 	/** 
 	 * @brief This method is used to register a protocol name with a
diff --git a/indra/llmessage/llstoredmessage.h b/indra/llmessage/llstoredmessage.h
index 9c98e2c558ab5c12c8546d7e62ebefaf13b65423..6ea150fda36fdb1f87938358d26b82d127d720c4 100644
--- a/indra/llmessage/llstoredmessage.h
+++ b/indra/llmessage/llstoredmessage.h
@@ -46,7 +46,7 @@ class LLStoredMessage
 	std::string mName;
 };
 
-typedef boost::shared_ptr<LLStoredMessage> LLStoredMessagePtr;
+typedef std::shared_ptr<LLStoredMessage> LLStoredMessagePtr;
 
 
 #endif // LL_STOREDMESSAGE_H
diff --git a/indra/llmessage/tests/llcurl_stub.cpp b/indra/llmessage/tests/llcurl_stub.cpp
index b7fdf4f437b075ae07977d1bc107a05e6d32e5f9..1c571a74dae5ececac89261a59314f9a1d408917 100644
--- a/indra/llmessage/tests/llcurl_stub.cpp
+++ b/indra/llmessage/tests/llcurl_stub.cpp
@@ -49,7 +49,7 @@ void LLCurl::Responder::httpCompleted()
 }
 
 void LLCurl::Responder::completedRaw(LLChannelDescriptors const&,
-									 boost::shared_ptr<LLBufferArray> const&)
+									 std::shared_ptr<LLBufferArray> const&)
 {
 }
 
diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h
index ba76ae4e3726174cfaea4a6b03c1457f0d97c62c..d56712257b1a68b644e9e9dbeae915c2db9d21b8 100644
--- a/indra/llplugin/llpluginclassmedia.h
+++ b/indra/llplugin/llpluginclassmedia.h
@@ -335,7 +335,7 @@ class LLPluginClassMedia : public LLPluginProcessParentOwner
 	// "init_history" message 
 	void initializeUrlHistory(const LLSD& url_history);
 
-	boost::shared_ptr<LLPluginClassMedia> getSharedPtr() { return boost::dynamic_pointer_cast<LLPluginClassMedia>(shared_from_this()); } // due to enable_shared_from_this
+	std::shared_ptr<LLPluginClassMedia> getSharedPtr() { return std::dynamic_pointer_cast<LLPluginClassMedia>(shared_from_this()); } // due to enable_shared_from_this
 
 protected:
 
diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h
index 1893c9e65746cf267f96dd4839678fedbfeba414..01627925d74adff987c27d86756fc43af9425991 100644
--- a/indra/llplugin/llpluginprocessparent.h
+++ b/indra/llplugin/llpluginprocessparent.h
@@ -43,7 +43,7 @@
 #include "llsd.h"
 #include "llevents.h"
 
-class LLPluginProcessParentOwner : public boost::enable_shared_from_this < LLPluginProcessParentOwner > 
+class LLPluginProcessParentOwner : public std::enable_shared_from_this < LLPluginProcessParentOwner > 
 {
 public:
 	virtual ~LLPluginProcessParentOwner();
@@ -60,7 +60,7 @@ class LLPluginProcessParent : public LLPluginMessagePipeOwner
 
     LLPluginProcessParent(LLPluginProcessParentOwner *owner);
 public:
-    typedef boost::shared_ptr<LLPluginProcessParent> ptr_t;
+    typedef std::shared_ptr<LLPluginProcessParent> ptr_t;
 
 	~LLPluginProcessParent();
 		
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp
index 2e4b013b778787e38809549799f00422fb33c941..2c357e1ac5815d39b0a171238dc9d27e3011bb92 100644
--- a/indra/llprimitive/lldaeloader.cpp
+++ b/indra/llprimitive/lldaeloader.cpp
@@ -53,8 +53,6 @@
 #pragma warning (default : 4264)
 #endif
 
-#include <boost/lexical_cast.hpp>
-
 #include "lldaeloader.h"
 #include "llsdserialize.h"
 #include "lljoint.h"
@@ -2385,7 +2383,7 @@ std::string LLDAELoader::getElementLabel(daeElement *element)
 
 		if (ind > 0)
 		{
-			index_string = "_" + boost::lexical_cast<std::string>(ind);
+			index_string = "_" + std::to_string(ind);
 		}
 
 		// if parent has a name or ID, use it
diff --git a/indra/llprimitive/llgltfloader.cpp b/indra/llprimitive/llgltfloader.cpp
index 7394f99794e4ab1d2134f94985a68a6e23e865bb..8e498158d6d82402269e034a5e775bcfa7fb49c7 100644
--- a/indra/llprimitive/llgltfloader.cpp
+++ b/indra/llprimitive/llgltfloader.cpp
@@ -48,8 +48,6 @@
 
 // TODO: includes inherited from dae loader.  Validate / prune
 
-#include <boost/lexical_cast.hpp>
-
 #include "llsdserialize.h"
 #include "lljoint.h"
 
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index d56ffdc317300cbbfc53b1edf67e3cc3f9a6be53..7b0d2632aa43bc7e4d7836e0b9e10343512c5304 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -68,6 +68,7 @@ LLModel::~LLModel()
 	{
 		LLConvexDecomposition::getInstance()->deleteDecomposition(mDecompID);
 	}
+    mPhysics.mMesh.clear();
 }
 
 //static
diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h
index 4505d6b3b993b90cf6162bcbe943420e2fd28321..040257e00e13e53bdbaa2a7912bcbb82a8eaa44f 100644
--- a/indra/llprimitive/llmodel.h
+++ b/indra/llprimitive/llmodel.h
@@ -106,6 +106,8 @@ class LLModel : public LLVolume
 		std::vector<LLVector3> mPositions;
 		std::vector<LLVector3> mNormals;
 
+        ~PhysicsMesh() {}
+
 		void clear()
 		{
 			mPositions.clear();
@@ -131,6 +133,7 @@ class LLModel : public LLVolume
 	public:
 		Decomposition() { }
 		Decomposition(LLSD& data);
+		~Decomposition() { }
 		void fromLLSD(LLSD& data);
 		LLSD asLLSD() const;
 		bool hasHullList() const;
@@ -365,7 +368,7 @@ class LLModelInstanceBase
 {
 public:
 	LLPointer<LLModel> mModel;
-	LLPointer<LLModel> mLOD[5];
+	LLPointer<LLModel> mLOD[LLModel::NUM_LODS];
 	LLUUID mMeshID;
 
 	LLMatrix4 mTransform;
@@ -380,6 +383,15 @@ class LLModelInstanceBase
 		: mModel(NULL)
 	{
 	}
+
+    virtual ~LLModelInstanceBase()
+    {
+        mModel = NULL;
+        for (int j = 0; j < LLModel::NUM_LODS; ++j)
+        {
+            mLOD[j] = NULL;
+        }
+    };
 };
 
 typedef std::vector<LLModelInstanceBase> model_instance_list;
@@ -399,6 +411,8 @@ class LLModelInstance : public LLModelInstanceBase
 
 	LLModelInstance(LLSD& data);
 
+    ~LLModelInstance() {}
+
 	LLSD asLLSD();
 };
 
diff --git a/indra/llprimitive/tests/llmediaentry_test.cpp b/indra/llprimitive/tests/llmediaentry_test.cpp
index b072ce3964c382ba43cdb2a5d9dc66f769afb5cc..c3e17d1267a513d90e1163cf6e0ff38b37ee7410 100644
--- a/indra/llprimitive/tests/llmediaentry_test.cpp
+++ b/indra/llprimitive/tests/llmediaentry_test.cpp
@@ -211,7 +211,7 @@ namespace tut
 
     void whitelist_test(int num, bool enable, const char *whitelist, const char *candidate_url, bool expected_pass)
     {
-        std::string message = "Whitelist test " + boost::lexical_cast<std::string>(num);
+        std::string message = "Whitelist test " + std::to_string(num);
         LLMediaEntry entry;
         entry.setWhiteListEnable(enable);
         set_whitelist(entry, whitelist);
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index 3e159365e5d0fcea0999b2a6397dd4c1ae97a69a..8ef7bd837f44f4fe976702cecbc26a34ec0cd41c 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -34,8 +34,6 @@
 #include "llerror.h"
 #include "llxuiparser.h"
 
-#include <boost/foreach.hpp>
-
 
 //
 // LLCommandId class
@@ -182,7 +180,7 @@ bool LLCommandManager::load()
 		return false;
 	}
 
-	BOOST_FOREACH(LLCommand::Params& commandParams, commandsParams.commands)
+	for (const LLCommand::Params& commandParams : commandsParams.commands)
 	{
 		LLCommand * command = new LLCommand(commandParams);
 
diff --git a/indra/llui/llfiltereditor.h b/indra/llui/llfiltereditor.h
index 3a05bc05a165efa6466d27639f9be4692b955d01..52cad3bff4916ae14a1d9671a09b30552fce5baf 100644
--- a/indra/llui/llfiltereditor.h
+++ b/indra/llui/llfiltereditor.h
@@ -43,6 +43,7 @@ class LLFilterEditor : public LLSearchEditor
 public:
 	struct Params : public LLInitParam::Block<Params, LLSearchEditor::Params>
 	{};
+    virtual ~LLFilterEditor() {}
 
 protected:
 	LLFilterEditor(const Params&);
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index cf33d633ad774cbe5ce1d4b5e8f042665d01a8d3..c7b04c905c557e29bf192fee29ee87a9c68c1759 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -59,7 +59,6 @@
 #include "llmultifloater.h"
 #include "llsdutil.h"
 #include "lluiusage.h"
-#include <boost/foreach.hpp>
 
 
 // use this to control "jumping" behavior when Ctrl-Tabbing
@@ -1849,6 +1848,8 @@ void LLFloater::onClickTearOff(LLFloater* self)
 		{
 			if (self->mSaveRect)
 			{
+                LLRect screen_rect = self->calcScreenRect();
+                self->mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
 				self->storeRectControl();
 			}
 			self->setMinimized(FALSE); // to reenable minimize button if it was minimized
@@ -2461,7 +2462,7 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
 			//{
 			//	floaterp->translate(translate_x, translate_y);
 			//}
-			BOOST_FOREACH(LLHandle<LLFloater> dependent_floater, floaterp->mDependents)
+			for (LLHandle<LLFloater> dependent_floater : floaterp->mDependents)
 			{
 				if (dependent_floater.get())
 				{
@@ -2476,10 +2477,9 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
 void LLFloaterView::restoreAll()
 {
 	// make sure all subwindows aren't minimized
-	child_list_t child_list = *(getChildList());
-	for (child_list_const_iter_t child_it = child_list.begin(); child_it != child_list.end(); ++child_it)
+	for (auto child : *getChildList())
 	{
-		LLFloater* floaterp = dynamic_cast<LLFloater*>(*child_it);
+		LLFloater* floaterp = dynamic_cast<LLFloater*>(child);
 		if (floaterp)
 		{
 			floaterp->setMinimized(FALSE);
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 7e4e828a885d0103134916224526c2b9e70e54c4..2769a96875d2e1037f1dde1b424e64f7547454ba 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -395,8 +395,7 @@ void LLLayoutStack::updateLayout()
 							: getRect().getHeight();
 
 	// first, assign minimum dimensions
-	LLLayoutPanel* panelp = NULL;
-	BOOST_FOREACH(panelp, mPanels)
+	for (LLLayoutPanel* panelp : mPanels)
 	{
 		if (panelp->mAutoResize)
 		{
@@ -409,12 +408,15 @@ void LLLayoutStack::updateLayout()
 	llassert(total_visible_fraction < 1.05f);
 
 	// don't need spacing after last panel
-	space_to_distribute += panelp ? ll_round((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
+	if (!mPanels.empty())
+	{
+		space_to_distribute += ll_round(F32(mPanelSpacing) * mPanels.back()->getVisibleAmount());
+	}
 
 	S32 remaining_space = space_to_distribute;
 	if (space_to_distribute > 0 && total_visible_fraction > 0.f)
 	{	// give space proportionally to visible auto resize panels
-		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+		for (LLLayoutPanel* panelp : mPanels)
 		{
 			if (panelp->mAutoResize)
 			{
@@ -427,7 +429,7 @@ void LLLayoutStack::updateLayout()
 	}
 
 	// distribute any left over pixels to non-collapsed, visible panels
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	for (LLLayoutPanel* panelp : mPanels)
 	{
 		if (remaining_space == 0) break;
 
@@ -443,7 +445,7 @@ void LLLayoutStack::updateLayout()
 
 	F32 cur_pos = (mOrientation == HORIZONTAL) ? 0.f : (F32)getRect().getHeight();
 
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	for (LLLayoutPanel* panelp : mPanels)
 	{
 		F32 panel_dim = llmax(panelp->getExpandedMinDim(), panelp->mTargetDim);
 
@@ -538,7 +540,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const
 {
 	if (!panelp) return NULL;
 
-	BOOST_FOREACH(LLLayoutPanel* p, mPanels)
+	for (LLLayoutPanel* p : mPanels)
 	{
 		if (p == panelp)
 		{
@@ -552,7 +554,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) c
 {
 	LLLayoutPanel* result = NULL;
 
-	BOOST_FOREACH(LLLayoutPanel* p, mPanels)
+	for (LLLayoutPanel* p : mPanels)
 	{
 		if (p->getName() == name)
 		{
@@ -566,7 +568,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) c
 
 void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp)
 {
-	BOOST_FOREACH(LLLayoutPanel* lp, mPanels)
+	for (LLLayoutPanel* lp : mPanels)
 	{
 		if (lp->mResizeBar == NULL)
 		{
@@ -669,7 +671,7 @@ void LLLayoutStack::updateFractionalSizes()
 {
 	F32 total_resizable_dim = 0.f;
 
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	for (LLLayoutPanel* panelp : mPanels)
 	{
 		if (panelp->mAutoResize)
 		{
@@ -677,7 +679,7 @@ void LLLayoutStack::updateFractionalSizes()
 		}
 	}
 
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	for (LLLayoutPanel* panelp : mPanels)
 	{
 		if (panelp->mAutoResize)
 		{
@@ -698,7 +700,7 @@ void LLLayoutStack::normalizeFractionalSizes()
 	S32 num_auto_resize_panels = 0;
 	F32 total_fractional_size = 0.f;
 	
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	for (LLLayoutPanel* panelp : mPanels)
 	{
 		if (panelp->mAutoResize)
 		{
@@ -709,7 +711,7 @@ void LLLayoutStack::normalizeFractionalSizes()
 
 	if (total_fractional_size == 0.f)
 	{ // equal distribution
-		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+		for (LLLayoutPanel* panelp : mPanels)
 		{
 			if (panelp->mAutoResize)
 			{
@@ -719,7 +721,7 @@ void LLLayoutStack::normalizeFractionalSizes()
 	}
 	else
 	{ // renormalize
-		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+		for (LLLayoutPanel* panelp : mPanels)
 		{
 			if (panelp->mAutoResize)
 			{
@@ -736,7 +738,7 @@ bool LLLayoutStack::animatePanels()
 	//
 	// animate visibility
 	//
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	for (LLLayoutPanel* panelp : mPanels)
 	{
 		if (panelp->getVisible())
 		{
@@ -834,7 +836,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 	LLLayoutPanel* other_resize_panel = NULL;
 	LLLayoutPanel* following_panel = NULL;
 
-	BOOST_REVERSE_FOREACH(LLLayoutPanel* panelp, mPanels)
+	BOOST_REVERSE_FOREACH(LLLayoutPanel* panelp, mPanels) // Should replace this when C++20 reverse view adaptor becomes available...
 	{
 		if (panelp->mAutoResize)
 		{
@@ -883,7 +885,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 		AFTER_RESIZED_PANEL
 	} which_panel = BEFORE_RESIZED_PANEL;
 
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	for (LLLayoutPanel* panelp : mPanels)
 	{
 		if (!panelp->getVisible() || panelp->mCollapsed) 
 		{
@@ -974,6 +976,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 												MIN_FRACTIONAL_SIZE,
 												MAX_FRACTIONAL_SIZE);
 			}
+			break;
 		default:
 			break;
 		}
@@ -990,8 +993,8 @@ void LLLayoutStack::reshape(S32 width, S32 height, BOOL called_from_parent)
 
 void LLLayoutStack::updateResizeBarLimits()
 {
-	LLLayoutPanel* previous_visible_panelp = NULL;
-	BOOST_REVERSE_FOREACH(LLLayoutPanel* visible_panelp, mPanels)
+	LLLayoutPanel* previous_visible_panelp{ nullptr };
+	BOOST_REVERSE_FOREACH(LLLayoutPanel* visible_panelp, mPanels) // Should replace this when C++20 reverse view adaptor becomes available...
 	{
 		if (!visible_panelp->getVisible() || visible_panelp->mCollapsed)
 		{
diff --git a/indra/llui/llloadingindicator.cpp b/indra/llui/llloadingindicator.cpp
index 1ede5b706f9db44488bf041b892915fc81cefe76..e8b6b7e43b50e2eed0b55f60f48a8d7123be4925 100644
--- a/indra/llui/llloadingindicator.cpp
+++ b/indra/llui/llloadingindicator.cpp
@@ -34,7 +34,6 @@
 // Project includes
 #include "lluictrlfactory.h"
 #include "lluiimage.h"
-#include "boost/foreach.hpp"
 
 // registered in llui.cpp to avoid being left out by MS linker
 //static LLDefaultChildRegistry::Register<LLLoadingIndicator> r("loading_indicator");
@@ -52,7 +51,7 @@ LLLoadingIndicator::LLLoadingIndicator(const Params& p)
 
 void LLLoadingIndicator::initFromParams(const Params& p)
 {
-	BOOST_FOREACH(LLUIImage* image, p.images().image)
+	for (LLUIImage* image : p.images().image)
 	{
 		mImages.push_back(image);
 	}
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index c2ffaa7245b78fe26d70d60f9a3e9009a3832ce3..7381dc80a85ff4bbccebb8a81a229fab34f89c5d 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -60,7 +60,6 @@
 #include "v2math.h"
 #include <set>
 #include <boost/tokenizer.hpp>
-#include <boost/foreach.hpp>
 
 // static
 LLMenuHolderGL *LLMenuGL::sMenuContainer = NULL;
@@ -2162,7 +2161,7 @@ void LLMenuGL::arrange( void )
 		}
 		else
 		{
-			BOOST_FOREACH(LLMenuItemGL* itemp, mItems)
+			for (LLMenuItemGL* itemp : mItems)
 			{
 				// do first so LLMenuGLItemCall can call on_visible to determine if visible
 				itemp->buildDrawLabel();
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 2fe9ee18e3077b681ea060a3fa57aaa39479c8f1..907408f3099dc321d7db1ca41439f1f521f420d5 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -45,7 +45,6 @@
 
 #include <algorithm>
 #include <boost/regex.hpp>
-#include <boost/foreach.hpp>
 
 
 const std::string NOTIFICATION_PERSIST_VERSION = "0.93";
@@ -444,14 +443,14 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
 		mSoundName = p.sound;
 	}
 
-	BOOST_FOREACH(const LLNotificationTemplate::UniquenessContext& context, p.unique.contexts)
+	for (const LLNotificationTemplate::UniquenessContext& context : p.unique.contexts)
 	{
 		mUniqueContext.push_back(context.value);
 	}
 	
 	LL_DEBUGS("Notifications") << "notification \"" << mName << "\": tag count is " << p.tags.size() << LL_ENDL;
 	
-	BOOST_FOREACH(const LLNotificationTemplate::Tag& tag, p.tags)
+	for (const LLNotificationTemplate::Tag& tag : p.tags)
 	{
 		LL_DEBUGS("Notifications") << "    tag \"" << std::string(tag.value) << "\"" << LL_ENDL;
 		mTags.push_back(tag.value);
@@ -994,6 +993,7 @@ LLBoundListener LLNotificationChannelBase::connectChangedImpl(const LLEventListe
 	// all of the notifications that are already in the channel
 	// we use a special signal called "load" in case the channel wants to care
 	// only about new notifications
+    LLMutexLock lock(&mItemsMutex);
 	for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it)
 	{
 		slot(LLSD().with("sigtype", "load").with("id", (*it)->id()));
@@ -1153,7 +1153,7 @@ LLNotificationChannel::LLNotificationChannel(const Params& p)
 	LLInstanceTracker<LLNotificationChannel, std::string>(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()),
 	mName(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString())
 {
-	BOOST_FOREACH(const std::string& source, p.sources)
+	for (const std::string& source : p.sources)
     {
 		connectToChannel(source);
 	}
@@ -1171,29 +1171,33 @@ LLNotificationChannel::LLNotificationChannel(const std::string& name,
 	connectToChannel(parent);
 }
 
-bool LLNotificationChannel::isEmpty() const
+LLNotificationChannel::~LLNotificationChannel()
 {
-	return mItems.empty();
+    for (LLBoundListener &listener : mListeners)
+    {
+        listener.disconnect();
+    }
 }
 
-S32 LLNotificationChannel::size() const
+bool LLNotificationChannel::isEmpty() const
 {
-	return mItems.size();
+	return mItems.empty();
 }
 
-LLNotificationChannel::Iterator LLNotificationChannel::begin()
+S32 LLNotificationChannel::size() const
 {
-	return mItems.begin();
+    return mItems.size();
 }
 
-LLNotificationChannel::Iterator LLNotificationChannel::end()
+size_t LLNotificationChannel::size()
 {
-	return mItems.end();
+	return mItems.size();
 }
 
-size_t LLNotificationChannel::size()
+void LLNotificationChannel::forEachNotification(NotificationProcess process)
 {
-	return mItems.size();
+    LLMutexLock lock(&mItemsMutex);
+    std::for_each(mItems.begin(), mItems.end(), process);
 }
 
 std::string LLNotificationChannel::summarize()
@@ -1201,7 +1205,8 @@ std::string LLNotificationChannel::summarize()
 	std::string s("Channel '");
 	s += mName;
 	s += "'\n  ";
-	for (LLNotificationChannel::Iterator it = begin(); it != end(); ++it)
+    LLMutexLock lock(&mItemsMutex);
+	for (LLNotificationChannel::Iterator it = mItems.begin(); it != mItems.end(); ++it)
 	{
 		s += (*it)->summarize();
 		s += "\n  ";
@@ -1213,14 +1218,14 @@ void LLNotificationChannel::connectToChannel( const std::string& channel_name )
 {
 	if (channel_name.empty())
 	{
-		LLNotifications::instance().connectChanged(
-			boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
+        mListeners.push_back(LLNotifications::instance().connectChanged(
+			boost::bind(&LLNotificationChannelBase::updateItem, this, _1)));
 	}
 	else
 	{
 		mParents.push_back(channel_name);
 		LLNotificationChannelPtr p = LLNotifications::instance().getChannel(channel_name);
-		p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
+        mListeners.push_back(p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1)));
 	}
 }
 
@@ -1521,7 +1526,7 @@ void replaceFormText(LLNotificationForm::Params& form, const std::string& patter
 		form.ignore.text = replace;
 	}
 
-	BOOST_FOREACH(LLNotificationForm::FormElement& element, form.form_elements.elements)
+	for (LLNotificationForm::FormElement& element : form.form_elements.elements)
 	{
 		if (element.button.isChosen() && element.button.text() == pattern)
 		{
@@ -1571,19 +1576,19 @@ bool LLNotifications::loadTemplates()
 
 	mTemplates.clear();
 
-	BOOST_FOREACH(LLNotificationTemplate::GlobalString& string, params.strings)
+	for (const LLNotificationTemplate::GlobalString& string : params.strings)
 	{
 		mGlobalStrings[string.name] = string.value;
 	}
 
 	std::map<std::string, LLNotificationForm::Params> form_templates;
 
-	BOOST_FOREACH(LLNotificationTemplate::Template& notification_template, params.templates)
+	for (const LLNotificationTemplate::Template& notification_template : params.templates)
 	{
 		form_templates[notification_template.name] = notification_template.form;
 	}
 
-	BOOST_FOREACH(LLNotificationTemplate::Params& notification, params.notifications)
+	for (LLNotificationTemplate::Params& notification : params.notifications)
 	{
 		if (notification.form_ref.form_template.isChosen())
 		{
@@ -1638,7 +1643,7 @@ bool LLNotifications::loadVisibilityRules()
 
 	mVisibilityRules.clear();
 
-	BOOST_FOREACH(LLNotificationVisibilityRule::Rule& rule, params.rules)
+	for (const LLNotificationVisibilityRule::Rule& rule : params.rules)
 	{
 		mVisibilityRules.push_back(LLNotificationVisibilityRulePtr(new LLNotificationVisibilityRule(rule)));
 	}
@@ -1731,6 +1736,7 @@ void LLNotifications::cancel(LLNotificationPtr pNotif)
 
 void LLNotifications::cancelByName(const std::string& name)
 {
+    LLMutexLock lock(&mItemsMutex);
 	std::vector<LLNotificationPtr> notifs_to_cancel;
 	for (LLNotificationSet::iterator it=mItems.begin(), end_it = mItems.end();
 		it != end_it;
@@ -1755,6 +1761,7 @@ void LLNotifications::cancelByName(const std::string& name)
 
 void LLNotifications::cancelByOwner(const LLUUID ownerId)
 {
+    LLMutexLock lock(&mItemsMutex);
 	std::vector<LLNotificationPtr> notifs_to_cancel;
 	for (LLNotificationSet::iterator it = mItems.begin(), end_it = mItems.end();
 		 it != end_it;
@@ -1802,11 +1809,6 @@ LLNotificationPtr LLNotifications::find(LLUUID uuid)
 	}
 }
 
-void LLNotifications::forEachNotification(NotificationProcess process)
-{
-	std::for_each(mItems.begin(), mItems.end(), process);
-}
-
 std::string LLNotifications::getGlobalString(const std::string& key) const
 {
 	GlobalStringMap::const_iterator it = mGlobalStrings.find(key);
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 4d9a33f1d7ad7bce5b7613f1e401da97dc90b083..8e61ff5259a42875daed9d1bf5452f2369d24678 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -738,16 +738,19 @@ class LLNotificationChannelBase :
 {
 	LOG_CLASS(LLNotificationChannelBase);
 public:
-	LLNotificationChannelBase(LLNotificationFilter filter) 
-	:	mFilter(filter), 
-		mItems() 
-	{}
+    LLNotificationChannelBase(LLNotificationFilter filter) 
+    : mFilter(filter)
+    , mItems() 
+    , mItemsMutex()
+    {}
+
     virtual ~LLNotificationChannelBase()
     {
         // explicit cleanup for easier issue detection
         mChanged.disconnect_all_slots();
         mPassedFilter.disconnect_all_slots();
         mFailedFilter.disconnect_all_slots();
+        LLMutexLock lock(&mItemsMutex);
         mItems.clear();
     }
 	// you can also connect to a Channel, so you can be notified of
@@ -786,6 +789,7 @@ class LLNotificationChannelBase :
 	LLStandardSignal mChanged;
 	LLStandardSignal mPassedFilter;
 	LLStandardSignal mFailedFilter;
+    LLMutex mItemsMutex;
 	
 	// these are action methods that subclasses can override to take action 
 	// on specific types of changes; the management of the mItems list is
@@ -835,7 +839,7 @@ class LLNotificationChannel :
 	LLNotificationChannel(const Params& p = Params());
 	LLNotificationChannel(const std::string& name, const std::string& parent, LLNotificationFilter filter);
 
-	virtual ~LLNotificationChannel() {}
+	virtual ~LLNotificationChannel();
 	typedef LLNotificationSet::iterator Iterator;
     
 	std::string getName() const { return mName; }
@@ -844,21 +848,23 @@ class LLNotificationChannel :
 	{
 		return boost::iterator_range<parents_iter>(mParents);
 	}
-    
-	void connectToChannel(const std::string& channel_name);
-    
+
     bool isEmpty() const;
     S32 size() const;
-    
-    Iterator begin();
-    Iterator end();
-	size_t size();
-	
+    size_t size();
+
+    typedef boost::function<void(LLNotificationPtr)> NotificationProcess;
+    void forEachNotification(NotificationProcess process);
+
 	std::string summarize();
 
+protected:
+    void connectToChannel(const std::string& channel_name);
+
 private:
 	std::string mName;
 	std::vector<std::string> mParents;
+    std::vector<LLBoundListener> mListeners;
 };
 
 // An interface class to provide a clean linker seam to the LLNotifications class.
@@ -924,10 +930,6 @@ class LLNotifications :
 	void update(const LLNotificationPtr pNotif);
 
 	LLNotificationPtr find(LLUUID uuid);
-	
-	typedef boost::function<void (LLNotificationPtr)> NotificationProcess;
-	
-	void forEachNotification(NotificationProcess process);
 
 	// This is all stuff for managing the templates
 	// take your template out
@@ -990,7 +992,7 @@ class LLNotifications :
 
 	bool mIgnoreAllNotifications;
 
-	boost::scoped_ptr<LLNotificationsListener> mListener;
+	std::unique_ptr<LLNotificationsListener> mListener;
 
 	std::vector<LLNotificationChannelPtr> mDefaultChannels;
 };
diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp
index e73ba1fbe90577c65dddcfdae24221a59f991c51..859222f907eb34c31b297b25e7a039984410000b 100644
--- a/indra/llui/llnotificationslistener.cpp
+++ b/indra/llui/llnotificationslistener.cpp
@@ -32,7 +32,6 @@
 #include "llnotificationtemplate.h"
 #include "llsd.h"
 #include "llui.h"
-#include <boost/foreach.hpp>
 
 LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) :
     LLEventAPI("LLNotifications",
@@ -149,11 +148,11 @@ void LLNotificationsListener::listChannelNotifications(const LLSD& params) const
     if (channel)
     {
         LLSD notifications(LLSD::emptyArray());
-        for (LLNotificationChannel::Iterator ni(channel->begin()), nend(channel->end());
-             ni != nend; ++ni)
-        {
-            notifications.append(asLLSD(*ni));
-        }
+        std::function<void(LLNotificationPtr)> func = [notifications](LLNotificationPtr ni) mutable
+            {
+                notifications.append(asLLSD(ni));
+            };
+        channel->forEachNotification(func);
         response["notifications"] = notifications;
     }
     LLEventPumps::instance().obtain(params["reply"]).post(response);
diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp
index cfaf08ec0a26704df4db9bae7e86c38af25d92a1..8bf135f10ce804999b87d1d9640f802d21e2acfc 100644
--- a/indra/llui/llsearcheditor.cpp
+++ b/indra/llui/llsearcheditor.cpp
@@ -104,6 +104,14 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p)
 	}
 }
 
+LLSearchEditor::~LLSearchEditor()
+{
+    mSearchButton = NULL;
+    mClearButton = NULL;
+    mSearchEditor->deleteAllChildren();
+    deleteAllChildren();
+}
+
 //virtual
 void LLSearchEditor::draw()
 {
diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h
index c0f3c1d60cbb3edc9c0758a672cade3c8f3c35f8..bd51988d071a3d7120d86af9b5c28ee144fda271 100644
--- a/indra/llui/llsearcheditor.h
+++ b/indra/llui/llsearcheditor.h
@@ -74,7 +74,7 @@ class LLSearchEditor : public LLUICtrl
 	friend class LLUICtrlFactory;
 
 public:
-	virtual ~LLSearchEditor() {}
+	virtual ~LLSearchEditor();
 
 	/*virtual*/ void	draw();
 
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 2707f7a15ca6bd8000b11a0e2da47f2418886711..204b8b99846b72dc414b806342e7762b4d5b658b 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -27,7 +27,6 @@
 
 #include "linden_common.h"
 
-#include <boost/foreach.hpp>
 #include "lltoolbar.h"
 
 #include "llcommandmanager.h"
@@ -219,7 +218,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p)
 	
 	mCenteringStack->addChild(LLUICtrlFactory::create<LLLayoutPanel>(border_panel_p));
 
-	BOOST_FOREACH(LLCommandId id, p.commands)
+	for (const auto& id : p.commands)
 	{
 		addCommand(id);
 	}
@@ -417,7 +416,7 @@ BOOL LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask)
 		// Determine which button the mouse was over during the click in case the context menu action
 		// is intended to affect the button.
 		mRightMouseTargetButton = NULL;
-		BOOST_FOREACH(LLToolBarButton* button, mButtons)
+		for (LLToolBarButton* button : mButtons)
 		{
 			LLRect button_rect;
 			button->localRectToOtherView(button->getLocalRect(), &button_rect, this);
@@ -505,7 +504,7 @@ void LLToolBar::setButtonType(LLToolBarEnums::ButtonType button_type)
 void LLToolBar::resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row, S32 max_row_girth)
 {
 	// make buttons in current row all same girth
-	BOOST_FOREACH(LLToolBarButton* button, buttons_in_row)
+	for (LLToolBarButton* button : buttons_in_row)
 	{
 		if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL)
 		{
@@ -693,7 +692,7 @@ void LLToolBar::updateLayoutAsNeeded()
 
 	std::vector<LLToolBarButton*> buttons_in_row;
 
-	BOOST_FOREACH(LLToolBarButton* button, mButtons)
+	for (LLToolBarButton* button : mButtons)
 	{
 		button->reshape(button->mWidthRange.getMin(), button->mDesiredHeight);
 		button->autoResize();
@@ -878,7 +877,7 @@ void LLToolBar::createButtons()
 {
 	std::set<LLUUID> set_flashing;
 
-	BOOST_FOREACH(LLToolBarButton* button, mButtons)
+	for (LLToolBarButton* button : mButtons)
 	{
         if (button->getFlashTimer() && button->getFlashTimer()->isFlashingInProgress())
         {
@@ -896,7 +895,7 @@ void LLToolBar::createButtons()
 	mButtonMap.clear();
 	mRightMouseTargetButton = NULL;
 	
-	BOOST_FOREACH(LLCommandId& command_id, mButtonCommands)
+	for (const LLCommandId& command_id : mButtonCommands)
 	{
 		LLToolBarButton* button = createButton(command_id);
 		mButtons.push_back(button);
diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp
index 75fc86b226e328bd9f0308d45a6476fc8e8b2872..bea46f4a6ff884d861d8eeed715038718f0a12b4 100644
--- a/indra/llui/lltooltip.cpp
+++ b/indra/llui/lltooltip.cpp
@@ -444,7 +444,13 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params)
 	tooltip_params.rect = LLRect (0, 1, 1, 0);
 
 	if (tooltip_params.create_callback.isProvided())
-		mToolTip = tooltip_params.create_callback()(tooltip_params);
+    {
+        mToolTip = tooltip_params.create_callback()(tooltip_params);
+        if (mToolTip == NULL) 
+        {
+            return;
+        }
+    }
 	else
 		mToolTip = LLUICtrlFactory::create<LLToolTip> (tooltip_params);
 
@@ -496,7 +502,7 @@ void LLToolTipMgr::show(const LLToolTip::Params& params)
 {
 	if (!params.styled_message.isProvided() 
 		&& (!params.message.isProvided() || params.message().empty())
-		&& !params.image.isProvided()) return;
+		&& !params.image.isProvided() && !params.create_callback.isProvided()) return;
 
 	// fill in default tooltip params from tool_tip.xml
 	LLToolTip::Params params_with_defaults(params);
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index 096336045c364fbc9ab715264b7677814ee9f061..f43bdf1fdc713e86022994e7682f369cd65acd87 100644
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -32,7 +32,6 @@
 #include "llui.h"
 #include "lluicolortable.h"
 #include "lluictrlfactory.h"
-#include <boost/foreach.hpp>
 
 LLUIColorTable::ColorParams::ColorParams()
 :	value("value"),
@@ -208,7 +207,7 @@ bool LLUIColorTable::loadFromSettings()
 
 	// pass constraint=LLDir::ALL_SKINS because we want colors.xml from every
 	// skin dir
-	BOOST_FOREACH(std::string colors_path,
+	for (const std::string& colors_path :
 				  gDirUtilp->findSkinnedFilenames(LLDir::SKINBASE, "colors.xml", LLDir::ALL_SKINS))
 	{
 		result |= loadFromFilename(colors_path, mLoadedColors);
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 139eb17efaff0af712617ac9f1e76a4985c719b2..5768ceacd3318aeab0f69bc00c8be40f40d5210e 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -32,7 +32,6 @@
 
 #include <sstream>
 #include <boost/tokenizer.hpp>
-#include <boost/foreach.hpp>
 #include <boost/bind.hpp>
 
 #include "llrender.h"
@@ -61,6 +60,7 @@ static const S32 LINE_HEIGHT = 15;
 S32		LLView::sDepth = 0;
 bool	LLView::sDebugRects = false;
 bool	LLView::sDebugUnicode = false;
+bool	LLView::sDebugCamera = false;
 bool	LLView::sIsRectDirty = false;
 LLRect	LLView::sDirtyRect;
 bool	LLView::sDebugRectsShowNames = true;
@@ -593,7 +593,7 @@ void LLView::deleteAllChildren()
 
 void LLView::setAllChildrenEnabled(BOOL b)
 {
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		viewp->setEnabled(b);
 	}
@@ -622,7 +622,7 @@ void LLView::onVisibilityChange ( BOOL new_visibility )
 {
 	BOOL old_visibility;
 	BOOL log_visibility_change = LLViewerEventRecorder::instance().getLoggingStatus();
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		if (!viewp)
 		{
@@ -726,7 +726,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m
 {
 	if ( getVisible() && getEnabled() )
 	{
-		BOOST_FOREACH(LLView* viewp, mChildList)
+		for (LLView* viewp : mChildList)
 		{
 			if ((viewp->*method)(c, mask, TRUE))
 			{
@@ -745,7 +745,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m
 template <typename METHOD, typename XDATA>
 LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra, bool allow_mouse_block)
 {
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		S32 local_x = x - viewp->getRect().mLeft;
 		S32 local_y = y - viewp->getRect().mBottom;
@@ -774,7 +774,7 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA
 
 LLView* LLView::childrenHandleToolTip(S32 x, S32 y, MASK mask)
 {
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		S32 local_x = x - viewp->getRect().mLeft;
 		S32 local_y = y - viewp->getRect().mBottom;
@@ -806,7 +806,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask,
 	// default to not accepting drag and drop, will be overridden by handler
 	*accept = ACCEPT_NO;
 
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		S32 local_x = x - viewp->getRect().mLeft;
 		S32 local_y = y - viewp->getRect().mBottom;
@@ -832,7 +832,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask,
 
 LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask)
 {
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		S32 local_x = x - viewp->getRect().mLeft;
 		S32 local_y = y - viewp->getRect().mBottom;
@@ -860,7 +860,7 @@ LLView*	LLView::childFromPoint(S32 x, S32 y, bool recur)
 	if (!getVisible())
 		return NULL;
 
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		S32 local_x = x - viewp->getRect().mLeft;
 		S32 local_y = y - viewp->getRect().mBottom;
@@ -1379,7 +1379,7 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent)
 		mRect.mTop = getRect().mBottom + height;
 
 		// move child views according to reshape flags
-		BOOST_FOREACH(LLView* viewp, mChildList)
+		for (LLView* viewp : mChildList)
 		{
 			if (viewp != NULL)
 			{
@@ -1451,7 +1451,7 @@ LLRect LLView::calcBoundingRect()
 {
 	LLRect local_bounding_rect = LLRect::null;
 
-	BOOST_FOREACH(LLView* childp, mChildList)
+	for (LLView* childp : mChildList)
 	{
 		// ignore invisible and "top" children when calculating bounding rect
 		// such as combobox popups
@@ -1614,7 +1614,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const
     LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
 	
     // Look for direct children *first*
-	BOOST_FOREACH(LLView* childp, mChildList)
+	for (LLView* childp : mChildList)
 	{
 		llassert(childp);
 		if (childp->getName() == name)
@@ -1625,7 +1625,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const
 	if (recurse)
 	{
 		// Look inside each child as well.
-		BOOST_FOREACH(LLView* childp, mChildList)
+		for (LLView* childp : mChildList)
 		{
 			llassert(childp);
 			LLView* viewp = childp->findChildView(name, recurse);
@@ -2809,7 +2809,7 @@ S32	LLView::notifyParent(const LLSD& info)
 bool	LLView::notifyChildren(const LLSD& info)
 {
 	bool ret = false;
-	BOOST_FOREACH(LLView* childp, mChildList)
+	for (LLView* childp : mChildList)
 	{
 		ret = ret || childp->notifyChildren(info);
 	}
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 6e16d41cba39af8cfcfbe39385a0fc7f89fd3e6e..c14a8bdce31a7a4346659bed5b318cf41f8a1812 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -662,6 +662,9 @@ class LLView
 	// Show hexadecimal byte values of unicode symbols in a tooltip
 	static bool	sDebugUnicode;
 
+	// Show camera position and direction in Camera Controls floater
+	static bool	sDebugCamera;
+
 	static bool sIsRectDirty;
 	static LLRect sDirtyRect;
 
diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp
index 391a37728064a49a21050177098c80fdacd4029d..aaa2f6aef140a3105748133adba4caba239ed0b3 100644
--- a/indra/llwindow/lldxhardware.cpp
+++ b/indra/llwindow/lldxhardware.cpp
@@ -65,13 +65,12 @@ HRESULT GetVideoMemoryViaWMI(WCHAR* strInputDeviceID, DWORD* pdwAdapterRam)
 {
     HRESULT hr;
     bool bGotMemory = false;
-    HRESULT hrCoInitialize = S_OK;
     IWbemLocator* pIWbemLocator = nullptr;
     IWbemServices* pIWbemServices = nullptr;
     BSTR pNamespace = nullptr;
 
     *pdwAdapterRam = 0;
-    hrCoInitialize = CoInitialize( 0 );
+    CoInitializeEx(0, COINIT_APARTMENTTHREADED);
 
     hr = CoCreateInstance( CLSID_WbemLocator,
                            nullptr,
@@ -208,8 +207,7 @@ HRESULT GetVideoMemoryViaWMI(WCHAR* strInputDeviceID, DWORD* pdwAdapterRam)
 
     SAFE_RELEASE( pIWbemLocator );
 
-    if( SUCCEEDED( hrCoInitialize ) )
-        CoUninitialize();
+    CoUninitialize();
 
     if( bGotMemory )
         return S_OK;
@@ -232,9 +230,8 @@ S32 LLDXHardware::getMBVideoMemoryViaWMI()
 std::string LLDXHardware::getDriverVersionWMI(EGPUVendor vendor)
 {
 	std::string mDriverVersion;
-	HRESULT hrCoInitialize = S_OK;
 	HRESULT hres;
-	hrCoInitialize = CoInitialize(0);
+	CoInitializeEx(0, COINIT_APARTMENTTHREADED);
 	IWbemLocator *pLoc = NULL;
 
 	hres = CoCreateInstance(
@@ -437,10 +434,10 @@ std::string LLDXHardware::getDriverVersionWMI(EGPUVendor vendor)
 	{
 		pEnumerator->Release();
 	}
-	if (SUCCEEDED(hrCoInitialize))
-	{
-		CoUninitialize();
-	}
+
+    // supposed to always call CoUninitialize even if init returned false
+	CoUninitialize();
+
 	return mDriverVersion;
 }
 
@@ -687,7 +684,8 @@ BOOL LLDXHardware::getInfo(BOOL vram_only)
 	BOOL ok = FALSE;
     HRESULT       hr;
 
-    CoInitialize(NULL);
+    // CLSID_DxDiagProvider does not work with Multithreaded?
+    CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 
     IDxDiagProvider *dx_diag_providerp = NULL;
     IDxDiagContainer *dx_diag_rootp = NULL;
@@ -976,7 +974,7 @@ LLSD LLDXHardware::getDisplayInfo()
 	LLTimer hw_timer;
     HRESULT       hr;
 	LLSD ret;
-    CoInitialize(NULL);
+    CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
 
     IDxDiagProvider *dx_diag_providerp = NULL;
     IDxDiagContainer *dx_diag_rootp = NULL;
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 39f6117c694bf792605e4570471ccc15ff22b414..a6ae0419359048940427738abfc5cbbf86d23a76 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -235,6 +235,7 @@ set(viewer_SOURCE_FILES
     llfloaterimcontainer.cpp
     llfloaterinspect.cpp
     llfloaterinventorysettings.cpp
+    llfloaterinventorythumbnailshelper.cpp
     llfloaterjoystick.cpp
     llfloaterlagmeter.cpp
     llfloaterland.cpp
@@ -891,6 +892,7 @@ set(viewer_HEADER_FILES
     llfloaterimcontainer.h
     llfloaterinspect.h
     llfloaterinventorysettings.h
+    llfloaterinventorythumbnailshelper.h
     llfloaterjoystick.h
     llfloaterlagmeter.h
     llfloaterland.h
@@ -1578,34 +1580,15 @@ endif (WINDOWS)
 
 # Add the xui files. This is handy for searching for xui elements
 # from within the IDE.
-set(viewer_XUI_FILES
-    skins/default/colors.xml
-    skins/default/default_languages.xml
-    skins/default/textures/textures.xml
-    )
-file(GLOB DEFAULT_XUI_FILE_GLOB_LIST
-     ${CMAKE_CURRENT_SOURCE_DIR}/skins/*/xui/en/*.xml)
-list(APPEND viewer_XUI_FILES ${DEFAULT_XUI_FILE_GLOB_LIST})
-
-file(GLOB DEFAULT_WIDGET_FILE_GLOB_LIST
-     ${CMAKE_CURRENT_SOURCE_DIR}/skins/*/xui/en/widgets/*.xml)
-list(APPEND viewer_XUI_FILES ${DEFAULT_WIDGET_FILE_GLOB_LIST})
-
-# Cannot append empty lists in CMake, wait until we have files here.
-#file(GLOB SILVER_WIDGET_FILE_GLOB_LIST
-#     ${CMAKE_CURRENT_SOURCE_DIR}/skins/silver/xui/en-us/widgets/*.xml)
-#list(APPEND viewer_XUI_FILES ${SILVER_WIDGET_FILE_GLOB_LIST})
-
-list(SORT viewer_XUI_FILES)
-
-source_group("XUI Files" FILES ${viewer_XUI_FILES})
-
-set_source_files_properties(${viewer_XUI_FILES}
+file(GLOB_RECURSE viewer_XUI_FILES LIST_DIRECTORIES FALSE
+    ${CMAKE_CURRENT_SOURCE_DIR}/skins/*.xml)
+source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/skins PREFIX "XUI Files" FILES ${viewer_XUI_FILES})
+set_source_files_properties(${viewer_XUI_FILES} 
                             PROPERTIES HEADER_FILE_ONLY TRUE)
-
 list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES})
 
-file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES TRUE
+# Add the shader sources
+file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES FALSE
     ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders/*.glsl)
 source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders PREFIX "Shaders" FILES ${viewer_SHADER_FILES})
 set_source_files_properties(${viewer_SHADER_FILES} 
@@ -1615,6 +1598,7 @@ list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES})
 
 set(viewer_APPSETTINGS_FILES
     app_settings/anim.ini
+    app_settings/autoreplace.xml
     app_settings/cmd_line.xml
     app_settings/commands.xml
     app_settings/grass.xml
diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml
index aef402d4db56535b328ad95ff8211e337f92ec56..2cdd86267ee3b243c7e9e7b6c6b0c55a3bd1f2a6 100644
--- a/indra/newview/character/avatar_lad.xml
+++ b/indra/newview/character/avatar_lad.xml
@@ -2021,7 +2021,7 @@
      value_min="-1"
      value_max="1">
       <param_skeleton>
-
+	  
         <bone
          name="mEyeLeft"
          scale="0 0 0"
@@ -2031,8 +2031,9 @@
          name="mEyeRight"
          scale="0 0 0"
          offset="-.005 0 0" />
-
-        <bone
+		 
+	  
+<bone
          name="mFaceEyeAltLeft"
          scale="0 0 0"
          offset="-.005 0 0" />
@@ -2041,7 +2042,7 @@
          name="mFaceEyeAltRight"
          scale="0 0 0"
          offset="-.005 0 0" />
-
+	  
         <bone
          name="mFaceEyeLidLowerRight"
          scale="0 0.3 0.7"
@@ -2052,7 +2053,7 @@
          scale="0 0.3 0.7"
          offset="0 0 0" />
 
-        <bone
+		 <bone
          name="mFaceEyeLidUpperRight"
          scale="0 0.3 0.7"
          offset=" 0 0 0" />
@@ -2061,17 +2062,17 @@
          name="mFaceEyeLidUpperLeft"
          scale="0 0.3 0.7"
          offset=" 0 0 0" />
-
+		 
         <bone
          name="mFaceEyecornerInnerLeft"
          scale="0 0 0"
          offset="-0.005 -0.008 0.0" />
-
+		 
         <bone
          name="mFaceEyecornerInnerRight"
          scale="0 0 0"
          offset="-0.005 0.008 0.0" />
-
+		 
       </param_skeleton>
     </param>
 
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 3853aaa8fd58eb910b137bd5233ea27db1b3ca02..13501833b2cb9a810283b87c1b1d062c9fd74c57 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -95,7 +95,6 @@
 #include "llworld.h"
 #include "llworldmap.h"
 #include "stringize.h"
-#include "boost/foreach.hpp"
 #include "llcorehttputil.h"
 #include "lluiusage.h"
 
@@ -1469,23 +1468,27 @@ void LLAgent::pitch(F32 angle)
 
 	LLVector3 skyward = getReferenceUpVector();
 
-	// SL-19286 Avatar is upside down when viewed from below
-	// after left-clicking the mouse on the avatar and dragging down
-	//
-	// The issue is observed on angle below 10 degrees
-	const F32 look_down_limit = 179.f * DEG_TO_RAD;
-	const F32 look_up_limit   =  10.f * DEG_TO_RAD;
-
-	F32 angle_from_skyward = acos(mFrameAgent.getAtAxis() * skyward);
-
 	// clamp pitch to limits
-	if ((angle >= 0.f) && (angle_from_skyward + angle > look_down_limit))
+	if (angle >= 0.f)
 	{
-		angle = look_down_limit - angle_from_skyward;
+		const F32 look_down_limit = 179.f * DEG_TO_RAD;
+		F32 angle_from_skyward = acos(mFrameAgent.getAtAxis() * skyward);
+		if (angle_from_skyward + angle > look_down_limit)
+		{
+			angle = look_down_limit - angle_from_skyward;
+		}
 	}
-	else if ((angle < 0.f) && (angle_from_skyward + angle < look_up_limit))
+	else if (angle < 0.f)
 	{
-		angle = look_up_limit - angle_from_skyward;
+		const F32 look_up_limit = 5.f * DEG_TO_RAD;
+		const LLVector3& viewer_camera_pos = LLViewerCamera::getInstance()->getOrigin();
+		LLVector3 agent_focus_pos = getPosAgentFromGlobal(gAgentCamera.calcFocusPositionTargetGlobal());
+		LLVector3 look_dir = agent_focus_pos - viewer_camera_pos;
+		F32 angle_from_skyward = angle_between(look_dir, skyward);
+		if (angle_from_skyward + angle < look_up_limit)
+		{
+			angle = look_up_limit - angle_from_skyward;
+		}
 	}
 
 	if (fabs(angle) > 1e-4)
@@ -2329,7 +2332,7 @@ void LLAgent::endAnimationUpdateUI()
 			LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
 			LLFloaterIMContainer::floater_list_t conversations;
 			im_box->getDetachedConversationFloaters(conversations);
-			BOOST_FOREACH(LLFloater* conversation, conversations)
+			for (LLFloater* conversation : conversations)
 			{
 				LL_INFOS() << "skip_list.insert(session_floater): " << conversation->getTitle() << LL_ENDL;
 				skip_list.insert(conversation);
@@ -4333,6 +4336,10 @@ void LLAgent::teleportRequest(
 // Landmark ID = LLUUID::null means teleport home
 void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id)
 {
+    if (landmark_asset_id.isNull())
+    {
+        gAgentCamera.resetView();
+    }
 	mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id));
 	startTeleportRequest();
 }
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index fd3a9b1d7b9aa157af5f70957ac33a3bfd64972c..43b4457bf5a1d8257c9e142c436cd65a516dcb0b 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -61,7 +61,7 @@ class LLTeleportRequest;
 
 
 
-typedef boost::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr;
+typedef std::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr;
 
 //--------------------------------------------------------------------
 // Types
@@ -131,7 +131,7 @@ class LLAgent : public LLOldEvents::LLObservable
 private:
 	bool			mInitialized;
 	bool			mFirstLogin;
-	boost::shared_ptr<LLAgentListener> mListener;
+	std::shared_ptr<LLAgentListener> mListener;
 
 	//--------------------------------------------------------------------
 	// Session
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 8977b145d110698b859fe1e2eedf39b839f8c871..0d0d6e7e466ac64b00735bbd94e32dc19a626ee1 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -1779,7 +1779,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
 
 		head_offset.clearVec();
 		F32 fixup;
-		if (gAgentAvatarp->hasPelvisFixup(fixup))
+        if (gAgentAvatarp->hasPelvisFixup(fixup) && !gAgentAvatarp->isSitting())
 		{
 			head_offset[VZ] -= fixup;
 		}
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index 17e1a27934d3e67c0347b7320355eae286870dac..f23ce136087c6df0e68517504c4e860e0f46c4d9 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -1738,10 +1738,6 @@ void AISUpdate::doUpdate()
 		LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << LL_ENDL;
 		if (cat->getVersion() != version)
 		{
-			LL_WARNS() << "Possible version mismatch for category " << cat->getName()
-					<< ", viewer version " << cat->getVersion()
-					<< " AIS version " << version << " !!!Adjusting local version!!!" <<  LL_ENDL;
-
             // the AIS version should be considered the true version. Adjust 
             // our local category model to reflect this version number.  Otherwise 
             // it becomes possible to get stuck with the viewer being out of 
@@ -1751,13 +1747,23 @@ void AISUpdate::doUpdate()
             // is performed.  This occasionally gets out of sync however.
             if (version != LLViewerInventoryCategory::VERSION_UNKNOWN)
             {
+                LL_WARNS() << "Possible version mismatch for category " << cat->getName()
+                    << ", viewer version " << cat->getVersion()
+                    << " AIS version " << version << " !!!Adjusting local version!!!" << LL_ENDL;
                 cat->setVersion(version);
             }
             else
             {
                 // We do not account for update if version is UNKNOWN, so we shouldn't rise version
                 // either or viewer will get stuck on descendants count -1, try to refetch folder instead
-                cat->fetch();
+                //
+                // Todo: proper backoff?
+
+                LL_WARNS() << "Possible version mismatch for category " << cat->getName()
+                    << ", viewer version " << cat->getVersion()
+                    << " AIS version " << version << " !!!Rerequesting category!!!" << LL_ENDL;
+                const S32 LONG_EXPIRY = 360;
+                cat->fetch(LONG_EXPIRY);
             }
 		}
 	}
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 4c3a9229d2c51b5b546e21cf036cab490e3aacb1..c84657cf7abd53eb0ff92e7e2b6b32d5cac5cd5e 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -27,7 +27,6 @@
 #include "llviewerprecompiledheaders.h"
 
 #include <boost/lexical_cast.hpp>
-#include <boost/foreach.hpp>
 #include "llaccordionctrltab.h"
 #include "llagent.h"
 #include "llagentcamera.h"
@@ -1647,7 +1646,7 @@ void LLAppearanceMgr::removeOutfitPhoto(const LLUUID& outfit_id)
         sub_cat_array,
         outfit_item_array,
         LLInventoryModel::EXCLUDE_TRASH);
-    BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array)
+    for (LLViewerInventoryItem* outfit_item : outfit_item_array)
     {
         LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem();
         if (linked_item != NULL)
@@ -3438,7 +3437,7 @@ void update_base_outfit_after_ordering()
 								sub_cat_array,
 								outfit_item_array,
 								LLInventoryModel::EXCLUDE_TRASH);
-	BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array)
+	for (LLViewerInventoryItem* outfit_item : outfit_item_array)
 	{
 		LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem();
 		if (linked_item != NULL)
@@ -3742,7 +3741,7 @@ LLSD LLAppearanceMgr::dumpCOF() const
 			LLUUID linked_asset_id(linked_item->getAssetUUID());
 			md5.update((unsigned char*)linked_asset_id.mData, 16);
 			U32 flags = linked_item->getFlags();
-			md5.update(boost::lexical_cast<std::string>(flags));
+			md5.update(std::to_string(flags));
 		}
 		else if (LLAssetType::AT_LINK_FOLDER != inv_item->getActualType())
 		{
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 6e176183d82fa0de21a98b19d980eeceb149cf67..d6a4c414975df8151aaf08a83da00e9fbc618e3c 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -143,7 +143,6 @@
 
 // Third party library includes
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 #include <boost/algorithm/string.hpp>
 #include <boost/regex.hpp>
 #include <boost/throw_exception.hpp>
@@ -1206,7 +1205,7 @@ bool LLAppViewer::init()
             LLSD item(LeapCommand);
             LeapCommand.append(item);
         }
-        BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand))
+        for (const auto& leap : llsd::inArray(LeapCommand))
         {
             LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL;
             // We don't have any better description of this plugin than the
@@ -1711,7 +1710,7 @@ bool LLAppViewer::cleanup()
     LLNotifications::instance().clear();
 
 	// workaround for DEV-35406 crash on shutdown
-	LLEventPumps::instance().reset();
+	LLEventPumps::instance().reset(true);
 
 	//dump scene loading monitor results
 	if (LLSceneMonitor::instanceExists())
@@ -2368,7 +2367,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
 		LL_ERRS() << "Invalid settings location list" << LL_ENDL;
 	}
 
-	BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups)
+	for (const SettingsGroup& group : mSettingsLocationList->groups)
 	{
 		// skip settings groups that aren't the one we requested
 		if (group.name() != location_key) continue;
@@ -2380,7 +2379,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
 			return false;
 		}
 
-		BOOST_FOREACH(const SettingsFile& file, group.files)
+		for (const SettingsFile& file : group.files)
 		{
 			LL_INFOS("Settings") << "Attempting to load settings for the group " << file.name()
 			    << " - from location " << location_key << LL_ENDL;
@@ -2445,11 +2444,11 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
 std::string LLAppViewer::getSettingsFilename(const std::string& location_key,
 											 const std::string& file)
 {
-	BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups)
+	for (const SettingsGroup& group : mSettingsLocationList->groups)
 	{
 		if (group.name() == location_key)
 		{
-			BOOST_FOREACH(const SettingsFile& settings_file, group.files)
+			for (const SettingsFile& settings_file : group.files)
 			{
 				if (settings_file.name() == file)
 				{
@@ -3035,7 +3034,7 @@ void LLAppViewer::initStrings()
 	// Now that we've set "[sourceid]", have to go back through
 	// default_trans_args and reinitialize all those other keys because some
 	// of them, in turn, reference "[sourceid]".
-	BOOST_FOREACH(std::string key, default_trans_args)
+	for (const std::string& key : default_trans_args)
 	{
 		std::string brackets(key), nobrackets(key);
 		// Invalid to inspect key[0] if key is empty(). But then, the entire
@@ -4700,16 +4699,23 @@ void LLAppViewer::idle()
 		// When appropriate, update agent location to the simulator.
 		F32 agent_update_time = agent_update_timer.getElapsedTimeF32();
 		F32 agent_force_update_time = mLastAgentForceUpdate + agent_update_time;
-		BOOL force_update = gAgent.controlFlagsDirty()
-							|| (mLastAgentControlFlags != gAgent.getControlFlags())
-							|| (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND));
-		if (force_update || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND)))
+        bool timed_out = agent_update_time > (1.0f / (F32)AGENT_UPDATES_PER_SECOND);
+        BOOL force_send =
+            // if there is something to send
+            (gAgent.controlFlagsDirty() && timed_out)
+            // if something changed
+            || (mLastAgentControlFlags != gAgent.getControlFlags())
+            // keep alive
+            || (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND));
+        // timing out doesn't warranty that an update will be sent,
+        // just that it will be checked.
+		if (force_send || timed_out)
 		{
 			LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
 			// Send avatar and camera info
 			mLastAgentControlFlags = gAgent.getControlFlags();
-			mLastAgentForceUpdate = force_update ? 0 : agent_force_update_time;
-			send_agent_update(force_update);
+			mLastAgentForceUpdate = force_send ? 0 : agent_force_update_time;
+			send_agent_update(force_send);
 			agent_update_timer.reset();
 		}
 	}
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index cc4f4536a4d3413ae4105aaaa4a1eac605f67b9a..3444f50e52f18847f4ecd5fa720d907bb88913cd 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -177,6 +177,11 @@ LLNotificationChiclet::LLNotificationChiclet(const Params& p)
 	LLFloaterNotificationsTabbed::getInstance()->setSysWellChiclet(this);
 }
 
+LLNotificationChiclet::~LLNotificationChiclet()
+{
+    mNotificationChannel.reset();
+}
+
 void LLNotificationChiclet::onMenuItemClicked(const LLSD& user_data)
 {
 	std::string action = user_data.asString();
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index 58a797218fd44760b5bcacf0577de8525eddab5b..1698fa269af5da659db71fb1bd9f1b7bc2cbe6cb 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -531,8 +531,9 @@ class LLNotificationChiclet : public LLSysWellChiclet
 	struct Params : public LLInitParam::Block<Params, LLSysWellChiclet::Params>{};
 		
 protected:
-	struct ChicletNotificationChannel : public LLNotificationChannel
+	class ChicletNotificationChannel : public LLNotificationChannel
 	{
+    public:
 		ChicletNotificationChannel(LLNotificationChiclet* chiclet) 
 			: LLNotificationChannel(LLNotificationChannel::Params().filter(filterNotification).name(chiclet->getSessionId().asString()))
 			, mChiclet(chiclet)
@@ -542,6 +543,7 @@ class LLNotificationChiclet : public LLSysWellChiclet
 			connectToChannel("Offer");
 			connectToChannel("Notifications");
 		}
+        virtual ~ChicletNotificationChannel() {}
 				
 		static bool filterNotification(LLNotificationPtr notify);
 		// connect counter updaters to the corresponding signals
@@ -553,9 +555,10 @@ class LLNotificationChiclet : public LLSysWellChiclet
 	};
 				
 	boost::scoped_ptr<ChicletNotificationChannel> mNotificationChannel;
-				
-	LLNotificationChiclet(const Params& p);
-				
+
+    LLNotificationChiclet(const Params& p);
+    ~LLNotificationChiclet();
+
 	/**
 	 * Processes clicks on chiclet menu.
 	 */
diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp
index eb2c156ca555f80b9487c435629d062b7c260fb7..b11786a451a7114a587bdd558bfee139364e3382 100644
--- a/indra/newview/llcompilequeue.cpp
+++ b/indra/newview/llcompilequeue.cpp
@@ -73,7 +73,7 @@ namespace
     class ObjectInventoryFetcher: public LLVOInventoryListener
     {
     public:
-        typedef boost::shared_ptr<ObjectInventoryFetcher> ptr_t;
+        typedef std::shared_ptr<ObjectInventoryFetcher> ptr_t;
 
         ObjectInventoryFetcher(LLEventPump &pump, LLViewerObject* object, void* user_data) :
             mPump(pump),
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp
index a696c99a82060c922b4c438d240a777ddf298882..3c59ca046d532e0258830b38ad0ac9b2922c68ce 100644
--- a/indra/newview/llconversationlog.cpp
+++ b/indra/newview/llconversationlog.cpp
@@ -32,7 +32,6 @@
 #include "llnotificationsutil.h"
 #include "lltrans.h"
 
-#include <boost/foreach.hpp>
 #include "boost/lexical_cast.hpp"
 
 const S32Days CONVERSATION_LIFETIME = (S32Days)30; // lifetime of LLConversation is 30 days by spec
@@ -392,7 +391,7 @@ void LLConversationLog::deleteBackupLogs()
 	std::vector<std::string> backup_logs;
 	getListOfBackupLogs(backup_logs);
 
-	BOOST_FOREACH(const std::string& fullpath, backup_logs)
+	for (const std::string& fullpath : backup_logs)
 	{
 		LLFile::remove(fullpath);
 	}
@@ -434,7 +433,7 @@ bool LLConversationLog::moveLog(const std::string &originDirectory, const std::s
 			while(LLFile::isfile(backupFileName))
 			{
 				++backupFileCount;
-				backupFileName = targetDirectory + ".backup" + boost::lexical_cast<std::string>(backupFileCount);
+				backupFileName = targetDirectory + ".backup" + std::to_string(backupFileCount);
 			}
 
 			//Rename the file to its backup name so it is not overwritten
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index 9e043dbac0936fc8b7cd781a6a401cd7f3a4771b..f152e36cf54933860412dc5a8df6201ab0635fc2 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -37,8 +37,6 @@
 #include "llimview.h" //For LLIMModel
 #include "lltrans.h"
 
-#include <boost/foreach.hpp>
-
 //
 // Conversation items : common behaviors
 //
@@ -300,8 +298,7 @@ void LLConversationItemSession::updateName(LLConversationItemParticipant* partic
 		// In the case of a P2P conversation, we need to grab the name of the other participant in the session instance itself
 		// as we do not create participants for such a session.
 
-		LLFolderViewModelItem * itemp;
-		BOOST_FOREACH(itemp, mChildren)
+		for (auto itemp : mChildren)
 		{
 			LLConversationItem* current_participant = dynamic_cast<LLConversationItem*>(itemp);
 			// Add the avatar uuid to the list (except if it's the own agent uuid)
diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp
index b66eb754a48c684aea5279944b89106b18a0e326..b0d88159c1579ac3f59a11f753ce1df876e58fbe 100644
--- a/indra/newview/llexternaleditor.cpp
+++ b/indra/newview/llexternaleditor.cpp
@@ -32,7 +32,6 @@
 #include "llprocess.h"
 #include "llsdutil.h"
 #include "llstring.h"
-#include <boost/foreach.hpp>
 
 // static
 const std::string LLExternalEditor::sFilenameMarker = "%s";
@@ -93,7 +92,7 @@ LLExternalEditor::EErrorCode LLExternalEditor::run(const std::string& file_path)
 	params.executable = mProcessParams.executable;
 
 	// Substitute the filename marker in the command with the actual passed file name.
-	BOOST_FOREACH(const std::string& arg, mProcessParams.args)
+	for (const std::string& arg : mProcessParams.args)
 	{
 		std::string fixed(arg);
 		LLStringUtil::replaceString(fixed, sFilenameMarker, file_path);
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index 1c69b9d60baa026ba66c90e94c5b325658cc75b8..7985ce447f22aa5c3405dd40181d882b39f2f6f2 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -44,6 +44,7 @@
 #include "llfirstuse.h"
 #include "llhints.h"
 #include "lltabcontainer.h"
+#include "llviewercamera.h"
 #include "llvoavatarself.h"
 
 static LLDefaultChildRegistry::Register<LLPanelCameraItem> r("panel_camera_item");
@@ -65,13 +66,19 @@ class LLPanelCameraZoom
 :	public LLPanel
 {
 	LOG_CLASS(LLPanelCameraZoom);
+
 public:
-	LLPanelCameraZoom();
+	struct Params : public LLInitParam::Block<Params, LLPanel::Params> {};
+
+	LLPanelCameraZoom() { onCreate(); }
 
 	/* virtual */ BOOL	postBuild();
 	/* virtual */ void	draw();
 
 protected:
+	LLPanelCameraZoom(const Params& p) { onCreate(); }
+
+	void	onCreate();
 	void	onZoomPlusHeldDown();
 	void	onZoomMinusHeldDown();
 	void	onSliderValueChanged();
@@ -80,9 +87,11 @@ class LLPanelCameraZoom
 	F32		getOrbitRate(F32 time);
 
 private:
-	LLButton*	mPlusBtn;
-	LLButton*	mMinusBtn;
-	LLSlider*	mSlider;
+	LLButton*	mPlusBtn { nullptr };
+	LLButton*	mMinusBtn{ nullptr };
+	LLSlider*	mSlider{ nullptr };
+
+	friend class LLUICtrlFactory;
 };
 
 LLPanelCameraItem::Params::Params()
@@ -158,10 +167,7 @@ static LLPanelInjector<LLPanelCameraZoom> t_camera_zoom_panel("camera_zoom_panel
 // LLPanelCameraZoom
 //-------------------------------------------------------------------------------
 
-LLPanelCameraZoom::LLPanelCameraZoom()
-:	mPlusBtn( NULL ),
-	mMinusBtn( NULL ),
-	mSlider( NULL )
+void LLPanelCameraZoom::onCreate()
 {
 	mCommitCallbackRegistrar.add("Zoom.minus", boost::bind(&LLPanelCameraZoom::onZoomMinusHeldDown, this));
 	mCommitCallbackRegistrar.add("Zoom.plus", boost::bind(&LLPanelCameraZoom::onZoomPlusHeldDown, this));
@@ -172,9 +178,9 @@ LLPanelCameraZoom::LLPanelCameraZoom()
 
 BOOL LLPanelCameraZoom::postBuild()
 {
-	mPlusBtn  = getChild <LLButton> ("zoom_plus_btn");
-	mMinusBtn = getChild <LLButton> ("zoom_minus_btn");
-	mSlider   = getChild <LLSlider> ("zoom_slider");
+	mPlusBtn  = getChild<LLButton>("zoom_plus_btn");
+	mMinusBtn = getChild<LLButton>("zoom_minus_btn");
+	mSlider   = getChild<LLSlider>("zoom_slider");
 	return LLPanel::postBuild();
 }
 
@@ -240,11 +246,80 @@ void activate_camera_tool()
 	LLToolMgr::getInstance()->setTransientTool(LLToolCamera::getInstance());
 };
 
+class LLCameraInfoPanel : public LLPanel
+{
+public:
+    typedef std::function<LLVector3()> get_vector_t;
+
+    LLCameraInfoPanel(
+        const LLView* parent,
+        const char* title,
+        const LLCoordFrame& camera,
+        const get_vector_t get_focus
+    )
+    : LLPanel([&]() -> LLPanel::Params
+        {
+            LLPanel::Params params;
+            params.rect = LLRect(parent->getLocalRect());
+            return params;
+        }())
+    , mTitle(title)
+    , mCamera(camera)
+    , mGetFocus(get_focus)
+    , mFont(LLFontGL::getFontSansSerifBig())
+    {
+    }
+
+    virtual void draw() override
+    {
+        LLPanel::draw();
+
+        static const U32 HPADDING = 10;
+        static const U32 VPADDING = 5;
+        LLVector3 focus = mGetFocus();
+        LLVector3 sight = focus - mCamera.mOrigin;
+        std::pair<const char*, const LLVector3&> const data[] =
+        {
+            { "Origin:", mCamera.mOrigin },
+            { "X Axis:", mCamera.mXAxis },
+            { "Y Axis:", mCamera.mYAxis },
+            { "Z Axis:", mCamera.mZAxis },
+            { "Focus:", focus },
+            { "Sight:", sight }
+        };
+        S32 width = getRect().getWidth();
+        S32 height = getRect().getHeight();
+        S32 row_count = 1 + sizeof(data) / sizeof(*data);
+        S32 row_height = (height - VPADDING * 2) / row_count;
+        S32 top = height - VPADDING - row_height / 2;
+        mFont->renderUTF8(mTitle, 0, HPADDING, top, LLColor4::white, LLFontGL::LEFT, LLFontGL::VCENTER);
+        for (const auto& row : data)
+        {
+            top -= row_height;
+            mFont->renderUTF8(row.first, 0, HPADDING, top, LLColor4::white, LLFontGL::LEFT, LLFontGL::VCENTER);
+            const LLVector3& vector = row.second;
+            for (S32 i = 0; i < 3; ++i)
+            {
+                std::string text = llformat("%.6f", vector[i]);
+                S32 right = width / 4 * (i + 2) - HPADDING;
+                mFont->renderUTF8(text, 0, right, top, LLColor4::white, LLFontGL::RIGHT, LLFontGL::VCENTER);
+            }
+        }
+    }
+
+private:
+    const char* mTitle;
+    const LLCoordFrame& mCamera;
+    const get_vector_t mGetFocus;
+    const LLFontGL* mFont;
+};
+
 //
 // Member functions
 //
 
-/*static*/ bool LLFloaterCamera::inFreeCameraMode()
+// static
+bool LLFloaterCamera::inFreeCameraMode()
 {
 	LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance();
 	if (floater_camera && floater_camera->mCurrMode == CAMERA_CTRL_MODE_FREE_CAMERA && gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK)
@@ -254,6 +329,7 @@ void activate_camera_tool()
 	return false;
 }
 
+// static
 void LLFloaterCamera::resetCameraMode()
 {
 	LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance();
@@ -261,6 +337,7 @@ void LLFloaterCamera::resetCameraMode()
 	floater_camera->switchMode(CAMERA_CTRL_MODE_PAN);
 }
 
+// static
 void LLFloaterCamera::onAvatarEditingAppearance(bool editing)
 {
 	sAppearanceEditing = editing;
@@ -269,15 +346,46 @@ void LLFloaterCamera::onAvatarEditingAppearance(bool editing)
 	floater_camera->handleAvatarEditingAppearance(editing);
 }
 
-void LLFloaterCamera::handleAvatarEditingAppearance(bool editing)
+// static
+void LLFloaterCamera::onDebugCameraToggled()
 {
+    if (LLFloaterCamera* instance = LLFloaterCamera::findInstance())
+    {
+        instance->showDebugInfo(LLView::sDebugCamera);
+    }
 
+    if (LLView::sDebugCamera)
+    {
+        LLFloaterReg::showInstanceOrBringToFront("camera");
+    }
+}
+
+void LLFloaterCamera::showDebugInfo(bool show)
+{
+    // Initially LLPanel contains 1 child "view_border"
+    if (show && mViewerCameraInfo->getChildCount() < 2)
+    {
+        mViewerCameraInfo->addChild(new LLCameraInfoPanel(mViewerCameraInfo, "Viewer Camera", *LLViewerCamera::getInstance(),
+            []() { return LLViewerCamera::getInstance()->getPointOfInterest(); }));
+        mAgentCameraInfo->addChild(new LLCameraInfoPanel(mAgentCameraInfo, "Agent Camera", gAgent.getFrameAgent(),
+            []() { return gAgent.getPosAgentFromGlobal(gAgentCamera.calcFocusPositionTargetGlobal()); }));
+    }
+
+    mAgentCameraInfo->setVisible(show);
+    mViewerCameraInfo->setVisible(show);
+}
+
+void LLFloaterCamera::handleAvatarEditingAppearance(bool editing)
+{
 }
 
 void LLFloaterCamera::update()
 {
 	ECameraControlMode mode = determineMode();
-	if (mode != mCurrMode) setMode(mode);
+	if (mode != mCurrMode)
+	{
+		setMode(mode);
+	}
 }
 
 
@@ -286,7 +394,8 @@ void LLFloaterCamera::toPrevMode()
 	switchMode(mPrevMode);
 }
 
-/*static*/ void LLFloaterCamera::onLeavingMouseLook()
+// static
+void LLFloaterCamera::onLeavingMouseLook()
 {
 	LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance();
 	if (floater_camera)
@@ -320,12 +429,14 @@ void LLFloaterCamera::onOpen(const LLSD& key)
 	mClosed = FALSE;
 
 	populatePresetCombo();
+
+	showDebugInfo(LLView::sDebugCamera);
 }
 
 void LLFloaterCamera::onClose(bool app_quitting)
 {
 	//We don't care of camera mode if app is quitting
-	if(app_quitting)
+	if (app_quitting)
 		return;
 	// It is necessary to reset mCurrMode to CAMERA_CTRL_MODE_PAN so 
 	// to avoid seeing an empty floater when reopening the control.
@@ -360,14 +471,18 @@ BOOL LLFloaterCamera::postBuild()
 {
 	updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
 
+	mControls = getChild<LLPanel>("controls");
+	mAgentCameraInfo = getChild<LLPanel>("agent_camera_info");
+	mViewerCameraInfo = getChild<LLPanel>("viewer_camera_info");
 	mRotate = getChild<LLJoystickCameraRotate>(ORBIT);
-	mZoom = findChild<LLPanelCameraZoom>(ZOOM);
+	mZoom = getChild<LLPanelCameraZoom>(ZOOM);
 	mTrack = getChild<LLJoystickCameraTrack>(PAN);
 	mPresetCombo = getChild<LLComboBox>("preset_combo");
+	mPreciseCtrls = getChild<LLTextBox>("precise_ctrs_label");
 
-	getChild<LLTextBox>("precise_ctrs_label")->setShowCursorHand(false);
-	getChild<LLTextBox>("precise_ctrs_label")->setSoundFlags(LLView::MOUSE_UP);
-	getChild<LLTextBox>("precise_ctrs_label")->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "prefs_view_advanced", LLSD(), FALSE));
+	mPreciseCtrls->setShowCursorHand(false);
+	mPreciseCtrls->setSoundFlags(LLView::MOUSE_UP);
+	mPreciseCtrls->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "prefs_view_advanced", LLSD(), FALSE));
 
 	mPresetCombo->setCommitCallback(boost::bind(&LLFloaterCamera::onCustomPresetSelected, this));
 	LLPresetsManager::getInstance()->setPresetListChangeCameraCallback(boost::bind(&LLFloaterCamera::populatePresetCombo, this));
@@ -507,6 +622,7 @@ void LLFloaterCamera::updateItemsSelection()
 	getChild<LLPanelCameraItem>("object_view")->setValue(argument);
 }
 
+// static
 void LLFloaterCamera::onClickCameraItem(const LLSD& param)
 {
 	std::string name = param.asString();
@@ -533,7 +649,7 @@ void LLFloaterCamera::onClickCameraItem(const LLSD& param)
 	}
 }
 
-/*static*/
+// static
 void LLFloaterCamera::switchToPreset(const std::string& name)
 {
 	sFreeCamera = false;
diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h
index a69b87ad1626a6ffa1b72b8d413f072e824d5bd7..f31bc5486bb38d15d1c652b25756e90bd1a663ab 100644
--- a/indra/newview/llfloatercamera.h
+++ b/indra/newview/llfloatercamera.h
@@ -63,6 +63,9 @@ class LLFloaterCamera : public LLFloater
 	/** Called when Avatar is entered/exited editing appearance mode */
 	static void onAvatarEditingAppearance(bool editing);
 
+	/** Called when opening and when "Advanced | Debug Camera" menu item is toggled */
+	static void onDebugCameraToggled();
+
 	/* determines actual mode and updates ui */
 	void update();
 
@@ -77,9 +80,9 @@ class LLFloaterCamera : public LLFloater
 
 	void populatePresetCombo();
 
-	LLJoystickCameraRotate* mRotate;
-	LLPanelCameraZoom*	mZoom;
-	LLJoystickCameraTrack*	mTrack;
+	LLJoystickCameraRotate* mRotate { nullptr };
+	LLPanelCameraZoom* mZoom { nullptr };
+	LLJoystickCameraTrack* mTrack { nullptr };
 
 private:
 
@@ -117,6 +120,8 @@ class LLFloaterCamera : public LLFloater
 
 	void handleAvatarEditingAppearance(bool editing);
 
+	void showDebugInfo(bool show);
+
 	// set to true when free camera mode is selected in modes list
 	// remains true until preset camera mode is chosen, or pan button is clicked, or escape pressed
 	static bool sFreeCamera;
@@ -126,7 +131,11 @@ class LLFloaterCamera : public LLFloater
 	ECameraControlMode mCurrMode;
 	std::map<ECameraControlMode, LLButton*> mMode2Button;
 
-	LLComboBox* mPresetCombo;
+	LLPanel* mControls { nullptr };
+	LLPanel* mViewerCameraInfo { nullptr };
+	LLPanel* mAgentCameraInfo { nullptr };
+	LLComboBox* mPresetCombo { nullptr };
+	LLTextBox* mPreciseCtrls { nullptr };
 };
 
 /**
diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp
index 2d5e86869d8393e0bc4e5fa27f78892e32eae7fd..fa51143f3a62e5eb8b57a64431df29d1c81a246d 100644
--- a/indra/newview/llfloatereditsky.cpp
+++ b/indra/newview/llfloatereditsky.cpp
@@ -84,7 +84,7 @@ BOOL LLFloaterEditSky::postBuild()
 	mSkyPresetCombo = getChild<LLComboBox>("sky_preset_combo");
 	mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb");
 	mSaveButton = getChild<LLButton>("save");
-    mSkyAdapter = boost::make_shared<LLSkySettingsAdapter>();
+    mSkyAdapter = std::make_shared<LLSkySettingsAdapter>();
 
     LLEnvironment::instance().setSkyListChange(boost::bind(&LLFloaterEditSky::onSkyPresetListChange, this));
 
diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp
index c44ae7faca97eef87ea67159c6aa57fc0731ed13..4a6268435b9b6dfb2ad17aa0ddc5725f541022b4 100644
--- a/indra/newview/llfloatereditwater.cpp
+++ b/indra/newview/llfloatereditwater.cpp
@@ -71,7 +71,7 @@ BOOL LLFloaterEditWater::postBuild()
 	mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb");
 	mSaveButton = getChild<LLButton>("save");
 
-    mWaterAdapter = boost::make_shared<LLWatterSettingsAdapter>();
+    mWaterAdapter = std::make_shared<LLWatterSettingsAdapter>();
 
     LLEnvironment::instance().setWaterListChange(boost::bind(&LLFloaterEditWater::onWaterPresetListChange, this));
 
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 635aee64ff2b8f5bca96940704b7c61d634d6912..44938d550974e38d0fb8275450282a91ca3763a8 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -57,7 +57,6 @@
 #include "llsdserialize.h"
 #include "llviewermenu.h" // is_agent_mappable
 #include "llviewerobjectlist.h"
-#include "boost/foreach.hpp"
 
 
 const S32 EVENTS_PER_IDLE_LOOP_CURRENT_SESSION = 80;
@@ -805,12 +804,11 @@ void LLFloaterIMContainer::setVisible(BOOL visible)
 
 void LLFloaterIMContainer::getDetachedConversationFloaters(floater_list_t& floaters)
 {
-	typedef conversations_widgets_map::value_type conv_pair;
 	LLFloaterIMNearbyChat *nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat");
 
-	BOOST_FOREACH(conv_pair item, mConversationsWidgets)
+	for (const auto& [key, fvi] : mConversationsWidgets)
 	{
-		LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(item.second);
+		LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(fvi);
 		if (widget)
 		{
 			LLFloater* session_floater = widget->getSessionFloater();
diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp
index eb7bd843d31588b6ab7901ec5f6dc39a75f76abe..dfee4096fe4c86a6fc79065503f80f13c47ca579 100644
--- a/indra/newview/llfloaterimnearbychathandler.cpp
+++ b/indra/newview/llfloaterimnearbychathandler.cpp
@@ -453,7 +453,7 @@ void LLFloaterIMNearbyChatScreenChannel::arrangeToasts()
 //-----------------------------------------------------------------------------------------------
 //LLFloaterIMNearbyChatHandler
 //-----------------------------------------------------------------------------------------------
-boost::scoped_ptr<LLEventPump> LLFloaterIMNearbyChatHandler::sChatWatcher(new LLEventStream("LLChat"));
+std::unique_ptr<LLEventPump> LLFloaterIMNearbyChatHandler::sChatWatcher(new LLEventStream("LLChat"));
 
 LLFloaterIMNearbyChatHandler::LLFloaterIMNearbyChatHandler()
 {
diff --git a/indra/newview/llfloaterimnearbychathandler.h b/indra/newview/llfloaterimnearbychathandler.h
index 5e6f8cde305c704e1e18872d884d46f414a06a7b..18496044701cd9866c2e8aa8433d17b0d8df930c 100644
--- a/indra/newview/llfloaterimnearbychathandler.h
+++ b/indra/newview/llfloaterimnearbychathandler.h
@@ -46,7 +46,7 @@ class LLFloaterIMNearbyChatHandler : public LLChatHandler
 protected:
 	virtual void initChannel();
 
-	static boost::scoped_ptr<LLEventPump> sChatWatcher;
+	static std::unique_ptr<LLEventPump> sChatWatcher;
 };
 
 }
diff --git a/indra/newview/llfloaterinventorythumbnailshelper.cpp b/indra/newview/llfloaterinventorythumbnailshelper.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..814f88e9b99a9a0002f09425a1570a764ea1f48e
--- /dev/null
+++ b/indra/newview/llfloaterinventorythumbnailshelper.cpp
@@ -0,0 +1,543 @@
+/**
+ * @file llfloaterinventorythumbnailshelper.cpp
+ * @author Callum Prentice
+ * @brief LLFloaterInventoryThumbnailsHelper class implementation
+ *
+ * Usage instructions and some brief notes can be found in Confluence here:
+ * https://lindenlab.atlassian.net/wiki/spaces/~174746736/pages/2928672843/Inventory+Thumbnail+Helper+Tool
+ *
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llaisapi.h"
+#include "llclipboard.h"
+#include "llinventoryfunctions.h"
+#include "llinventorymodel.h"
+#include "llnotifications.h"
+#include "llnotificationsutil.h"
+#include "llscrolllistctrl.h"
+#include "lltexteditor.h"
+#include "lluictrlfactory.h"
+#include "lluuid.h"
+
+#include "llfloaterinventorythumbnailshelper.h"
+
+LLFloaterInventoryThumbnailsHelper::LLFloaterInventoryThumbnailsHelper(const LLSD& key)
+    :   LLFloater("floater_inventory_thumbnails_helper")
+{
+}
+
+LLFloaterInventoryThumbnailsHelper::~LLFloaterInventoryThumbnailsHelper()
+{
+}
+
+BOOL LLFloaterInventoryThumbnailsHelper::postBuild()
+{
+    mInventoryThumbnailsList = getChild<LLScrollListCtrl>("inventory_thumbnails_list");
+    mInventoryThumbnailsList->setAllowMultipleSelection(true);
+
+    mOutputLog = getChild<LLTextEditor>("output_log");
+    mOutputLog->setMaxTextLength(0xffff * 0x10);
+
+    mPasteItemsBtn = getChild<LLUICtrl>("paste_items_btn");
+    mPasteItemsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onPasteItems, this));
+    mPasteItemsBtn->setEnabled(true);
+
+    mPasteTexturesBtn = getChild<LLUICtrl>("paste_textures_btn");
+    mPasteTexturesBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onPasteTextures, this));
+    mPasteTexturesBtn->setEnabled(true);
+
+    mWriteThumbnailsBtn = getChild<LLUICtrl>("write_thumbnails_btn");
+    mWriteThumbnailsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onWriteThumbnails, this));
+    mWriteThumbnailsBtn->setEnabled(false);
+
+    mLogMissingThumbnailsBtn = getChild<LLUICtrl>("log_missing_thumbnails_btn");
+    mLogMissingThumbnailsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onLogMissingThumbnails, this));
+    mLogMissingThumbnailsBtn->setEnabled(false);
+
+    mClearThumbnailsBtn = getChild<LLUICtrl>("clear_thumbnails_btn");
+    mClearThumbnailsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onClearThumbnails, this));
+    mClearThumbnailsBtn->setEnabled(false);
+
+    return true;
+}
+
+// Records an entry in the pasted items - saves it to a map and writes it to the log
+// window for later confirmation/validation - since it uses a map, duplicates (based on
+// the name) are discarded
+void LLFloaterInventoryThumbnailsHelper::recordInventoryItemEntry(LLViewerInventoryItem* item)
+{
+    const std::string name = item->getName();
+
+    std::map<std::string, LLViewerInventoryItem*>::iterator iter = mItemNamesItems.find(name);
+    if (iter == mItemNamesItems.end())
+    {
+        mItemNamesItems.insert({name, item});
+
+        writeToLog(
+            STRINGIZE(
+                "ITEM " << mItemNamesItems.size() << "> " <<
+                name <<
+                std::endl
+            ), false);
+    }
+    else
+    {
+        // dupe - do not save
+    }
+}
+
+// Called when the user has copied items from their inventory and selects the Paste Items button
+// in the UI - iterates over items and folders and saves details of each one.
+// The first use of this tool is for updating NUX items and as such, only looks for OBJECTS,
+// CLOTHING and BODYPARTS - later versions of this tool should make that selection editable.
+void LLFloaterInventoryThumbnailsHelper::onPasteItems()
+{
+    if (!LLClipboard::instance().hasContents())
+    {
+        return;
+    }
+
+    writeToLog(
+        STRINGIZE(
+            "\n==== Pasting items from inventory ====" <<
+            std::endl
+        ), false);
+
+    std::vector<LLUUID> objects;
+    LLClipboard::instance().pasteFromClipboard(objects);
+    size_t count = objects.size();
+
+    for (size_t i = 0; i < count; i++)
+    {
+        const LLUUID& entry = objects.at(i);
+
+        // Check for a folder
+        const LLInventoryCategory* cat = gInventory.getCategory(entry);
+        if (cat)
+        {
+            LLInventoryModel::cat_array_t cat_array;
+            LLInventoryModel::item_array_t item_array;
+
+            LLIsType is_object(LLAssetType::AT_OBJECT);
+            gInventory.collectDescendentsIf(cat->getUUID(),
+                                            cat_array,
+                                            item_array,
+                                            LLInventoryModel::EXCLUDE_TRASH,
+                                            is_object);
+
+            LLIsType is_bodypart(LLAssetType::AT_BODYPART);
+            gInventory.collectDescendentsIf(cat->getUUID(),
+                                            cat_array,
+                                            item_array,
+                                            LLInventoryModel::EXCLUDE_TRASH,
+                                            is_bodypart);
+
+            LLIsType is_clothing(LLAssetType::AT_CLOTHING);
+            gInventory.collectDescendentsIf(cat->getUUID(),
+                                            cat_array,
+                                            item_array,
+                                            LLInventoryModel::EXCLUDE_TRASH,
+                                            is_clothing);
+
+            for (size_t i = 0; i < item_array.size(); i++)
+            {
+                LLViewerInventoryItem* item = item_array.at(i);
+                recordInventoryItemEntry(item);
+            }
+        }
+
+        // Check for an item
+        LLViewerInventoryItem* item = gInventory.getItem(entry);
+        if (item)
+        {
+            const LLAssetType::EType item_type = item->getType();
+            if (item_type == LLAssetType::AT_OBJECT || item_type == LLAssetType::AT_BODYPART || item_type == LLAssetType::AT_CLOTHING)
+            {
+                recordInventoryItemEntry(item);
+            }
+        }
+    }
+
+    // update the main list view based on what we found
+    updateDisplayList();
+
+    // update the buttons enabled state based on what we found/saved
+    updateButtonStates();
+}
+
+// Records a entry in the pasted textures - saves it to a map and writes it to the log
+// window for later confirmation/validation - since it uses a map, duplicates (based on
+// the name) are discarded
+void LLFloaterInventoryThumbnailsHelper::recordTextureItemEntry(LLViewerInventoryItem* item)
+{
+    const std::string name = item->getName();
+
+    std::map<std::string, LLUUID>::iterator iter = mTextureNamesIDs.find(name);
+    if (iter == mTextureNamesIDs.end())
+    {
+        LLUUID id = item->getAssetUUID();
+        mTextureNamesIDs.insert({name, id});
+
+        writeToLog(
+            STRINGIZE(
+                "TEXTURE " << mTextureNamesIDs.size() << "> " <<
+                name <<
+                //" | " <<
+                //id.asString() <<
+                std::endl
+            ), false);
+    }
+    else
+    {
+        // dupe - do not save
+    }
+}
+
+// Called when the user has copied textures from their inventory and selects the Paste Textures
+// button in the UI - iterates over textures and folders and saves details of each one.
+void LLFloaterInventoryThumbnailsHelper::onPasteTextures()
+{
+    if (!LLClipboard::instance().hasContents())
+    {
+        return;
+    }
+
+    writeToLog(
+        STRINGIZE(
+            "\n==== Pasting textures from inventory ====" <<
+            std::endl
+        ), false);
+
+    std::vector<LLUUID> objects;
+    LLClipboard::instance().pasteFromClipboard(objects);
+    size_t count = objects.size();
+
+    for (size_t i = 0; i < count; i++)
+    {
+        const LLUUID& entry = objects.at(i);
+
+        const LLInventoryCategory* cat = gInventory.getCategory(entry);
+        if (cat)
+        {
+            LLInventoryModel::cat_array_t cat_array;
+            LLInventoryModel::item_array_t item_array;
+
+            LLIsType is_object(LLAssetType::AT_TEXTURE);
+            gInventory.collectDescendentsIf(cat->getUUID(),
+                                            cat_array,
+                                            item_array,
+                                            LLInventoryModel::EXCLUDE_TRASH,
+                                            is_object);
+
+            for (size_t i = 0; i < item_array.size(); i++)
+            {
+                LLViewerInventoryItem* item = item_array.at(i);
+                recordTextureItemEntry(item);
+            }
+        }
+
+        LLViewerInventoryItem* item = gInventory.getItem(entry);
+        if (item)
+        {
+            const LLAssetType::EType item_type = item->getType();
+            if (item_type == LLAssetType::AT_TEXTURE)
+            {
+                recordTextureItemEntry(item);
+            }
+        }
+    }
+
+    // update the main list view based on what we found
+    updateDisplayList();
+
+    // update the buttons enabled state based on what we found/saved
+    updateButtonStates();
+}
+
+// Updates the main list of entries in the UI based on what is in the maps/storage
+void LLFloaterInventoryThumbnailsHelper::updateDisplayList()
+{
+    mInventoryThumbnailsList->deleteAllItems();
+
+    std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin();
+    while (item_iter != mItemNamesItems.end())
+    {
+        std::string item_name = (*item_iter).first;
+
+        std::string existing_texture_name = std::string();
+        LLUUID existing_thumbnail_id = (*item_iter).second->getThumbnailUUID();
+        if (existing_thumbnail_id != LLUUID::null)
+        {
+            existing_texture_name = existing_thumbnail_id.asString();
+        }
+        else
+        {
+            existing_texture_name = "none";
+        }
+
+        std::string new_texture_name = std::string();
+        std::map<std::string, LLUUID>::iterator texture_iter = mTextureNamesIDs.find(item_name);
+        if (texture_iter != mTextureNamesIDs.end())
+        {
+            new_texture_name = (*texture_iter).first;
+        }
+        else
+        {
+            new_texture_name = "missing";
+        }
+
+        LLSD row;
+        row["columns"][EListColumnNum::NAME]["column"] = "item_name";
+        row["columns"][EListColumnNum::NAME]["type"] = "text";
+        row["columns"][EListColumnNum::NAME]["value"] = item_name;
+        row["columns"][EListColumnNum::NAME]["font"]["name"] = "Monospace";
+
+        row["columns"][EListColumnNum::EXISTING_TEXTURE]["column"] = "existing_texture";
+        row["columns"][EListColumnNum::EXISTING_TEXTURE]["type"] = "text";
+        row["columns"][EListColumnNum::EXISTING_TEXTURE]["font"]["name"] = "Monospace";
+        row["columns"][EListColumnNum::EXISTING_TEXTURE]["value"] = existing_texture_name;
+
+        row["columns"][EListColumnNum::NEW_TEXTURE]["column"] = "new_texture";
+        row["columns"][EListColumnNum::NEW_TEXTURE]["type"] = "text";
+        row["columns"][EListColumnNum::NEW_TEXTURE]["font"]["name"] = "Monospace";
+        row["columns"][EListColumnNum::NEW_TEXTURE]["value"] = new_texture_name;
+
+        mInventoryThumbnailsList->addElement(row);
+
+        ++item_iter;
+    }
+}
+
+#if 1
+// *TODO$: LLInventoryCallback should be deprecated to conform to the new boost::bind/coroutine model.
+// temp code in transition
+void inventoryThumbnailsHelperCb(LLPointer<LLInventoryCallback> cb, LLUUID id)
+{
+    if (cb.notNull())
+    {
+        cb->fire(id);
+    }
+}
+#endif
+
+// Makes calls to the AIS v3 API to record the local changes made to the thumbnails.
+// If this is not called, the operations (e.g. set thumbnail or clear thumbnail)
+// appear to work but do not push the changes back to the inventory (local cache view only)
+bool writeInventoryThumbnailID(LLUUID item_id, LLUUID thumbnail_asset_id)
+{
+    if (AISAPI::isAvailable())
+    {
+
+        LLSD updates;
+        updates["thumbnail"] = LLSD().with("asset_id", thumbnail_asset_id.asString());
+
+        LLPointer<LLInventoryCallback> cb;
+
+        AISAPI::completion_t cr = boost::bind(&inventoryThumbnailsHelperCb, cb, _1);
+        AISAPI::UpdateItem(item_id, updates, cr);
+
+        return true;
+    }
+    else
+    {
+        LL_WARNS() << "Unable to write inventory thumbnail because the AIS API is not available" << LL_ENDL;
+        return false;
+    }
+}
+
+// Called when the Write Thumbanils button is pushed. Iterates over the name/item and
+// name/.texture maps and where it finds a common name, extracts what is needed and
+// writes the thumbnail accordingly.
+void LLFloaterInventoryThumbnailsHelper::onWriteThumbnails()
+{
+    // create and show confirmation (Yes/No) textbox since this is a destructive operation
+    LLNotificationsUtil::add("WriteInventoryThumbnailsWarning", LLSD(), LLSD(),
+                             [&](const LLSD & notif, const LLSD & resp)
+    {
+        S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp);
+        if (opt == 0)
+        {
+            std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin();
+            while (item_iter != mItemNamesItems.end())
+            {
+                std::string item_name = (*item_iter).first;
+
+                std::map<std::string, LLUUID>::iterator texture_iter = mTextureNamesIDs.find(item_name);
+                if (texture_iter != mTextureNamesIDs.end())
+                {
+                    LLUUID item_id = (*item_iter).second->getUUID();
+
+                    LLUUID thumbnail_asset_id = (*texture_iter).second;
+
+                    writeToLog(
+                        STRINGIZE(
+                            "WRITING THUMB " <<
+                            (*item_iter).first <<
+                            "\n" <<
+                            "item ID: " <<
+                            item_id <<
+                            "\n" <<
+                            "thumbnail texture ID: " <<
+                            thumbnail_asset_id <<
+                            "\n"
+                        ), true);
+
+
+                    (*item_iter).second->setThumbnailUUID(thumbnail_asset_id);
+
+                    // This additional step (notifying AIS API) is required
+                    // to make the changes persist outside of the local cache
+                    writeInventoryThumbnailID(item_id, thumbnail_asset_id);
+                }
+
+                ++item_iter;
+            }
+
+            updateDisplayList();
+        }
+        else
+        {
+            LL_INFOS() << "Writing new thumbnails was canceled" << LL_ENDL;
+        }
+    });
+}
+
+// Called when the Log Items with Missing Thumbnails is selected. This merely writes
+// a list of all the items for which the thumbnail ID is Null. Typical use case is to
+// copy from the log window, pasted to Slack to illustrate which items are missing
+// a thumbnail
+void LLFloaterInventoryThumbnailsHelper::onLogMissingThumbnails()
+{
+    std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin();
+    while (item_iter != mItemNamesItems.end())
+    {
+        LLUUID thumbnail_id = (*item_iter).second->getThumbnailUUID();
+
+        if (thumbnail_id == LLUUID::null)
+        {
+            writeToLog(
+                STRINGIZE(
+                    "Missing thumbnail: " <<
+                    (*item_iter).first <<
+                    std::endl
+                ), true);
+        }
+
+        ++item_iter;
+    }
+}
+
+// Called when the Clear Thumbnail button is selected.  Code to perform the clear (really
+// just writing a NULL UUID into the thumbnail field) is behind an "Are you Sure?" dialog
+// since it cannot be undone and potentinally, you could remove the thumbnails from your
+// whole inventory this way.
+void LLFloaterInventoryThumbnailsHelper::onClearThumbnails()
+{
+    // create and show confirmation (Yes/No) textbox since this is a destructive operation
+    LLNotificationsUtil::add("ClearInventoryThumbnailsWarning", LLSD(), LLSD(),
+                             [&](const LLSD & notif, const LLSD & resp)
+    {
+        S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp);
+        if (opt == 0)
+        {
+            std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin();
+            while (item_iter != mItemNamesItems.end())
+            {
+                (*item_iter).second->setThumbnailUUID(LLUUID::null);
+
+                // This additional step (notifying AIS API) is required
+                // to make the changes persist outside of the local cache
+                const LLUUID item_id = (*item_iter).second->getUUID();
+                writeInventoryThumbnailID(item_id, LLUUID::null);
+
+                ++item_iter;
+            }
+
+            updateDisplayList();
+        }
+        else
+        {
+            LL_INFOS() << "Clearing on thumbnails was canceled" << LL_ENDL;
+        }
+    });
+}
+
+// Update the endabled state of some of the UI buttons based on what has
+// been recorded so far.  For example, if there are no valid item/texture pairs,
+// then the Write Thumbnails button is not enabled.
+void LLFloaterInventoryThumbnailsHelper::updateButtonStates()
+{
+    size_t found_count = 0;
+
+    std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin();
+    while (item_iter != mItemNamesItems.end())
+    {
+        std::string item_name = (*item_iter).first;
+
+        std::map<std::string, LLUUID>::iterator texture_iter = mTextureNamesIDs.find(item_name);
+        if (texture_iter != mTextureNamesIDs.end())
+        {
+            found_count++;
+        }
+
+        ++item_iter;
+    }
+
+    // the "Write Thumbnails" button is only enabled when there is at least one
+    // item with a matching texture ready to be written to the thumbnail field
+    if (found_count > 0)
+    {
+        mWriteThumbnailsBtn->setEnabled(true);
+    }
+    else
+    {
+        mWriteThumbnailsBtn->setEnabled(false);
+    }
+
+    // The "Log Missing Items" and "Clear Thumbnails" buttons are only enabled
+    // when there is at least 1 item that was pasted from inventory (doesn't need
+    // to have a matching texture for these operations)
+    if (mItemNamesItems.size() > 0)
+    {
+        mLogMissingThumbnailsBtn->setEnabled(true);
+        mClearThumbnailsBtn->setEnabled(true);
+    }
+    else
+    {
+        mLogMissingThumbnailsBtn->setEnabled(false);
+        mClearThumbnailsBtn->setEnabled(false);
+    }
+}
+
+// Helper function for writing a line to the log window. Currently the only additional
+// feature is that it scrolls to the bottom each time a line is written but it
+// is envisaged that other common actions will be added here eventually - E.G. write eavh
+// line to the Second Life log too for example.
+void LLFloaterInventoryThumbnailsHelper::writeToLog(std::string logline, bool prepend_newline)
+{
+    mOutputLog->appendText(logline, prepend_newline);
+
+    mOutputLog->setCursorAndScrollToEnd();
+}
diff --git a/indra/newview/llfloaterinventorythumbnailshelper.h b/indra/newview/llfloaterinventorythumbnailshelper.h
new file mode 100644
index 0000000000000000000000000000000000000000..b42a85d1a56fac71e729946c4464515f77a196ab
--- /dev/null
+++ b/indra/newview/llfloaterinventorythumbnailshelper.h
@@ -0,0 +1,82 @@
+/**
+ * @file llfloaterinventorythumbnailshelper.h
+ * @author Callum Prentice
+ * @brief Helper floater for bulk processing of inventory thumbnails tool
+ *
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLFLOATERINVENTORYTHUMBNAILSHELPER_H
+#define LL_LLFLOATERINVENTORYTHUMBNAILSHELPER_H
+
+#include "llfloater.h"
+class LLTextEditor;
+class LLScrollListCtrl;
+class LLViewerInventoryItem;
+class LLUUID;
+
+class LLFloaterInventoryThumbnailsHelper:
+    public LLFloater
+{
+        friend class LLFloaterReg;
+    private:
+        LLFloaterInventoryThumbnailsHelper(const LLSD& key);
+        BOOL postBuild() override;
+        ~LLFloaterInventoryThumbnailsHelper();
+
+        LLScrollListCtrl* mInventoryThumbnailsList;
+
+        LLTextEditor* mOutputLog;
+
+        LLUICtrl* mPasteItemsBtn;
+        void onPasteItems();
+
+        LLUICtrl* mPasteTexturesBtn;
+        void onPasteTextures();
+
+        LLUICtrl* mWriteThumbnailsBtn;
+        void onWriteThumbnails();
+
+        LLUICtrl* mLogMissingThumbnailsBtn;
+        void onLogMissingThumbnails();
+
+        LLUICtrl* mClearThumbnailsBtn;
+        void onClearThumbnails();
+
+        void recordInventoryItemEntry(LLViewerInventoryItem* item);
+        void recordTextureItemEntry(LLViewerInventoryItem* item);
+        void updateButtonStates();
+        void updateDisplayList();
+        void writeToLog(std::string logline, bool prepend_newline);
+
+        std::map<std::string, LLViewerInventoryItem*> mItemNamesItems;
+        std::map<std::string, LLUUID> mTextureNamesIDs;
+
+        enum EListColumnNum
+        {
+            NAME = 0,
+            EXISTING_TEXTURE = 1,
+            NEW_TEXTURE = 2
+        };
+};
+
+#endif // LL_LLFLOATERINVENTORYTHUMBNAILSHELPER_H
diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp
index 71b3b16809743e5a2c7525dda75881ff5b6c56a6..6216f4e39ab7e7762e4835efd4c1c12f65a09ace 100644
--- a/indra/newview/llfloatermarketplacelistings.cpp
+++ b/indra/newview/llfloatermarketplacelistings.cpp
@@ -183,7 +183,8 @@ void LLPanelMarketplaceListings::draw()
     // Get the audit button enabled only after the whole inventory is fetched
     if (!mAuditBtn->getEnabled())
     {
-        mAuditBtn->setEnabled(LLInventoryModelBackgroundFetch::instance().isEverythingFetched());
+        LLInventoryModelBackgroundFetch* inst = LLInventoryModelBackgroundFetch::getInstance();
+        mAuditBtn->setEnabled(inst->isEverythingFetched() && !inst->folderFetchActive());
     }
     
 	LLPanel::draw();
@@ -410,8 +411,14 @@ BOOL LLFloaterMarketplaceListings::postBuild()
 	mCategoryAddedObserver = new LLMarketplaceListingsAddedObserver(this);
 	gInventory.addObserver(mCategoryAddedObserver);
 	
-    // Fetch aggressively so we can interact with listings right onOpen()
-	fetchContents();
+
+    // Fetch aggressively so we can interact with listings as soon as possible
+    if (!fetchContents())
+    {
+        const LLUUID& marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS);
+        LLInventoryModelBackgroundFetch::instance().start(marketplacelistings_id, true);
+    }
+	
 
 	return TRUE;
 }
@@ -440,17 +447,19 @@ void LLFloaterMarketplaceListings::onFocusReceived()
 	updateView();
 }
 
-void LLFloaterMarketplaceListings::fetchContents()
+bool LLFloaterMarketplaceListings::fetchContents()
 {
-	if (mRootFolderId.notNull() &&
+    if (mRootFolderId.notNull() &&
         (LLMarketplaceData::instance().getSLMDataFetched() != MarketplaceFetchCodes::MARKET_FETCH_LOADING) &&
         (LLMarketplaceData::instance().getSLMDataFetched() != MarketplaceFetchCodes::MARKET_FETCH_DONE))
-	{
+    {
         LLMarketplaceData::instance().setDataFetchedSignal(boost::bind(&LLFloaterMarketplaceListings::updateView, this));
         LLMarketplaceData::instance().setSLMDataFetched(MarketplaceFetchCodes::MARKET_FETCH_LOADING);
-		LLInventoryModelBackgroundFetch::instance().start(mRootFolderId, true);
+        LLInventoryModelBackgroundFetch::instance().start(mRootFolderId, true);
         LLMarketplaceData::instance().getSLMListings();
-	}
+        return true;
+    }
+    return false;
 }
 
 void LLFloaterMarketplaceListings::setRootFolder()
diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h
index 085e517a9d5ff65c7bba6e542bb3eeb606f940ff..78d43f97a9ceeb0f14f439dbc20f55031f8fec40 100644
--- a/indra/newview/llfloatermarketplacelistings.h
+++ b/indra/newview/llfloatermarketplacelistings.h
@@ -114,8 +114,8 @@ class LLFloaterMarketplaceListings : public LLFloater
 protected:
 	void setRootFolder();
 	void setPanels();
-	void fetchContents();
-    
+    bool fetchContents();
+
 	void setStatusString(const std::string& statusString);
 
 	void onClose(bool app_quitting);
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index b65d7279485503fc4b15e229eea6d5fb5fc66d54..a3e173398f6cfe94c35765624de8e2b14b84f190 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1017,7 +1017,6 @@ void LLFloaterPreference::onBtnCancel(const LLSD& userdata)
 	if (userdata.asString() == "closeadvanced")
 	{
 		LLFloaterReg::hideInstance("prefs_graphics_advanced");
-		updateMaxComplexity();
 	}
 	else
 	{
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp
index db69c3e2c37c63045ac2eab033324628f3949966..553d09bec24be860614030f7226a85fa48c682b2 100644
--- a/indra/newview/llfloateruipreview.cpp
+++ b/indra/newview/llfloateruipreview.cpp
@@ -158,7 +158,7 @@ class LLFloaterUIPreview : public LLFloater
 
 	// typedef std::map<std::string,std::pair<std::list<std::string>,std::list<std::string> > > DiffMap; // this version copies the lists etc., and thus is bad memory-wise
 	typedef std::list<std::string> StringList;
-	typedef boost::shared_ptr<StringList> StringListPtr;
+	typedef std::shared_ptr<StringList> StringListPtr;
 	typedef std::map<std::string, std::pair<StringListPtr,StringListPtr> > DiffMap;
 	DiffMap mDiffsMap;							// map, of filename to pair of list of changed element paths and list of errors
 
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index c8559fc9d3cc349158cd379d42139d30a659d6c6..62e4022ddbd0ae7ad7279fd4a9df3d6a1fd55dab 100755
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -327,6 +327,7 @@ void* LLFloaterWorldMap::createWorldMapView(void* data)
 BOOL LLFloaterWorldMap::postBuild()
 {
     mMapView = dynamic_cast<LLWorldMapView*>(getChild<LLPanel>("objects_mapview"));
+    mMapView->setPan(0, 0, true);
 	
 	LLComboBox *avatar_combo = getChild<LLComboBox>("friend combo");
 	avatar_combo->selectFirstItem();
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 61a01d7418d383b79d0389998d2135e7f414575c..ce4a032b27b3e41752c3201004f336884fd1fae3 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -3162,9 +3162,11 @@ void LLIMMgr::addMessage(
             // Fetch group chat history, enabled by default.
             if (gSavedPerAccountSettings.getBOOL("FetchGroupChatHistory"))
             {
-                std::string chat_url = gAgent.getRegion()->getCapability("ChatSessionRequest");
-                LLCoros::instance().launch("chatterBoxHistoryCoro",
-                    boost::bind(&chatterBoxHistoryCoro, chat_url, session_id, from, msg, timestamp));
+                std::string chat_url = gAgent.getRegionCapability("ChatSessionRequest");
+                if (!chat_url.empty())
+                {
+                    LLCoros::instance().launch("chatterBoxHistoryCoro", boost::bind(&chatterBoxHistoryCoro, chat_url, session_id, from, msg, timestamp));
+                }
             }
 
 			//Play sound for new conversations
diff --git a/indra/newview/llinspecttexture.cpp b/indra/newview/llinspecttexture.cpp
index da4e3c0949f327b874c052dae15f56cb1b20723e..76e428b7d00af2dc737ee2a9c526fa88544339de 100644
--- a/indra/newview/llinspecttexture.cpp
+++ b/indra/newview/llinspecttexture.cpp
@@ -84,7 +84,10 @@ LLToolTip* LLInspectTextureUtil::createInventoryToolTip(LLToolTip::Params p)
                         }
                     }
 				}
-
+                if ((!p.message.isProvided() || p.message().empty())) 
+                {
+                    return NULL;
+                }
 				// No or more than one texture found => show default tooltip
 				return LLUICtrlFactory::create<LLToolTip>(p);
 			}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 7a9d0ff7a721dd29f3faafacd1dae4b425a41f7f..ddb69cdfb3f97d67f1aaf18426cf83e0f1d9d6d1 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -2284,8 +2284,11 @@ BOOL LLFolderBridge::isItemMovable() const
 
 void LLFolderBridge::selectItem()
 {
-	// Have no fear: the first thing start() does is to test if everything for that folder has been fetched...
-	LLInventoryModelBackgroundFetch::instance().start(getUUID(), true);
+    LLViewerInventoryCategory* cat = gInventory.getCategory(getUUID());
+    if (cat)
+    {
+        cat->fetch();
+    }
 }
 
 void LLFolderBridge::buildDisplayName() const
@@ -2810,7 +2813,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
             is_movable = can_move_folder_to_marketplace(master_folder, dest_folder, inv_cat, tooltip_msg, bundle_size);
 		}
 
-		if (is_movable)
+		if (is_movable && !move_is_into_landmarks)
 		{
 			LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
 			is_movable = active_panel != NULL;
@@ -3027,7 +3030,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 	return accept;
 }
 
-void warn_move_inventory(LLViewerObject* object, boost::shared_ptr<LLMoveInv> move_inv)
+void warn_move_inventory(LLViewerObject* object, std::shared_ptr<LLMoveInv> move_inv)
 {
 	const char* dialog = NULL;
 	if (object->flagScripted())
@@ -3040,7 +3043,7 @@ void warn_move_inventory(LLViewerObject* object, boost::shared_ptr<LLMoveInv> mo
 	}
 
     static LLNotificationPtr notification_ptr;
-    static boost::shared_ptr<LLMoveInv> inv_ptr;
+    static std::shared_ptr<LLMoveInv> inv_ptr;
 
     // Notification blocks user from interacting with inventories so everything that comes after first message
     // is part of this message - don'r show it again
@@ -3153,7 +3156,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
 	if(drop && accept)
 	{
 		it = inventory_objects.begin();
-        boost::shared_ptr<LLMoveInv> move_inv(new LLMoveInv);
+        std::shared_ptr<LLMoveInv> move_inv(new LLMoveInv);
 		move_inv->mObjectID = object_id;
 		move_inv->mCategoryID = category_id;
 		move_inv->mCallback = callback;
@@ -5012,7 +5015,7 @@ LLFontGL::StyleFlags LLMarketplaceFolderBridge::getLabelStyle() const
 
 
 // helper stuff
-bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, boost::shared_ptr<LLMoveInv> move_inv)
+bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, std::shared_ptr<LLMoveInv> move_inv)
 {
 	LLFloaterOpenObject::LLCatAndWear* cat_and_wear = (LLFloaterOpenObject::LLCatAndWear* )move_inv->mUserData;
 	LLViewerObject* object = gObjectList.findObject(move_inv->mObjectID);
@@ -5486,7 +5489,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 		if (accept && drop)
 		{
             LLUUID item_id = inv_item->getUUID();
-            boost::shared_ptr<LLMoveInv> move_inv (new LLMoveInv());
+            std::shared_ptr<LLMoveInv> move_inv (new LLMoveInv());
 			move_inv->mObjectID = inv_item->getParentUUID();
 			two_uuids_t item_pair(mUUID, item_id);
 			move_inv->mMoveList.push_back(item_pair);
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 3cbbd68e516c9fbc2c2b0f91e01bf59735f027a9..6f06f3b36dac9a346e2d4b8c405f56e38a77e2fa 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -794,7 +794,7 @@ struct LLMoveInv
     void* mUserData;
 };
 
-void warn_move_inventory(LLViewerObject* object, boost::shared_ptr<LLMoveInv> move_inv);
-bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, boost::shared_ptr<LLMoveInv>);
+void warn_move_inventory(LLViewerObject* object, std::shared_ptr<LLMoveInv> move_inv);
+bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, std::shared_ptr<LLMoveInv>);
 
 #endif // LL_LLINVENTORYBRIDGE_H
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 7b4283e94d8b82031ac2e7ea72dab023c95d11be..332c6d3085be604cb9ba1bb9bbdb6554735a607e 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -202,12 +202,18 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
         && !LLInventoryModelBackgroundFetch::instance().inventoryFetchInProgress())
     {
         LLViewerInventoryCategory* cat = gInventory.getCategory(folder_id);
-        if ((!cat && folder_id.notNull()) || (cat && cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN))
+        if ((!cat && folder_id.notNull()))
         {
-            // At the moment background fetch only cares about VERSION_UNKNOWN,
-            // so do not check isCategoryComplete that compares descendant count
+            // Shouldn't happen? Server provides full list of folders on startup
             LLInventoryModelBackgroundFetch::instance().start(folder_id, false);
         }
+        else if (cat && cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)
+        {
+            // At the moment background fetch only cares about VERSION_UNKNOWN,
+            // so do not check isCategoryComplete that compares descendant count,
+            // but if that is nesesary, do a forced scheduleFolderFetch.
+            cat->fetch();
+        }
 	}
 
     if (!checkAgainstFilterThumbnails(folder_id))
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 7ddc0c18b2e50cb3420322a73b46239ccc23f08e..ea0566f5c474ea6cadbcb230673480b4722b150e 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -91,8 +91,6 @@
 #include "llvoavatarself.h"
 #include "llwearablelist.h"
 
-#include <boost/foreach.hpp>
-
 BOOL LLInventoryState::sWearNewClothing = FALSE;
 LLUUID LLInventoryState::sWearNewClothingTransactionID;
 std::list<LLUUID> LLInventoryAction::sMarketplaceFolders;
@@ -462,6 +460,13 @@ void copy_inventory_category(LLInventoryModel* model,
 	gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName(), func, cat->getThumbnailUUID());
 }
 
+void copy_cb(const LLUUID& dest_folder, const LLUUID& root_id)
+{
+    // Decrement the count in root_id since that one item won't be copied over
+    LLMarketplaceData::instance().decrementValidationWaiting(root_id);
+    update_folder_cb(dest_folder);
+};
+
 void copy_inventory_category_content(const LLUUID& new_cat_uuid, LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& root_copy_id, bool move_no_copy_items)
 {
 	model->notifyObservers();
@@ -480,12 +485,21 @@ void copy_inventory_category_content(const LLUUID& new_cat_uuid, LLInventoryMode
 		LLMarketplaceData::instance().setValidationWaiting(root_id, count_descendants_items(cat->getUUID()));
 	}
 
+    LLPointer<LLInventoryCallback> cb;
+    if (root_copy_id.isNull())
+    {
+        cb = new LLBoostFuncInventoryCallback(boost::bind(copy_cb, new_cat_uuid, root_id));
+    }
+    else
+    {
+        cb = new LLBoostFuncInventoryCallback(boost::bind(update_folder_cb, new_cat_uuid));
+    }
+
 	// Copy all the items
 	LLInventoryModel::item_array_t item_array_copy = *item_array;
 	for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++)
 	{
 		LLInventoryItem* item = *iter;
-		LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(update_folder_cb, new_cat_uuid));
 
 		if (item->getIsLinkType())
 		{
@@ -500,8 +514,11 @@ void copy_inventory_category_content(const LLUUID& new_cat_uuid, LLInventoryMode
 				LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *)item;
 				gInventory.changeItemParent(viewer_inv_item, new_cat_uuid, true);
 			}
-			// Decrement the count in root_id since that one item won't be copied over
-			LLMarketplaceData::instance().decrementValidationWaiting(root_id);
+            if (root_copy_id.isNull())
+            {
+                // Decrement the count in root_id since that one item won't be copied over
+                LLMarketplaceData::instance().decrementValidationWaiting(root_id);
+            }
 		}
 		else
 		{
@@ -2973,6 +2990,23 @@ bool get_selection_object_uuids(LLFolderView *root, uuid_vec_t& ids)
 void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root, const std::string& action, BOOL user_confirm)
 {
 	std::set<LLFolderViewItem*> selected_items = root->getSelectionList();
+    if (selected_items.empty()
+        && action != "wear"
+        && action != "wear_add"
+        && !isRemoveAction(action))
+    {
+        // Was item removed while user was checking menu?
+        // "wear" and removal exlusions are due to use of
+        // getInventorySelectedUUIDs() below
+        LL_WARNS("Inventory") << "Menu tried to operate on empty selection" << LL_ENDL;
+
+        if (("copy" == action) || ("cut" == action))
+        {
+            LLClipboard::instance().reset();
+        }
+
+        return;
+    }
     
     // Prompt the user and check for authorization for some marketplace active listing edits
 	if (user_confirm && (("delete" == action) || ("cut" == action) || ("rename" == action) || ("properties" == action) || ("task_properties" == action) || ("open" == action)))
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index d4ca58f778ac61833d03e1645ae0adf04e7344d7..230ee86fb720676ef48c2c9d36cbaaaa185f67a2 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -2419,17 +2419,22 @@ void LLInventoryGallery::startDrag()
         }
 
         const LLViewerInventoryCategory* cat = gInventory.getCategory(selected_id);        
-        if (cat && gInventory.isObjectDescendentOf(selected_id, gInventory.getRootFolderID())
-            && !LLFolderType::lookupIsProtectedType((cat)->getPreferredType()))
+        if (cat)
         {
-            if (cat->getOwnerID() == ALEXANDRIA_LINDEN_ID)
+            if (gInventory.isObjectDescendentOf(selected_id, gInventory.getLibraryRootFolderID()))
             {
                 src = LLToolDragAndDrop::SOURCE_LIBRARY;
+                EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(cat->getType());
+                types.push_back(type);
+                ids.push_back(selected_id);
+            }
+            else if (gInventory.isObjectDescendentOf(selected_id, gInventory.getRootFolderID())
+                && !LLFolderType::lookupIsProtectedType((cat)->getPreferredType()))
+            {
+                EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(cat->getType());
+                types.push_back(type);
+                ids.push_back(selected_id);
             }
-
-            EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(cat->getType());
-            types.push_back(type);
-            ids.push_back(selected_id);
         }
     }
     LLToolDragAndDrop::getInstance()->beginMultiDrag(types, ids, src);
@@ -3334,7 +3339,7 @@ BOOL dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, BOOL drop,
 
         if (accept && drop)
         {
-            boost::shared_ptr<LLMoveInv> move_inv (new LLMoveInv());
+            std::shared_ptr<LLMoveInv> move_inv (new LLMoveInv());
             move_inv->mObjectID = inv_item->getParentUUID();
             std::pair<LLUUID, LLUUID> item_pair(folder_id, inv_item->getUUID());
             move_inv->mMoveList.push_back(item_pair);
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 05aa2e423f3fda4b2f01e5375e2eaf6d74b410e5..205e5f348937d54c7bfea794bdce00c9a177c85a 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -3550,6 +3550,9 @@ void LLInventoryModel::processUpdateCreateInventoryItem(LLMessageSystem* msg, vo
 
 		gInventoryCallbacks.fire(callback_id, item_id);
 
+        // Message system at the moment doesn't support Thumbnails and potential
+        // newer features so just rerequest whole item
+        //
         // todo: instead of unpacking message fully,
         // grab only an item_id, then fetch
         LLInventoryModelBackgroundFetch::instance().scheduleItemFetch(item_id, true);
@@ -3912,19 +3915,22 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
 
 	for (cat_array_t::iterator cit = folders.begin(); cit != folders.end(); ++cit)
 	{
-		gInventory.updateCategory(*cit);
-
-        // Temporary workaround: just fetch the item using AIS to get missing fields.
-        // If this works fine we might want to extract ids only from the message
-        // then use AIS as a primary fetcher
-        LLInventoryModelBackgroundFetch::instance().scheduleFolderFetch((*cit)->getUUID(), true /*force, since it has changes*/);
+        gInventory.updateCategory(*cit);
+        if ((*cit)->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN)
+        {
+            // Temporary workaround: just fetch the item using AIS to get missing fields.
+            // If this works fine we might want to extract 'ids only' from the message
+            // then use AIS as a primary fetcher
+            LLInventoryModelBackgroundFetch::instance().scheduleFolderFetch((*cit)->getUUID(), true /*force, since it has changes*/);
+        }
+        // else already called fetch() above
 	}
 	for (item_array_t::iterator iit = items.begin(); iit != items.end(); ++iit)
 	{
 		gInventory.updateItem(*iit);
 
         // Temporary workaround: just fetch the item using AIS to get missing fields.
-        // If this works fine we might want to extract ids only from the message
+        // If this works fine we might want to extract 'ids only' from the message
         // then use AIS as a primary fetcher
         LLInventoryModelBackgroundFetch::instance().scheduleItemFetch((*iit)->getUUID(), true);
 	}
diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp
index 1f410bea1012e8fef0e4444b7d56332c12059600..722447b5d75e4da6fc07572e9f9f84522d03457d 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.cpp
+++ b/indra/newview/llinventorymodelbackgroundfetch.cpp
@@ -193,13 +193,16 @@ LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch():
     mLastFetchCount(0),
     mFetchFolderCount(0),
     mAllRecursiveFoldersFetched(false),
-	mRecursiveInventoryFetchStarted(false),
-	mRecursiveLibraryFetchStarted(false),
-	mMinTimeBetweenFetches(0.3f)
+    mRecursiveInventoryFetchStarted(false),
+    mRecursiveLibraryFetchStarted(false),
+    mRecursiveMarketplaceFetchStarted(false),
+    mMinTimeBetweenFetches(0.3f)
 {}
 
 LLInventoryModelBackgroundFetch::~LLInventoryModelBackgroundFetch()
-{}
+{
+    gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+}
 
 bool LLInventoryModelBackgroundFetch::isBulkFetchProcessingComplete() const
 {
@@ -314,6 +317,23 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, bool recursive)
 				gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
 			}
 		}
+        else if (recursive && cat && cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_LISTINGS)
+        {
+            if (mFetchFolderQueue.empty() || mFetchFolderQueue.back().mUUID != id)
+            {
+                if (recursive && AISAPI::isAvailable())
+                {
+                    // Request marketplace folder and content separately
+                    mFetchFolderQueue.push_front(FetchQueueInfo(id, FT_FOLDER_AND_CONTENT));
+                }
+                else
+                {
+                    mFetchFolderQueue.push_front(FetchQueueInfo(id, recursion_type));
+                }
+                gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
+                mRecursiveMarketplaceFetchStarted = true;
+            }
+        }
 		else
 		{
             if (AISAPI::isAvailable())
@@ -359,8 +379,22 @@ void LLInventoryModelBackgroundFetch::scheduleFolderFetch(const LLUUID& cat_id,
         mBackgroundFetchActive = true;
         mFolderFetchActive = true;
 
-        // Specific folder requests go to front of queue.
-        mFetchFolderQueue.push_front(FetchQueueInfo(cat_id, forced ? FT_FORCED : FT_DEFAULT));
+        if (forced)
+        {
+            // check if already requested
+            if (mForceFetchSet.find(cat_id) == mForceFetchSet.end())
+            {
+                mForceFetchSet.insert(cat_id);
+                mFetchItemQueue.push_front(FetchQueueInfo(cat_id, FT_FORCED));
+            }
+        }
+        else
+        {
+            // Specific folder requests go to front of queue.
+            // version presence acts as dupplicate prevention for normal fetches
+            mFetchItemQueue.push_front(FetchQueueInfo(cat_id, FT_DEFAULT));
+        }
+
         gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
     }
 }
@@ -370,8 +404,21 @@ void LLInventoryModelBackgroundFetch::scheduleItemFetch(const LLUUID& item_id, b
     if (mFetchItemQueue.empty() || mFetchItemQueue.front().mUUID != item_id)
     {
         mBackgroundFetchActive = true;
+        if (forced)
+        {
+            // check if already requested
+            if (mForceFetchSet.find(item_id) == mForceFetchSet.end())
+            {
+                mForceFetchSet.insert(item_id);
+                mFetchItemQueue.push_front(FetchQueueInfo(item_id, FT_FORCED, false));
+            }
+        }
+        else
+        {
+            // 'isFinished' being set acts as dupplicate prevention for normal fetches
+            mFetchItemQueue.push_front(FetchQueueInfo(item_id, FT_DEFAULT, false));
+        }
 
-        mFetchItemQueue.push_front(FetchQueueInfo(item_id, forced ? FT_FORCED : FT_DEFAULT, false));
         gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL);
     }
 }
@@ -591,6 +638,7 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i
         return;
     }
 
+    LLViewerInventoryCategory::EFetchType new_state = LLViewerInventoryCategory::FETCH_NONE;
     bool request_descendants = false;
     if (response_id.isNull()) // Failure
     {
@@ -608,10 +656,12 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i
 
             // set folder's version to prevent viewer from trying to request folder indefinetely
             LLViewerInventoryCategory* cat(gInventory.getCategory(request_id));
-            if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)
+            if (cat && cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)
             {
                 cat->setVersion(0);
             }
+            // back off for a bit in case something tries to force-request immediately
+            new_state = LLViewerInventoryCategory::FETCH_FAILED;
         }
     }
     else
@@ -664,7 +714,7 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i
     LLViewerInventoryCategory * cat(gInventory.getCategory(request_id));
     if (cat)
     {
-        cat->setFetching(LLViewerInventoryCategory::FETCH_NONE);
+        cat->setFetching(new_state);
     }
 }
 
@@ -753,7 +803,26 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis()
     
     if (isFolderFetchProcessingComplete() && mFolderFetchActive)
     {
-        setAllFoldersFetched();
+        if (!mRecursiveInventoryFetchStarted || mRecursiveMarketplaceFetchStarted)
+        {
+            setAllFoldersFetched();
+        }
+        else
+        {
+            // Intent is for marketplace request to happen after
+            // main inventory is done, unless requested by floater
+            mRecursiveMarketplaceFetchStarted = true;
+            const LLUUID& marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS);
+            if (marketplacelistings_id.notNull())
+            {
+                mFetchFolderQueue.push_front(FetchQueueInfo(marketplacelistings_id, FT_FOLDER_AND_CONTENT));
+            }
+            else
+            {
+                setAllFoldersFetched();
+            }
+        }
+        
     }
 
     if (isBulkFetchProcessingComplete())
@@ -813,22 +882,8 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc
 
                         if (child_cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_LISTINGS)
                         {
-                            // special case
-                            content_done = false;
-                            if (children.empty())
-                            {
-                                // fetch marketplace alone
-                                // Should it actually be fetched as FT_FOLDER_AND_CONTENT?
-                                children.push_back(child_cat->getUUID());
-                                mExpectedFolderIds.push_back(child_cat->getUUID());
-                                child_cat->setFetching(target_state);
-                                break;
-                            }
-                            else
-                            {
-                                // fetch marketplace alone next run
-                                continue;
-                            }
+                            // special case, marketplace will fetch that as needed
+                            continue;
                         }
 
                         children.push_back(child_cat->getUUID());
@@ -902,10 +957,10 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc
                         mExpectedFolderIds.push_back(cat_id);
 
                         EFetchType type = fetch_info.mFetchType;
-                        LLUUID cat_id = cat->getUUID();
-                        AISAPI::completion_t cb = [cat_id , type](const LLUUID& response_id)
+                        LLUUID cat_cb_id = cat_id;
+                        AISAPI::completion_t cb = [cat_cb_id, type](const LLUUID& response_id)
                         {
-                            LLInventoryModelBackgroundFetch::instance().onAISFolderCalback(cat_id , response_id , type);
+                            LLInventoryModelBackgroundFetch::instance().onAISFolderCalback(cat_cb_id, response_id , type);
                         };
 
                         AISAPI::ITEM_TYPE item_type = AISAPI::INVENTORY;
@@ -964,6 +1019,11 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc
             AISAPI::FetchItem(fetch_info.mUUID, AISAPI::INVENTORY, ais_simple_item_callback);
         }
     }
+
+    if (fetch_info.mFetchType == FT_FORCED)
+    {
+        mForceFetchSet.erase(fetch_info.mUUID);
+    }
 }
 
 // Bundle up a bunch of requests to send all at once.
diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h
index a712fc760407690de2d12663ab17d3102d64b20f..989968be53466aa3087a1a251172a7618e8f7985 100644
--- a/indra/newview/llinventorymodelbackgroundfetch.h
+++ b/indra/newview/llinventorymodelbackgroundfetch.h
@@ -76,7 +76,6 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
     void incrFetchFolderCount(S32 fetching);
 
 	bool isBulkFetchProcessingComplete() const;
-    bool isFolderFetchProcessingComplete() const;
 	void setAllFoldersFetched();
 
     typedef boost::function<void()> folders_fetched_callback_t;
@@ -86,6 +85,7 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 	void addRequestAtBack(const LLUUID & id, bool recursive, bool is_category);
 
 protected:
+    bool isFolderFetchProcessingComplete() const;
 
     typedef enum {
         FT_DEFAULT = 0,
@@ -122,6 +122,7 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 private:
  	bool mRecursiveInventoryFetchStarted;
 	bool mRecursiveLibraryFetchStarted;
+    bool mRecursiveMarketplaceFetchStarted; // AIS3 specific
 	bool mAllRecursiveFoldersFetched;
     typedef boost::signals2::signal<void()> folders_fetched_signal_t;
     folders_fetched_signal_t mFoldersFetchedSignal;
@@ -136,6 +137,7 @@ class LLInventoryModelBackgroundFetch : public LLSingleton<LLInventoryModelBackg
 	F32 mMinTimeBetweenFetches;
 	fetch_queue_t mFetchFolderQueue;
     fetch_queue_t mFetchItemQueue;
+    uuid_set_t mForceFetchSet;
     std::list<LLUUID> mExpectedFolderIds; // for debug, should this track time?
 };
 
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp
index e1eaa18206af86cd77adc81f0bfae9207556dc78..15cd7957a2e9a23cabb3f51c64069d5681582c25 100644
--- a/indra/newview/llinventoryobserver.cpp
+++ b/indra/newview/llinventoryobserver.cpp
@@ -356,7 +356,6 @@ void LLInventoryFetchItemsObserver::startFetch()
                 {
                     // Start fetching whole folder since we need all items
                     LLInventoryModelBackgroundFetch::getInstance()->scheduleFolderFetch(folder.first, true);
-
                 }
                 else
                 {
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index 052ac50185369096d2b211a224054368bef210ef..55a947a09d42b7b6d88e65d42d335fb2bb62ed00 100644
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -42,7 +42,6 @@
 #include <boost/algorithm/string/trim.hpp>
 #include <boost/algorithm/string/replace.hpp>
 #include <boost/regex.hpp>
-#include <boost/foreach.hpp>
 
 #if LL_MSVC
 #pragma warning(push)  
@@ -709,7 +708,7 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory,
 	std::string backupFileName;
 	unsigned backupFileCount;
 
-	BOOST_FOREACH(const std::string& fullpath, listOfFilesToMove)
+	for (const std::string& fullpath : listOfFilesToMove)
 	{
 		backupFileCount = 0;
 		newFullPath = targetDirectory + fullpath.substr(originDirectory.length(), std::string::npos);
@@ -723,7 +722,7 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory,
 			while(LLFile::isfile(backupFileName))
 			{
 				++backupFileCount;
-				backupFileName = newFullPath + ".backup" + boost::lexical_cast<std::string>(backupFileCount);
+				backupFileName = newFullPath + ".backup" + std::to_string(backupFileCount);
 			}
 
 			//Rename the file to its backup name so it is not overwritten
@@ -780,7 +779,7 @@ void LLLogChat::deleteTranscripts()
 	getListOfTranscriptFiles(list_of_transcriptions);
 	getListOfTranscriptBackupFiles(list_of_transcriptions);
 
-	BOOST_FOREACH(const std::string& fullpath, list_of_transcriptions)
+	for (const std::string& fullpath : list_of_transcriptions)
 	{
 		S32 retry_count = 0;
 		while (retry_count < 5)
diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h
index 2e9aab7c00c5fe9d16f9578a23f0427220a7b1ff..74d6890d1d856c3aaa682e2730dc6db4093f01b5 100644
--- a/indra/newview/lllogininstance.h
+++ b/indra/newview/lllogininstance.h
@@ -90,7 +90,7 @@ class LLLoginInstance : public LLSingleton<LLLoginInstance>
 
 	void attemptComplete() { mAttemptComplete = true; } // In the future an event?
 
-	boost::scoped_ptr<LLLogin> mLoginModule;
+	std::unique_ptr<LLLogin> mLoginModule;
 	LLNotificationsInterface* mNotifications;
 
 	std::string mLoginState;
diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp
index 583742f970b4303d122272fad6bd8dfa74352ce1..1f4418f119855a02d8cd2a8f65702fae85c39d6b 100644
--- a/indra/newview/llmachineid.cpp
+++ b/indra/newview/llmachineid.cpp
@@ -85,11 +85,11 @@ void LLWMIMethods::initCOMObjects()
     // Step 1: --------------------------------------------------
     // Initialize COM. ------------------------------------------
 
-    mHR = CoInitializeEx(0, COINIT_MULTITHREADED);
+    mHR = CoInitializeEx(0, COINIT_APARTMENTTHREADED);
     if (FAILED(mHR))
     {
+        // if result S_FALSE, it's already initialized
         LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << std::hex << mHR << LL_ENDL;
-        return;
     }
 
     // Step 2: --------------------------------------------------
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index 8784f403cbe07b3b232adb50447188b639cf98ca..d27ee941a6dc8eb56ae74609f1fe92465dcb9ce2 100644
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -611,27 +611,17 @@ class LLMarketplaceInventoryObserver : public LLInventoryObserver
     static void onIdleProcessQueue(void *userdata);
 
     // doesn't hold just marketplace related ids
-    static std::set<LLUUID> sAddQueue;
     static std::set<LLUUID> sStructureQueue;
     static bool sProcessingQueue;
 };
 
-std::set<LLUUID> LLMarketplaceInventoryObserver::sAddQueue;
 std::set<LLUUID> LLMarketplaceInventoryObserver::sStructureQueue;
 bool LLMarketplaceInventoryObserver::sProcessingQueue = false;
 
 void LLMarketplaceInventoryObserver::changed(U32 mask)
 {
-	if (mask & LLInventoryObserver::ADD && LLMarketplaceData::instance().hasValidationWaiting())
-	{
-        // When things are added to the marketplace, we might need to re-validate and fix the containing listings
-        // just add whole list even if it contains items and non-marketplace folders
-        const std::set<LLUUID>& changed_items = gInventory.getChangedIDs();
-        sAddQueue.insert(changed_items.begin(), changed_items.end());
-	}
-    
-	if (mask & (LLInventoryObserver::INTERNAL | LLInventoryObserver::STRUCTURE))
-	{
+    if (mask & (LLInventoryObserver::INTERNAL | LLInventoryObserver::STRUCTURE))
+    {
         // When things are changed in the inventory, this can trigger a host of changes in the marketplace listings folder:
         // * stock counts changing : no copy items coming in and out will change the stock count on folders
         // * version and listing folders : moving those might invalidate the marketplace data itself
@@ -641,7 +631,7 @@ void LLMarketplaceInventoryObserver::changed(U32 mask)
         sStructureQueue.insert(changed_items.begin(), changed_items.end());
 	}
 
-    if (!sProcessingQueue && (!sAddQueue.empty() || !sStructureQueue.empty()))
+    if (!sProcessingQueue && !sStructureQueue.empty())
     {
         gIdleCallbacks.addFunction(onIdleProcessQueue, NULL);
         // can do without sProcessingQueue, but it's usufull for simplicity and reliability
@@ -655,40 +645,6 @@ void LLMarketplaceInventoryObserver::onIdleProcessQueue(void *userdata)
     const U64 MAX_PROCESSING_TIME = 1000;
     U64 stop_time = start_time + MAX_PROCESSING_TIME;
 
-    if (!sAddQueue.empty())
-    {
-        // Make a copy of sAddQueue since decrementValidationWaiting
-        // can theoretically add more items
-        std::set<LLUUID> add_queue(sAddQueue);
-        sAddQueue.clear();
-
-        std::set<LLUUID>::const_iterator id_it = add_queue.begin();
-        std::set<LLUUID>::const_iterator id_end = add_queue.end();
-        // First, count the number of items in this list...
-        S32 count = 0;
-        for (; id_it != id_end; ++id_it)
-        {
-            LLInventoryObject* obj = gInventory.getObject(*id_it);
-            if (obj && (LLAssetType::AT_CATEGORY != obj->getType()))
-            {
-                count++;
-            }
-        }
-        // Then, decrement the folders of that amount
-        // Note that of all of those, only one folder will be a listing folder (if at all).
-        // The other will be ignored by the decrement method.
-        id_it = add_queue.begin();
-        for (; id_it != id_end; ++id_it)
-        {
-            LLInventoryObject* obj = gInventory.getObject(*id_it);
-            if (obj && (LLAssetType::AT_CATEGORY == obj->getType()))
-            {
-                // can trigger notifyObservers
-                LLMarketplaceData::instance().decrementValidationWaiting(obj->getUUID(), count);
-            }
-        }
-    }
-
     while (!sStructureQueue.empty() && LLTimer::getTotalTime() < stop_time)
     {
         std::set<LLUUID>::const_iterator id_it = sStructureQueue.begin();
@@ -722,7 +678,7 @@ void LLMarketplaceInventoryObserver::onIdleProcessQueue(void *userdata)
         sStructureQueue.erase(id_it);
     }
 
-    if (LLApp::isExiting() || (sAddQueue.empty() && sStructureQueue.empty()))
+    if (LLApp::isExiting() || sStructureQueue.empty())
     {
         // Nothing to do anymore
         gIdleCallbacks.deleteFunction(onIdleProcessQueue, NULL);
diff --git a/indra/newview/llmarketplacenotifications.cpp b/indra/newview/llmarketplacenotifications.cpp
index 0886f9a99046605cef305496c0fc97c57ec072f9..02bd9e1f342372e480e74b078cf2381ae6545f29 100644
--- a/indra/newview/llmarketplacenotifications.cpp
+++ b/indra/newview/llmarketplacenotifications.cpp
@@ -33,7 +33,6 @@
 
 #include "llerror.h"
 
-#include <boost/foreach.hpp>
 #include <boost/signals2.hpp>
 
 
@@ -54,7 +53,7 @@ namespace LLMarketplaceInventoryNotifications
 			llassert(!no_copy_payloads.empty());
 			llassert(no_copy_cb_action != NULL);
 			
-			BOOST_FOREACH(const LLSD& payload, no_copy_payloads)
+			for (const LLSD& payload : no_copy_payloads)
 			{
 				(*no_copy_cb_action)(payload);
 			}
diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp
index 3b59b2f05e9559639da812c167c4492fba38bfef..577ab0048f011b31d390588b6ac46ed263dd0a32 100644
--- a/indra/newview/llmaterialmgr.cpp
+++ b/indra/newview/llmaterialmgr.cpp
@@ -68,7 +68,7 @@ class LLMaterialHttpHandler : public LLHttpSDHandler
 {
 public: 
 	typedef boost::function<void(bool, const LLSD&)> CallbackFunction;
-	typedef boost::shared_ptr<LLMaterialHttpHandler> ptr_t;
+	typedef std::shared_ptr<LLMaterialHttpHandler> ptr_t;
 
 	LLMaterialHttpHandler(const std::string& method, CallbackFunction cback);
 
diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h
index 58f8bad3e444cf931fc35ef5b31eadd4a686e170..8cd47931061ada60987be58c4b31f204c6104d8e 100644
--- a/indra/newview/llmediadataclient.h
+++ b/indra/newview/llmediadataclient.h
@@ -116,10 +116,10 @@ class LLMediaDataClient : public LLRefCount
     
 	// Request (pure virtual base class for requests in the queue)
     class Request: 
-        public boost::enable_shared_from_this<Request>
+        public std::enable_shared_from_this<Request>
     {
     public:
-        typedef boost::shared_ptr<Request> ptr_t;
+        typedef std::shared_ptr<Request> ptr_t;
 
         // Subclasses must implement this to build a payload for their request type.
         virtual LLSD getPayload() const = 0;
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 48fd946a21f4928305d610f1cb6b3b86f0167b8b..a5601dafbeceff4fcd9bdfe4b68fe28354a4449b 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -411,7 +411,7 @@ namespace {
 static S32 dump_num = 0;
 std::string make_dump_name(std::string prefix, S32 num)
 {
-	return prefix + boost::lexical_cast<std::string>(num) + std::string(".xml");
+	return prefix + std::to_string(num) + std::string(".xml");
 }
 void dump_llsd_to_file(const LLSD& content, std::string filename);
 LLSD llsd_from_file(std::string filename);
@@ -572,10 +572,10 @@ S32 LLMeshRepoThread::sRequestWaterLevel = 0;
 //   LLMeshUploadThread
 
 class LLMeshHandlerBase : public LLCore::HttpHandler,
-    public boost::enable_shared_from_this<LLMeshHandlerBase>
+    public std::enable_shared_from_this<LLMeshHandlerBase>
 {
 public:
-    typedef boost::shared_ptr<LLMeshHandlerBase> ptr_t;
+    typedef std::shared_ptr<LLMeshHandlerBase> ptr_t;
 
 	LOG_CLASS(LLMeshHandlerBase);
 	LLMeshHandlerBase(U32 offset, U32 requested_bytes)
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index 8fbcf8e18d8a28301592c008fe2b6d8ded25f09d..a3eab3c26da90fe2aa0a2f192dc3c21e98812bc5 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -220,6 +220,16 @@ LLModelPreview::~LLModelPreview()
         mPreviewAvatar->markDead();
         mPreviewAvatar = NULL;
     }
+
+    mUploadData.clear();
+    mTextureSet.clear();
+
+    for (U32 i = 0; i < LLModel::NUM_LODS; i++)
+    {
+        clearModel(i);
+    }
+    mBaseModel.clear();
+    mBaseScene.clear();
 }
 
 void LLModelPreview::updateDimentionsAndOffsets()
diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h
index df7320768cfb1a07407a73f72bce7d19b056af0d..d4d5d087bd3bd1c9cec6007aff8f2cdaa7f9e5d9 100644
--- a/indra/newview/llmodelpreview.h
+++ b/indra/newview/llmodelpreview.h
@@ -310,7 +310,6 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
     vv_LLVolumeFace_t mBaseModelFacesCopy;
 
     U32 mGroup;
-    std::map<LLPointer<LLModel>, U32> mObject;
 
     // Amount of triangles in original(base) model
     U32 mMaxTriangleLimit;
diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp
index b06131cf38e535c90389222f61e416b52c45e0f0..3f6a86106a077f5dbd6ff174d4e206216b467132 100644
--- a/indra/newview/llnotificationmanager.cpp
+++ b/indra/newview/llnotificationmanager.cpp
@@ -34,9 +34,6 @@
 #include "llfloaterimnearbychathandler.h"
 #include "llnotifications.h"
 
-#include <boost/bind.hpp>
-#include <boost/foreach.hpp>
-
 using namespace LLNotificationsUI;
 
 //--------------------------------------------------------------------------
@@ -53,15 +50,15 @@ LLNotificationManager::~LLNotificationManager()
 //--------------------------------------------------------------------------
 void LLNotificationManager::init()
 {
-	mChannels.push_back(new LLScriptHandler());
-	mChannels.push_back(new LLTipHandler());
-	mChannels.push_back(new LLGroupHandler());
-	mChannels.push_back(new LLAlertHandler("Alerts", "alert", false));
-	mChannels.push_back(new LLAlertHandler("AlertModal", "alertmodal", true));
-	mChannels.push_back(new LLOfferHandler());
-	mChannels.push_back(new LLHintHandler());
-	mChannels.push_back(new LLBrowserNotification());
-	mChannels.push_back(new LLIMHandler());
+	mChannels.emplace_back(new LLScriptHandler());
+	mChannels.emplace_back(new LLTipHandler());
+	mChannels.emplace_back(new LLGroupHandler());
+	mChannels.emplace_back(new LLAlertHandler("Alerts", "alert", false));
+	mChannels.emplace_back(new LLAlertHandler("AlertModal", "alertmodal", true));
+	mChannels.emplace_back(new LLOfferHandler());
+	mChannels.emplace_back(new LLHintHandler());
+	mChannels.emplace_back(new LLBrowserNotification());
+	mChannels.emplace_back(new LLIMHandler());
   
 	mChatHandler = std::shared_ptr<LLFloaterIMNearbyChatHandler>(new LLFloaterIMNearbyChatHandler());
 }
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index 65ec38a41dc63c7b0561d220eefdcb7b299cd2a2..efffcefc4a741edafdbe2d725b7b4d37349be93e 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -28,8 +28,6 @@
 #include "llviewerprecompiledheaders.h" // must be first include
 #include "lloutfitgallery.h"
 
-#include <boost/foreach.hpp>
-
 // llcommon
 #include "llcommonutils.h"
 #include "llfilesystem.h"
@@ -1151,22 +1149,13 @@ LLContextMenu* LLOutfitGalleryContextMenu::createMenu()
     registrar.add("Outfit.Delete", boost::bind(LLOutfitGallery::onRemoveOutfit, selected_id));
     registrar.add("Outfit.Create", boost::bind(&LLOutfitGalleryContextMenu::onCreate, this, _2));
     registrar.add("Outfit.Thumbnail", boost::bind(&LLOutfitGalleryContextMenu::onThumbnail, this, selected_id));
+    registrar.add("Outfit.Save", boost::bind(&LLOutfitGalleryContextMenu::onSave, this, selected_id));
     enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitGalleryContextMenu::onEnable, this, _2));
     enable_registrar.add("Outfit.OnVisible", boost::bind(&LLOutfitGalleryContextMenu::onVisible, this, _2));
     
     return createFromFile("menu_gallery_outfit_tab.xml");
 }
 
-void LLOutfitGalleryContextMenu::onThumbnail(const LLUUID& outfit_cat_id)
-{
-    LLOutfitGallery* gallery = dynamic_cast<LLOutfitGallery*>(mOutfitList);
-    if (gallery && outfit_cat_id.notNull())
-    {
-        LLSD data(outfit_cat_id);
-        LLFloaterReg::showInstance("change_item_thumbnail", data);
-    }
-}
-
 void LLOutfitGalleryContextMenu::onCreate(const LLSD& data)
 {
     LLWearableType::EType type = LLWearableType::getInstance()->typeNameToType(data.asString());
@@ -1201,7 +1190,6 @@ void LLOutfitGalleryGearMenu::onUpdateItemsVisibility()
     mMenu->setItemVisible("expand", FALSE);
     mMenu->setItemVisible("collapse", FALSE);
     mMenu->setItemVisible("thumbnail", have_selection);
-    mMenu->setItemVisible("sepatator3", TRUE);
     mMenu->setItemVisible("sort_folders_by_name", TRUE);
     LLOutfitListGearMenuBase::onUpdateItemsVisibility();
 }
@@ -1249,7 +1237,7 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id)
                 sub_cat_array,
                 outfit_item_array,
                 LLInventoryModel::EXCLUDE_TRASH);
-            BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array)
+            for (LLViewerInventoryItem* outfit_item : outfit_item_array)
             {
                 LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem();
                 LLUUID asset_id, inv_id;
diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h
index f2366e64946d438d6eca28a6d528d88b3bbb546c..99371b1cec25a8715e32851b3804752f670c94ea 100644
--- a/indra/newview/lloutfitgallery.h
+++ b/indra/newview/lloutfitgallery.h
@@ -193,17 +193,13 @@ class LLOutfitGalleryContextMenu : public LLOutfitContextMenu
     
     friend class LLOutfitGallery;
     LLOutfitGalleryContextMenu(LLOutfitListBase* outfit_list)
-    : LLOutfitContextMenu(outfit_list),
-    mOutfitList(outfit_list){}
+    : LLOutfitContextMenu(outfit_list){}
 
 protected:
     /* virtual */ LLContextMenu* createMenu();
     bool onEnable(LLSD::String param);
     bool onVisible(LLSD::String param);
-    void onThumbnail(const LLUUID& outfit_cat_id);
     void onCreate(const LLSD& data);
-private:
-    LLOutfitListBase*	mOutfitList;
 };
 
 
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index 27d73fc4aebd719a29c0c7c2376305da3fd7d3d8..1a6c5db5356768ced0dcf5a13207878dae43eb90 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -37,6 +37,7 @@
 #include "llappearancemgr.h"
 #include "llfloaterreg.h"
 #include "llfloatersidepanelcontainer.h"
+#include "llinspecttexture.h"
 #include "llinventoryfunctions.h"
 #include "llinventorymodel.h"
 #include "llmenubutton.h"
@@ -62,7 +63,7 @@ bool LLOutfitTabNameComparator::compare(const LLAccordionCtrlTab* tab1, const LL
     return (LLStringUtil::compareDict(name1, name2) < 0);
 }
 
-struct outfit_accordion_tab_params : public LLInitParam::Block<outfit_accordion_tab_params, LLAccordionCtrlTab::Params>
+struct outfit_accordion_tab_params : public LLInitParam::Block<outfit_accordion_tab_params, LLOutfitAccordionCtrlTab::Params>
 {
 	Mandatory<LLWearableItemsList::Params> wearable_list;
 
@@ -144,7 +145,8 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id)
     std::string name = cat->getName();
 
     outfit_accordion_tab_params tab_params(get_accordion_tab_params());
-    LLAccordionCtrlTab* tab = LLUICtrlFactory::create<LLAccordionCtrlTab>(tab_params);
+    tab_params.cat_id = cat_id;
+    LLOutfitAccordionCtrlTab *tab = LLUICtrlFactory::create<LLOutfitAccordionCtrlTab>(tab_params);
     if (!tab) return;
     LLWearableItemsList* wearable_list = LLUICtrlFactory::create<LLWearableItemsList>(tab_params.wearable_list);
     wearable_list->setShape(tab->getLocalRect());
@@ -1059,6 +1061,8 @@ LLContextMenu* LLOutfitContextMenu::createMenu()
     registrar.add("Outfit.Edit", boost::bind(editOutfit));
     registrar.add("Outfit.Rename", boost::bind(renameOutfit, selected_id));
     registrar.add("Outfit.Delete", boost::bind(&LLOutfitListBase::removeSelected, mOutfitList));
+    registrar.add("Outfit.Thumbnail", boost::bind(&LLOutfitContextMenu::onThumbnail, this, selected_id));
+    registrar.add("Outfit.Save", boost::bind(&LLOutfitContextMenu::onSave, this, selected_id));
 
     enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitContextMenu::onEnable, this, _2));
     enable_registrar.add("Outfit.OnVisible", boost::bind(&LLOutfitContextMenu::onVisible, this, _2));
@@ -1123,6 +1127,31 @@ void LLOutfitContextMenu::renameOutfit(const LLUUID& outfit_cat_id)
     LLAppearanceMgr::instance().renameOutfit(outfit_cat_id);
 }
 
+void LLOutfitContextMenu::onThumbnail(const LLUUID &outfit_cat_id)
+{
+    if (outfit_cat_id.notNull())
+    {
+        LLSD data(outfit_cat_id);
+        LLFloaterReg::showInstance("change_item_thumbnail", data);
+    }
+}
+
+void LLOutfitContextMenu::onSave(const LLUUID &outfit_cat_id)
+{
+    if (outfit_cat_id.notNull())
+    {
+        LLNotificationsUtil::add("ConfirmOverwriteOutfit", LLSD(), LLSD(),
+            [outfit_cat_id](const LLSD &notif, const LLSD &resp)
+        {
+            S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp);
+            if (opt == 0)
+            {
+                LLAppearanceMgr::getInstance()->onOutfitFolderCreated(outfit_cat_id, true);
+            }
+        });
+    }
+}
+
 LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist)
     :   mOutfitList(olist),
         mMenu(NULL)
@@ -1141,6 +1170,7 @@ LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist)
     registrar.add("Gear.Expand", boost::bind(&LLOutfitListBase::onExpandAllFolders, mOutfitList));
 
     registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenuBase::onAdd, this));
+    registrar.add("Gear.Save", boost::bind(&LLOutfitListGearMenuBase::onSave, this));
 
     registrar.add("Gear.Thumbnail", boost::bind(&LLOutfitListGearMenuBase::onThumbnail, this));
     registrar.add("Gear.SortByName", boost::bind(&LLOutfitListGearMenuBase::onChangeSortOrder, this));
@@ -1166,8 +1196,7 @@ void LLOutfitListGearMenuBase::onUpdateItemsVisibility()
     if (!mMenu) return;
 
     bool have_selection = getSelectedOutfitID().notNull();
-    mMenu->setItemVisible("sepatator1", have_selection);
-    mMenu->setItemVisible("sepatator2", have_selection);
+    mMenu->setItemVisible("wear_separator", have_selection);
     mMenu->arrangeAndClear(); // update menu height
 }
 
@@ -1212,6 +1241,20 @@ void LLOutfitListGearMenuBase::onAdd()
     }
 }
 
+void LLOutfitListGearMenuBase::onSave()
+{
+    const LLUUID &selected_id = getSelectedOutfitID();
+    LLNotificationsUtil::add("ConfirmOverwriteOutfit", LLSD(), LLSD(),
+        [selected_id](const LLSD &notif, const LLSD &resp)
+    {
+        S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp);
+        if (opt == 0)
+        {
+            LLAppearanceMgr::getInstance()->onOutfitFolderCreated(selected_id, true);
+        }
+    });
+}
+
 void LLOutfitListGearMenuBase::onTakeOff()
 {
     // Take off selected outfit.
@@ -1265,15 +1308,6 @@ bool LLOutfitListGearMenuBase::onVisible(LLSD::String param)
         return false;
     }
 
-    // *TODO This condition leads to menu item behavior inconsistent with
-    // "Wear" button behavior and should be modified or removed.
-    bool is_worn = LLAppearanceMgr::instance().getBaseOutfitUUID() == selected_outfit_id;
-
-    if ("wear" == param)
-    {
-        return !is_worn;
-    }
-
     return true;
 }
 
@@ -1301,10 +1335,29 @@ void LLOutfitListGearMenu::onUpdateItemsVisibility()
     if (!mMenu) return;
     mMenu->setItemVisible("expand", TRUE);
     mMenu->setItemVisible("collapse", TRUE);
-    mMenu->setItemVisible("thumbnail", FALSE); // Never visible?
-    mMenu->setItemVisible("sepatator3", FALSE);
+    mMenu->setItemVisible("thumbnail", getSelectedOutfitID().notNull());
     mMenu->setItemVisible("sort_folders_by_name", FALSE);
     LLOutfitListGearMenuBase::onUpdateItemsVisibility();
 }
 
+BOOL LLOutfitAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask)
+{
+    if (y >= getLocalRect().getHeight() - getHeaderHeight()) 
+    {
+        LLSD params;
+        params["inv_type"] = LLInventoryType::IT_CATEGORY;
+        params["thumbnail_id"] = gInventory.getCategory(mFolderID)->getThumbnailUUID();
+        params["item_id"] = mFolderID;
+
+        LLToolTipMgr::instance().show(LLToolTip::Params()
+                                    .message(getToolTip())
+                                    .sticky_rect(calcScreenRect())
+                                    .delay_time(LLView::getTooltipTimeout())
+                                    .create_callback(boost::bind(&LLInspectTextureUtil::createInventoryToolTip, _1))
+                                    .create_params(params));
+        return TRUE;
+    }
+
+    return LLAccordionCtrlTab::handleToolTip(x, y, mask);
+}
 // EOF
diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h
index 43c3ba75b580628473d65e5da2b210146068bf64..89821f933318925f1f9ee06fd7dfe976efb805d5 100644
--- a/indra/newview/lloutfitslist.h
+++ b/indra/newview/lloutfitslist.h
@@ -31,6 +31,7 @@
 #include "llpanel.h"
 
 // newview
+#include "llaccordionctrltab.h"
 #include "llinventorymodel.h"
 #include "lllistcontextmenu.h"
 #include "llpanelappearancetab.h"
@@ -159,6 +160,9 @@ class LLOutfitContextMenu : public LLListContextMenu
 
     static void renameOutfit(const LLUUID& outfit_cat_id);
 
+    void onThumbnail(const LLUUID &outfit_cat_id);
+    void onSave(const LLUUID &outfit_cat_id);
+
 private:
     LLOutfitListBase*	mOutfitList;
 };
@@ -190,6 +194,7 @@ class LLOutfitListGearMenuBase
     void onAdd();
     void onTakeOff();
     void onRename();
+    void onSave();
     void onCreate(const LLSD& data);
     bool onEnable(LLSD::String param);
     bool onVisible(LLSD::String param);
@@ -205,7 +210,27 @@ class LLOutfitListGearMenu : public LLOutfitListGearMenuBase
     /*virtual*/ void onUpdateItemsVisibility();
 };
 
-/**
+class LLOutfitAccordionCtrlTab : public LLAccordionCtrlTab
+{
+public:
+    struct Params : public LLInitParam::Block<Params, LLAccordionCtrlTab::Params>
+    {
+        Optional<LLUUID> cat_id;
+        Params() : cat_id("cat_id") {}
+    };
+
+    virtual BOOL handleToolTip(S32 x, S32 y, MASK mask);
+
+ protected:
+    LLOutfitAccordionCtrlTab(const LLOutfitAccordionCtrlTab::Params &p) 
+        : LLAccordionCtrlTab(p), 
+          mFolderID(p.cat_id)
+    {}
+    friend class LLUICtrlFactory;
+
+    LLUUID mFolderID;
+};
+  /**
  * @class LLOutfitsList
  *
  * A list of agents's outfits from "My Outfits" inventory category
diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp
index 0fdb9a57f3e25e2395eca615a11533c2383ca62d..854a32621a44fb0ced3023d9f4aede59d4be3dde 100644
--- a/indra/newview/llpanelexperiencelisteditor.cpp
+++ b/indra/newview/llpanelexperiencelisteditor.cpp
@@ -40,7 +40,6 @@
 #include "lltextbox.h"
 #include "lltrans.h"
 #include "llsdutil.h"
-#include <boost/foreach.hpp>
 
 
 static LLPanelInjector<LLPanelExperienceListEditor> t_panel_experience_list_editor("panel_experience_list_editor");
@@ -96,7 +95,7 @@ void LLPanelExperienceListEditor::addExperienceIds( const uuid_vec_t& experience
 void LLPanelExperienceListEditor::setExperienceIds( const LLSD& experience_ids )
 {
 	mExperienceIds.clear();
-	BOOST_FOREACH(LLSD uuid, llsd::inArray(experience_ids))
+	for (LLSD uuid : llsd::inArray(experience_ids))
 	{
 		// Using insert(range) doesn't work here because the conversion from
 		// LLSD to LLUUID is ambiguous: have to specify asUUID() for each entry.
diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp
index cf1f0bc32f0222bdaa1c6d465e00524a9bb65a24..2b6bf1bcd6311b37e90b3b5f16707d97b48c328f 100644
--- a/indra/newview/llpanelgroupbulkban.cpp
+++ b/indra/newview/llpanelgroupbulkban.cpp
@@ -49,8 +49,6 @@
 #include "lluictrlfactory.h"
 #include "llviewerwindow.h"
 
-#include <boost/foreach.hpp>
-
 LLPanelGroupBulkBan::LLPanelGroupBulkBan(const LLUUID& group_id) : LLPanelGroupBulk(group_id)
 {
 	// Pass on construction of this panel to the control factory.
@@ -163,8 +161,8 @@ void LLPanelGroupBulkBan::submit()
 	// remove already banned users and yourself from request.
 	std::vector<LLAvatarName> banned_avatar_names;
 	std::vector<LLAvatarName> out_of_limit_names;
-	bool banning_self = FALSE;
-	std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), gAgent.getID());
+	bool banning_self{ false };
+	std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), gAgentID);
 	if (conflict != banned_agent_list.end())
 	{
 		banned_agent_list.erase(conflict);
@@ -172,18 +170,17 @@ void LLPanelGroupBulkBan::submit()
 	}
 	if (group_datap)
 	{
-		BOOST_FOREACH(const LLGroupMgrGroupData::ban_list_t::value_type& group_ban_pair, group_datap->mBanList)
+		for (const auto& [group_ban_agent_id, group_ban_data] : group_datap->mBanList)
 		{
-			const LLUUID& group_ban_agent_id = group_ban_pair.first;
 			std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), group_ban_agent_id);
 			if (conflict != banned_agent_list.end())
 			{
 				LLAvatarName av_name;
 				LLAvatarNameCache::get(group_ban_agent_id, &av_name);
-				banned_avatar_names.push_back(av_name);
+				banned_avatar_names.emplace_back(av_name);
 
 				banned_agent_list.erase(conflict);
-				if (banned_agent_list.size() == 0)
+				if (banned_agent_list.empty())
 				{
 					break;
 				}
diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h
index c6254f72cfbf0fa47eee0719885f9d1b5ef41413..5c4f8e9135524bd68e9886de920e6ec71e6d268d 100644
--- a/indra/newview/llpanellogin.h
+++ b/indra/newview/llpanellogin.h
@@ -112,7 +112,7 @@ class LLPanelLogin:
 	static void updateServerCombo();
 
 private:
-	boost::scoped_ptr<LLPanelLoginListener> mListener;
+	std::unique_ptr<LLPanelLoginListener> mListener;
 
 	void updateLoginButtons();
 	void populateUserList(LLPointer<LLCredential> credential);
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index 91873a427a91621d02243bfb2327260592081a9d..63f9f599f1b7b0dc169952cc2958761048ee4b23 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -61,6 +61,8 @@ class LLPanelOutfitsInventory : public LLPanel
 
 	void openApearanceTab(const std::string& tab_name);
 
+    bool isCOFPanelActive() const;
+
 protected:
 	void updateVerbs();
 
@@ -72,7 +74,6 @@ class LLPanelOutfitsInventory : public LLPanel
 protected:
 	void 					initTabPanels();
 	void 					onTabChange();
-	bool 					isCOFPanelActive() const;
 	bool 					isOutfitsListPanelActive() const;
 	bool 					isOutfitsGalleryPanelActive() const;
 
diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp
index 3fbaad4dee7de4ed7cebc71a2735b12fdd8c9cec..307935f45fa0e01a51c04cd1f65fc7695d441692 100644
--- a/indra/newview/llpanelprofileclassifieds.cpp
+++ b/indra/newview/llpanelprofileclassifieds.cpp
@@ -650,6 +650,8 @@ BOOL LLPanelProfileClassified::postBuild()
     mSnapshotCtrl->setOnSelectCallback(boost::bind(&LLPanelProfileClassified::onTextureSelected, this));
     mSnapshotCtrl->setMouseEnterCallback(boost::bind(&LLPanelProfileClassified::onTexturePickerMouseEnter, this));
     mSnapshotCtrl->setMouseLeaveCallback(boost::bind(&LLPanelProfileClassified::onTexturePickerMouseLeave, this));
+    mSnapshotCtrl->setAllowLocalTexture(FALSE);
+    mSnapshotCtrl->setBakeTextureEnabled(FALSE);
     mEditIcon->setVisible(false);
 
     mMapButton->setCommitCallback(boost::bind(&LLPanelProfileClassified::onMapClick, this));
@@ -667,7 +669,7 @@ BOOL LLPanelProfileClassified::postBuild()
         mCategoryCombo->add(LLTrans::getString(iter->second));
     }
 
-    mClassifiedNameEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onChange, this), NULL);
+    mClassifiedNameEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onTitleChange, this), NULL);
     mClassifiedDescEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onChange, this));
     mCategoryCombo->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this));
     mContentTypeCombo->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this));
@@ -935,6 +937,8 @@ void LLPanelProfileClassified::onCancelClick()
     }
     else
     {
+        updateTabLabel(mClassifiedNameText->getValue());
+
         // Reload data to undo changes to forms
         LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId());
     }
@@ -955,7 +959,7 @@ void LLPanelProfileClassified::onSaveClick()
     }
     if(isNew() || isNewWithErrors())
     {
-        if(gStatusBar->getBalance() < getPriceForListing())
+        if(gStatusBar->getBalance() < MINIMUM_PRICE_FOR_LISTING)
         {
             LLNotificationsUtil::add("ClassifiedInsufficientFunds");
             return;
@@ -1403,6 +1407,12 @@ void LLPanelProfileClassified::onChange()
     enableSave(isDirty());
 }
 
+void LLPanelProfileClassified::onTitleChange()
+{
+    updateTabLabel(getClassifiedName());
+    onChange();
+}
+
 void LLPanelProfileClassified::doSave()
 {
     //*TODO: Fix all of this
@@ -1428,6 +1438,14 @@ void LLPanelProfileClassified::doSave()
 
 void LLPanelProfileClassified::onPublishFloaterPublishClicked()
 {
+    if (mPublishFloater->getPrice() < MINIMUM_PRICE_FOR_LISTING)
+    {
+        LLSD args;
+        args["MIN_PRICE"] = MINIMUM_PRICE_FOR_LISTING;
+        LLNotificationsUtil::add("MinClassifiedPrice", args);
+        return;
+    }
+
     setPriceForListing(mPublishFloater->getPrice());
 
     doSave();
diff --git a/indra/newview/llpanelprofileclassifieds.h b/indra/newview/llpanelprofileclassifieds.h
index 912819e86bce0729096def3ede8c3c0b76c48a05..d1aa5f55e3729cb2dd9ad049a9dad5e14723b1e8 100644
--- a/indra/newview/llpanelprofileclassifieds.h
+++ b/indra/newview/llpanelprofileclassifieds.h
@@ -257,6 +257,7 @@ class LLPanelProfileClassified
 
     void onSetLocationClick();
     void onChange();
+    void onTitleChange();
 
     void onPublishFloaterPublishClicked();
 
diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp
index 75b02fdf20c79486cb5f059ce6f951e937810fa2..8bbd4a748dfd59e3d67ff05dcc70654c30aca6ce 100644
--- a/indra/newview/llpanelprofilepicks.cpp
+++ b/indra/newview/llpanelprofilepicks.cpp
@@ -488,6 +488,8 @@ LLPanelProfilePick::LLPanelProfilePick()
  , mLocationChanged(false)
  , mNewPick(false)
  , mIsEditing(false)
+ , mRegionCallbackConnection()
+ , mParcelCallbackConnection()
 {
 }
 
@@ -505,6 +507,15 @@ LLPanelProfilePick::~LLPanelProfilePick()
     {
         LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this);
     }
+
+    if (mRegionCallbackConnection.connected())
+    {
+        mRegionCallbackConnection.disconnect();
+    }
+    if (mParcelCallbackConnection.connected())
+    {
+        mParcelCallbackConnection.disconnect();
+    }
 }
 
 void LLPanelProfilePick::setAvatarId(const LLUUID& avatar_id)
@@ -579,6 +590,8 @@ BOOL LLPanelProfilePick::postBuild()
 
     mSnapshotCtrl = getChild<LLTextureCtrl>("pick_snapshot");
     mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelProfilePick::onSnapshotChanged, this));
+    mSnapshotCtrl->setAllowLocalTexture(FALSE);
+    mSnapshotCtrl->setBakeTextureEnabled(FALSE);
 
     childSetAction("teleport_btn", boost::bind(&LLPanelProfilePick::onClickTeleport, this));
     childSetAction("show_on_map_btn", boost::bind(&LLPanelProfilePick::onClickMap, this));
@@ -667,6 +680,7 @@ void LLPanelProfilePick::setSnapshotId(const LLUUID& id)
 void LLPanelProfilePick::setPickName(const std::string& name)
 {
     mPickName->setValue(name);
+    mPickNameStr = name;
 }
 
 const std::string LLPanelProfilePick::getPickName()
@@ -749,6 +763,14 @@ BOOL LLPanelProfilePick::isDirty() const
 
 void LLPanelProfilePick::onClickSave()
 {
+    if (mRegionCallbackConnection.connected())
+    {
+        mRegionCallbackConnection.disconnect();
+    }
+    if (mParcelCallbackConnection.connected())
+    {
+        mParcelCallbackConnection.disconnect();
+    }
     sendUpdate();
 
     mLocationChanged = false;
@@ -756,6 +778,7 @@ void LLPanelProfilePick::onClickSave()
 
 void LLPanelProfilePick::onClickCancel()
 {
+    updateTabLabel(mPickNameStr);
     LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest(getAvatarId(), getPickId());
     mLocationChanged = false;
     enableSaveButton(FALSE);
diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h
index 228dfd59585838d2b34f7fa8efd5118701d5b306..76b1452431a3b734a1a33a0c9244f3a3b47b3f60 100644
--- a/indra/newview/llpanelprofilepicks.h
+++ b/indra/newview/llpanelprofilepicks.h
@@ -140,7 +140,7 @@ class LLPanelProfilePick
     void setParcelID(const LLUUID& parcel_id) override { mParcelId = parcel_id; }
     void setErrorStatus(S32 status, const std::string& reason) override {};
 
-protected:
+  protected:
 
     /**
      * Sends remote parcel info request to resolve parcel name from its ID.
@@ -231,6 +231,10 @@ class LLPanelProfilePick
     LLUUID mParcelId;
     LLUUID mPickId;
     LLUUID mRequestedId;
+    std::string mPickNameStr;
+
+    boost::signals2::connection mRegionCallbackConnection;
+    boost::signals2::connection mParcelCallbackConnection;
 
     bool mLocationChanged;
     bool mNewPick;
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index b938b304792e1d9bac22cdba389f713b5ed64139..3ed444a5af94e1618318a51ebdbadceea475b289 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -1067,6 +1067,12 @@ void LLTeleportHistoryPanel::onGearMenuAction(const LLSD& userdata)
         LLLandmarkActions::getSLURLfromPosGlobal(globalPos,
             boost::bind(&LLTeleportHistoryPanel::gotSLURLCallback, _1));
     }
+    else if ("remove" == command_name)
+    {
+        LLTeleportHistoryStorage::getInstance()->removeItem(index);
+        LLTeleportHistoryStorage::getInstance()->save();
+        showTeleportHistory();
+    }
 }
 
 bool LLTeleportHistoryPanel::isActionEnabled(const LLSD& userdata) const
@@ -1121,7 +1127,8 @@ bool LLTeleportHistoryPanel::isActionEnabled(const LLSD& userdata) const
     if ("teleport" == command_name
         || "view" == command_name
         || "show_on_map" == command_name
-        || "copy_slurl" == command_name)
+        || "copy_slurl" == command_name
+        || "remove" == command_name)
     {
         if (!mLastSelectedFlatlList)
         {
diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp
index 17b8ec0683fd04499444a8c376261568de603373..664e240484906ffbaa0abf487d2aab63fc07e994 100644
--- a/indra/newview/llpathfindingmanager.cpp
+++ b/indra/newview/llpathfindingmanager.cpp
@@ -114,7 +114,7 @@ class LinksetsResponder
 	void handleTerrainLinksetsResult(const LLSD &pContent);
 	void handleTerrainLinksetsError();
 
-    typedef boost::shared_ptr<LinksetsResponder> ptr_t;
+    typedef std::shared_ptr<LinksetsResponder> ptr_t;
 
 protected:
 
@@ -139,7 +139,7 @@ class LinksetsResponder
 	LLPathfindingObjectPtr                          mTerrainLinksetPtr;
 };
 
-typedef boost::shared_ptr<LinksetsResponder> LinksetsResponderPtr;
+typedef std::shared_ptr<LinksetsResponder> LinksetsResponderPtr;
 
 //---------------------------------------------------------------------------
 // LLPathfindingManager
diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h
index bb44f780c8e09e465b600cfad3afc700ae5be965..258d0fdef70580d4138a4729e3be6da2ab60eda7 100644
--- a/indra/newview/llpathfindingmanager.h
+++ b/indra/newview/llpathfindingmanager.h
@@ -107,8 +107,8 @@ class LLPathfindingManager : public LLSingleton<LLPathfindingManager>
     void navMeshStatusRequestCoro(std::string url, U64 regionHandle, bool isGetStatusOnly);
     void navAgentStateRequestCoro(std::string url);
     void navMeshRebakeCoro(std::string url, rebake_navmesh_callback_t rebakeNavMeshCallback);
-    void linksetObjectsCoro(std::string url, boost::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const;
-    void linksetTerrainCoro(std::string url, boost::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const;
+    void linksetObjectsCoro(std::string url, std::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const;
+    void linksetTerrainCoro(std::string url, std::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const;
     void charactersCoro(std::string url, request_id_t requestId, object_request_callback_t callback) const;
 
 	//void handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion, bool pIsGetStatusOnly);
diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h
index 87f32b8d56487245b7ff0ba0d890845b483cfb4a..ddc886f01cd2af9170ea37e74bdf8422b882478b 100644
--- a/indra/newview/llpathfindingnavmesh.h
+++ b/indra/newview/llpathfindingnavmesh.h
@@ -39,7 +39,7 @@
 class LLPathfindingNavMesh;
 class LLUUID;
 
-typedef boost::shared_ptr<LLPathfindingNavMesh> LLPathfindingNavMeshPtr;
+typedef std::shared_ptr<LLPathfindingNavMesh> LLPathfindingNavMeshPtr;
 
 class LLPathfindingNavMesh
 {
diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h
index baa1cc59799d4e51e1aac97dd513b55e6a2dc34c..b76f4421a62dba89516677d92f37557d9c396bb3 100644
--- a/indra/newview/llpathfindingnavmeshzone.h
+++ b/indra/newview/llpathfindingnavmeshzone.h
@@ -114,7 +114,7 @@ class LLPathfindingNavMeshZone
 		LLPathfindingNavMesh::navmesh_slot_t        mNavMeshSlot;
 	};
 
-	typedef boost::shared_ptr<NavMeshLocation> NavMeshLocationPtr;
+	typedef std::shared_ptr<NavMeshLocation> NavMeshLocationPtr;
 	typedef std::vector<NavMeshLocationPtr> NavMeshLocationPtrs;
 
 	void handleNavMeshLocation();
diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h
index b8d3ca236413f08be20eafa37b6a8c28acb89ebc..0114cce3f19b5f7324dd74e74536c0024ec7df62 100644
--- a/indra/newview/llpathfindingobject.h
+++ b/indra/newview/llpathfindingobject.h
@@ -41,7 +41,7 @@
 class LLPathfindingObject;
 class LLSD;
 
-typedef boost::shared_ptr<LLPathfindingObject> LLPathfindingObjectPtr;
+typedef std::shared_ptr<LLPathfindingObject> LLPathfindingObjectPtr;
 
 class LLPathfindingObject
 {
diff --git a/indra/newview/llpathfindingobjectlist.h b/indra/newview/llpathfindingobjectlist.h
index 61580582d370bdd4d2356d54ab6d9ab6678c640e..e2e0dce4da5a63a401e5e0cdcc7b18c5fa6d28ca 100644
--- a/indra/newview/llpathfindingobjectlist.h
+++ b/indra/newview/llpathfindingobjectlist.h
@@ -36,7 +36,7 @@
 
 class LLPathfindingObjectList;
 
-typedef boost::shared_ptr<LLPathfindingObjectList> LLPathfindingObjectListPtr;
+typedef std::shared_ptr<LLPathfindingObjectList> LLPathfindingObjectListPtr;
 typedef std::map<std::string, LLPathfindingObjectPtr> LLPathfindingObjectMap;
 
 class LLPathfindingObjectList
diff --git a/indra/newview/llperfstats.cpp b/indra/newview/llperfstats.cpp
index 64e66d520b85877da249314a61235b1851fbd3e1..8718f7e7b02cc31337531cc51301d14399bbb275 100644
--- a/indra/newview/llperfstats.cpp
+++ b/indra/newview/llperfstats.cpp
@@ -69,7 +69,7 @@ namespace LLPerfStats
     {
         assert_main_thread();
         // these following variables are proxies for pipeline statics we do not need a two way update (no llviewercontrol handler)
-        if( tuningFlag & NonImpostors ){ gSavedSettings.setU32("IndirectMaxNonImpostors", nonImpostors); };
+        if( tuningFlag & NonImpostors ){ gSavedSettings.setU32("RenderAvatarMaxNonImpostors", nonImpostors); };
         if( tuningFlag & ReflectionDetail ){ gSavedSettings.setS32("RenderReflectionDetail", reflectionDetail); };
         if( tuningFlag & FarClip ){ gSavedSettings.setF32("RenderFarClip", farClip); };
         if( tuningFlag & UserMinDrawDistance ){ gSavedSettings.setF32("AutoTuneRenderFarClipMin", userMinDrawDistance); };
@@ -378,7 +378,7 @@ namespace LLPerfStats
             auto count = countNearbyAvatars(std::min(LLPipeline::RenderFarClip, tunables.userImpostorDistance));
             if( count != tunables.nonImpostors )
             {
-                tunables.updateNonImposters( (count < LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER)?count : LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER );
+                tunables.updateNonImposters( (count < LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER)?count : 0 );
                 LL_DEBUGS("AutoTune") << "There are " << count << "avatars within " << std::min(LLPipeline::RenderFarClip, tunables.userImpostorDistance) << "m of the camera" << LL_ENDL;
             }
         }
diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp
index 1c14acd843489d115c4ee39360295dbf23094b81..f3455bb4f0f2974e19f2f4f17809c58de3088c1d 100644
--- a/indra/newview/llplacesinventorypanel.cpp
+++ b/indra/newview/llplacesinventorypanel.cpp
@@ -120,3 +120,13 @@ S32	LLPlacesInventoryPanel::notify(const LLSD& info)
 	}
 	return 0;
 }
+
+BOOL LLPlacesInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
+                                                      EAcceptance *accept, std::string &tooltip_msg)
+{
+    if (mAcceptsDragAndDrop) 
+    {
+        return LLInventoryPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+    }
+    return FALSE;
+}
diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h
index 3c27964ec58b774f46e3a372d729b3d27980dbe4..81b623b045ef3fb65f2e7c5c6720b7612d7c5320 100644
--- a/indra/newview/llplacesinventorypanel.h
+++ b/indra/newview/llplacesinventorypanel.h
@@ -47,11 +47,14 @@ class LLPlacesInventoryPanel : public LLAssetFilteredInventoryPanel
 	LLPlacesInventoryPanel(const Params& p);
 	~LLPlacesInventoryPanel();
 
-    LLFolderView * createFolderRoot(LLUUID root_id );
+    LLFolderView * createFolderRoot(LLUUID root_id ) override;
 	void saveFolderState();
 	void restoreFolderState();
 
-	virtual S32	notify(const LLSD& info) ;
+	virtual S32	notify(const LLSD& info) override;
+
+    BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
+                            EAcceptance *accept, std::string &tooltip_msg) override;
 
 private:
 	LLSaveFolderState*			mSavedFolderState;
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp
index 975e2bb91039d39c1d79f23999e04fcfa65c07c5..ea7d4800e055fd9bec5315e6fcdb5b515d1cedab 100644
--- a/indra/newview/llpreviewtexture.cpp
+++ b/indra/newview/llpreviewtexture.cpp
@@ -653,7 +653,7 @@ void LLPreviewTexture::adjustAspectRatio()
 			{
 				// No existing ratio found, create an element that will show image at original ratio
 				populateRatioList(); // makes sure previous custom ratio is cleared
-				std::string ratio = boost::lexical_cast<std::string>(num)+":" + boost::lexical_cast<std::string>(denom);
+				std::string ratio = std::to_string(num)+":" + std::to_string(denom);
 				mRatiosList.push_back(ratio);
 				combo->add(ratio);
 				combo->setCurrentByIndex(mRatiosList.size()- 1);
diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp
index efd84eaa6dfbc7f8cca9e110c21e591c92745f0b..bfa453a0ae1862f72286ef4be3453f13e7e2a734 100644
--- a/indra/newview/llscrollingpanelparam.cpp
+++ b/indra/newview/llscrollingpanelparam.cpp
@@ -259,15 +259,19 @@ void LLScrollingPanelParam::onHintHeldDown( LLVisualParamHint* hint )
 
 		// Make sure we're not taking the slider out of bounds
 		// (this is where some simple UI limits are stored)
-		F32 new_percent = weightToSlider(new_weight);
-		if (mSlider->getMinValue() < new_percent
-			&& new_percent < mSlider->getMaxValue())
+		F32 new_percent = weightToPercent(new_weight);
+		LLSliderCtrl* slider = getChild<LLSliderCtrl>("param slider");
+		if (slider)
 		{
-			mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight);
-			mWearable->writeToAvatar(gAgentAvatarp);
-			gAgentAvatarp->updateVisualParams();
+			if (slider->getMinValue() < new_percent
+				&& new_percent < slider->getMaxValue())
+			{
+				mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight);
+				mWearable->writeToAvatar(gAgentAvatarp);
+				gAgentAvatarp->updateVisualParams();
 
-			mSlider->setValue( weightToSlider( new_weight ) );
+				slider->setValue( weightToPercent( new_weight ) );
+			}
 		}
 	}
 }
@@ -288,13 +292,17 @@ void LLScrollingPanelParam::onHintMinMouseUp( void* userdata )
 		F32 range = self->mHintMax->getVisualParamWeight() - self->mHintMin->getVisualParamWeight();
 		// step a fraction in the negative directiona
 		F32 new_weight = current_weight - (range / 10.f);
-		F32 new_percent = self->weightToSlider(new_weight);
-		if (self->mSlider->getMinValue() < new_percent
-			&& new_percent < self->mSlider->getMaxValue())
+		F32 new_percent = self->weightToPercent(new_weight);
+		LLSliderCtrl* slider = self->getChild<LLSliderCtrl>("param slider");
+		if (slider)
 		{
-			self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight);
-			self->mWearable->writeToAvatar(gAgentAvatarp);
-			self->mSlider->setValue( self->weightToSlider( new_weight ) );
+			if (slider->getMinValue() < new_percent
+				&& new_percent < slider->getMaxValue())
+			{
+				self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight);
+				self->mWearable->writeToAvatar(gAgentAvatarp);
+				slider->setValue( self->weightToPercent( new_weight ) );
+			}
 		}
 	}
 
@@ -318,16 +326,33 @@ void LLScrollingPanelParam::onHintMaxMouseUp( void* userdata )
 			F32 range = self->mHintMax->getVisualParamWeight() - self->mHintMin->getVisualParamWeight();
 			// step a fraction in the negative direction
 			F32 new_weight = current_weight + (range / 10.f);
-			F32 new_percent = self->weightToSlider(new_weight);
-			if (self->mSlider->getMinValue() < new_percent
-				&& new_percent < self->mSlider->getMaxValue())
+			F32 new_percent = self->weightToPercent(new_weight);
+			LLSliderCtrl* slider = self->getChild<LLSliderCtrl>("param slider");
+			if (slider)
 			{
-				self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight);
-				self->mWearable->writeToAvatar(gAgentAvatarp);
-				self->mSlider->setValue( self->weightToSlider( new_weight ) );
+				if (slider->getMinValue() < new_percent
+					&& new_percent < slider->getMaxValue())
+				{
+					self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight);
+					self->mWearable->writeToAvatar(gAgentAvatarp);
+					slider->setValue( self->weightToPercent( new_weight ) );
+				}
 			}
 		}
 	}
 
 	LLVisualParamHint::requestHintUpdates( self->mHintMin, self->mHintMax );
 }
+
+
+F32 LLScrollingPanelParam::weightToPercent( F32 weight )
+{
+	LLViewerVisualParam* param = mParam;
+	return (weight - param->getMinWeight()) /  (param->getMaxWeight() - param->getMinWeight()) * 100.f;
+}
+
+F32 LLScrollingPanelParam::percentToWeight( F32 percent )
+{
+	LLViewerVisualParam* param = mParam;
+	return percent / 100.f * (param->getMaxWeight() - param->getMinWeight()) + param->getMinWeight();
+}
diff --git a/indra/newview/llscrollingpanelparam.h b/indra/newview/llscrollingpanelparam.h
index dc344486fc6b8469389efea7e1b74eecb3b286e7..c7a47d5c7a585fe924de09d0ea07ed269d99ac01 100644
--- a/indra/newview/llscrollingpanelparam.h
+++ b/indra/newview/llscrollingpanelparam.h
@@ -61,6 +61,9 @@ class LLScrollingPanelParam : public LLScrollingPanelParamBase
 	void				onHintMouseDown( LLVisualParamHint* hint );
 	void				onHintHeldDown( LLVisualParamHint* hint );
 
+	F32					weightToPercent( F32 weight );
+	F32					percentToWeight( F32 percent );
+
 public:
 	// Constants for LLPanelVisualParam
 	const static F32 PARAM_STEP_TIME_THRESHOLD;
diff --git a/indra/newview/llscrollingpanelparambase.cpp b/indra/newview/llscrollingpanelparambase.cpp
index 2a6c25235df8b00450a87ff95125b5135d97c5e2..fe7a3627235560c7cd38b126d7417477c928aece 100644
--- a/indra/newview/llscrollingpanelparambase.cpp
+++ b/indra/newview/llscrollingpanelparambase.cpp
@@ -43,7 +43,6 @@ LLScrollingPanelParamBase::LLScrollingPanelParamBase( const LLPanel::Params& pan
 						      LLViewerJointMesh* mesh, LLViewerVisualParam* param, BOOL allow_modify, LLWearable* wearable, LLJoint* jointp, BOOL use_hints)
 	: LLScrollingPanel( panel_params ),
 	  mParam(param),
-	  mSlider(nullptr),
 	  mAllowModify(allow_modify),
 	  mWearable(wearable)
 {
@@ -51,15 +50,13 @@ LLScrollingPanelParamBase::LLScrollingPanelParamBase( const LLPanel::Params& pan
 		buildFromFile( "panel_scrolling_param.xml");
 	else
 		buildFromFile( "panel_scrolling_param_base.xml");
-
-	mSlider = getChild<LLSliderCtrl>("param slider");
-	mSlider->setMaxValue(100.f * (mParam->getMaxWeight() - mParam->getMinWeight()));
-	mSlider->setValue(weightToSlider(param->getWeight()));
+	
+	getChild<LLUICtrl>("param slider")->setValue(weightToPercent(param->getWeight()));
 
 	std::string display_name = LLTrans::getString(param->getDisplayName());
-	mSlider->setLabelArg("[DESC]", display_name);
-	mSlider->setEnabled(mAllowModify);
-	mSlider->setCommitCallback(boost::bind(LLScrollingPanelParamBase::onSliderMoved, mSlider, this));
+	getChild<LLUICtrl>("param slider")->setLabelArg("[DESC]", display_name);
+	getChildView("param slider")->setEnabled(mAllowModify);
+	childSetCommitCallback("param slider", LLScrollingPanelParamBase::onSliderMoved, this);
 
 	setVisible(FALSE);
 	setBorderVisible( FALSE );
@@ -80,9 +77,9 @@ void LLScrollingPanelParamBase::updatePanel(BOOL allow_modify)
 	}
 
 	F32 current_weight = mWearable->getVisualParamWeight( param->getID() );
-	mSlider->setValue(weightToSlider( current_weight ) );
+	getChild<LLUICtrl>("param slider")->setValue(weightToPercent( current_weight ) );
 	mAllowModify = allow_modify;
-	mSlider->setEnabled(mAllowModify);
+	getChildView("param slider")->setEnabled(mAllowModify);
 }
 
 // static
@@ -93,7 +90,7 @@ void LLScrollingPanelParamBase::onSliderMoved(LLUICtrl* ctrl, void* userdata)
 	LLViewerVisualParam* param = self->mParam;
 	
 	F32 current_weight = self->mWearable->getVisualParamWeight( param->getID() );
-	F32 new_weight = self->sliderToWeight( (F32)slider->getValue().asReal() );
+	F32 new_weight = self->percentToWeight( (F32)slider->getValue().asReal() );
 	if (current_weight != new_weight )
 	{
 		self->mWearable->setVisualParamWeight( param->getID(), new_weight);
@@ -102,12 +99,14 @@ void LLScrollingPanelParamBase::onSliderMoved(LLUICtrl* ctrl, void* userdata)
 	}
 }
 
-F32 LLScrollingPanelParamBase::weightToSlider(F32 weight)
+F32 LLScrollingPanelParamBase::weightToPercent( F32 weight )
 {
-	return (weight - mParam->getMinWeight()) * 100.f;
+	LLViewerVisualParam* param = mParam;
+	return (weight - param->getMinWeight()) /  (param->getMaxWeight() - param->getMinWeight()) * 100.f;
 }
 
-F32 LLScrollingPanelParamBase::sliderToWeight(F32 slider)
+F32 LLScrollingPanelParamBase::percentToWeight( F32 percent )
 {
-	return slider / 100.f + mParam->getMinWeight();
+	LLViewerVisualParam* param = mParam;
+	return percent / 100.f * (param->getMaxWeight() - param->getMinWeight()) + param->getMinWeight();
 }
diff --git a/indra/newview/llscrollingpanelparambase.h b/indra/newview/llscrollingpanelparambase.h
index e7f88a21bd0037cb8d12d0ff37380ffe02b2a94d..95388262514bc455c4e6f0170157d9c9c366fd37 100644
--- a/indra/newview/llscrollingpanelparambase.h
+++ b/indra/newview/llscrollingpanelparambase.h
@@ -36,7 +36,6 @@ class LLViewerVisualParam;
 class LLWearable;
 class LLVisualParamHint;
 class LLViewerVisualParam;
-class LLSliderCtrl;
 class LLJoint;
 
 class LLScrollingPanelParamBase : public LLScrollingPanel
@@ -50,13 +49,11 @@ class LLScrollingPanelParamBase : public LLScrollingPanel
 
 	static void			onSliderMoved(LLUICtrl* ctrl, void* userdata);
 
-	F32					weightToSlider(F32 weight);
-	F32					sliderToWeight(F32 slider);
+	F32					weightToPercent( F32 weight );
+	F32					percentToWeight( F32 percent );
 
 public:
 	LLViewerVisualParam* mParam;
-	LLSliderCtrl* mSlider;
-
 protected:
 	BOOL mAllowModify;
 	LLWearable *mWearable;
diff --git a/indra/newview/llsculptidsize.cpp b/indra/newview/llsculptidsize.cpp
index 5d051d0ebf060bf093d1e48a408e0647701fbc39..bedee3221387bbbea3f77f0434b5ce32a0ef1de4 100644
--- a/indra/newview/llsculptidsize.cpp
+++ b/indra/newview/llsculptidsize.cpp
@@ -66,7 +66,7 @@ void LLSculptIDSize::inc(const LLDrawable *pdrawable, int sz)
 	if (itLU.first == itLU.second)
 	{ //register
 		//llassert(mSizeInfo.get<tag_BY_DRAWABLE>().end() == mSizeInfo.get<tag_BY_DRAWABLE>().find(pdrawable));
-		mSizeInfo.get<tag_BY_DRAWABLE>().insert(Info(pdrawable, sz, boost::make_shared<SizeSum>(sz), sculptId));
+		mSizeInfo.get<tag_BY_DRAWABLE>().insert(Info(pdrawable, sz, std::make_shared<SizeSum>(sz), sculptId));
 		total_size = sz;
 	}
 	else
diff --git a/indra/newview/llsculptidsize.h b/indra/newview/llsculptidsize.h
index 87ee417b867317e15bb91bcf1e2ff569cc7a8ca8..679fcbd44c082994b11d23ca6a6992c161ca13a1 100644
--- a/indra/newview/llsculptidsize.h
+++ b/indra/newview/llsculptidsize.h
@@ -52,7 +52,7 @@ class LLSculptIDSize
 
 	struct Info
 	{
-		typedef boost::shared_ptr<SizeSum> PtrSizeSum;
+		typedef std::shared_ptr<SizeSum> PtrSizeSum;
 
 		Info(const LLDrawable *drawable, int size, PtrSizeSum sizeInfo, LLUUID sculptId)
 			: mDrawable(drawable)
diff --git a/indra/newview/llsearchableui.h b/indra/newview/llsearchableui.h
index 31f11eb8ef037ea16e269ba335dd142d806b0280..84fcefb835614192956c9fd105f42836f20a128c 100644
--- a/indra/newview/llsearchableui.h
+++ b/indra/newview/llsearchableui.h
@@ -93,7 +93,7 @@ namespace ll
 	{
 		struct SearchableItem;
 
-		typedef boost::shared_ptr< SearchableItem > SearchableItemPtr;
+		typedef std::shared_ptr< SearchableItem > SearchableItemPtr;
 
 		typedef std::vector< SearchableItemPtr > tSearchableItemList;
 
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index aed9dba7ef825a427721f36b00db3f90e3e45112..7571d361a42a299c903cd464a38d871bc95b4235 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -361,6 +361,15 @@ void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible, const std::string
     }
 }
 
+bool LLSidepanelAppearance::isCOFPanelVisible()
+{
+    if (mPanelOutfitsInventory && mPanelOutfitsInventory->getVisible())
+    {
+        return mPanelOutfitsInventory->isCOFPanelActive();
+    }
+    return false;
+}
+
 void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch)
 {
 	if (!mOutfitEdit || mOutfitEdit->getVisible() == visible)
diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h
index bb9709a2b84c89c385def7e54d47bae059ed0f2b..e67652d6f706f4ebe104a76922652b0383d8388d 100644
--- a/indra/newview/llsidepanelappearance.h
+++ b/indra/newview/llsidepanelappearance.h
@@ -66,6 +66,8 @@ class LLSidepanelAppearance : public LLPanel
 	void updateToVisibility( const LLSD& new_visibility );
 	LLPanelEditWearable* getWearable(){ return mEditWearable; }
 
+    bool isCOFPanelVisible();
+
 private:
 	void onFilterEdit(const std::string& search_string);
 	void onVisibilityChanged ( const LLSD& new_visibility );
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index f6628293ee0ffc524c67a280f6a401dd0c1c8a38..9157d20f9887afa2e8bcfce7c5888266b658a8ad 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -46,8 +46,6 @@
 #include "llviewercontrol.h"  // HACK for destinations guide on startup
 #include "llinventorymodel.h" // HACK to disable starter avatars button for NUX
 
-#include <boost/foreach.hpp>
-
 LLToolBarView* gToolBarView = NULL;
 
 static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view");
@@ -282,7 +280,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
 			LLToolBarEnums::ButtonType button_type = toolbar_set.left_toolbar.button_display_mode;
 			mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->setButtonType(button_type);
 		}
-		BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.left_toolbar.commands)
+		for (const LLCommandId::Params& command_params : toolbar_set.left_toolbar.commands)
 		{
 			if (!addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_LEFT]))
 			{
@@ -297,7 +295,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
 			LLToolBarEnums::ButtonType button_type = toolbar_set.right_toolbar.button_display_mode;
 			mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->setButtonType(button_type);
 		}
-		BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.right_toolbar.commands)
+		for (const LLCommandId::Params& command_params : toolbar_set.right_toolbar.commands)
 		{
 			if (!addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]))
 			{
@@ -312,7 +310,7 @@ bool LLToolBarView::loadToolbars(bool force_default)
 			LLToolBarEnums::ButtonType button_type = toolbar_set.bottom_toolbar.button_display_mode;
 			mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->setButtonType(button_type);
 		}
-		BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.bottom_toolbar.commands)
+		for (const LLCommandId::Params& command_params : toolbar_set.bottom_toolbar.commands)
 		{
 			if (!addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]))
 			{
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 8353d4d1d78f3c88d359eb4b31b36515925cb444..1b34bed2da9b92ba82af7739b2ec9caadc9b75ae 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -87,6 +87,7 @@
 #include "llfloaterimsession.h"
 #include "llfloaterinspect.h"
 #include "llfloaterinventorysettings.h"
+#include "llfloaterinventorythumbnailshelper.h"
 #include "llfloaterjoystick.h"
 #include "llfloaterlagmeter.h"
 #include "llfloaterland.h"
@@ -249,6 +250,7 @@ class LLFloaterOpenHandler : public LLCommandHandler
                 "group_picker",
                 "hud",
                 "incoming_call",
+                "inventory_thumbnails_helper",
                 "linkreplace",
                 "mem_leaking",
                 "marketplace_validation",
@@ -335,7 +337,7 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterReg::add("build", "floater_tools.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTools>);
 	LLFloaterReg::add("build_options", "floater_build_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuildOptions>);
 	LLFloaterReg::add("bumps", "floater_bumps.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBump>);
-
+    
 	LLFloaterReg::add("camera", "floater_camera.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCamera>);
 	LLFloaterReg::add("camera_presets", "floater_camera_presets.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCameraPresets>);
 	LLFloaterReg::add("chat_voice", "floater_voice_chat_volume.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterChatVoiceVolume>);
@@ -384,6 +386,7 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIncomingCallDialog>);
 	LLFloaterReg::add("inventory", "floater_my_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
 	LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInspect>);
+    LLFloaterReg::add("inventory_thumbnails_helper", "floater_inventory_thumbnails_helper.xml", (LLFloaterBuildFunc) &LLFloaterReg::build<LLFloaterInventoryThumbnailsHelper>);
 	LLFloaterReg::add("item_properties", "floater_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterItemProperties>);
     LLFloaterReg::add("task_properties", "floater_task_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterItemProperties>);
     LLFloaterReg::add("inventory_settings", "floater_inventory_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInventorySettings>);
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 0a0a19d0959900f6dc94a080f1e0539e499da2dd..b9a7c9448fdf72cd304f92e244bf79d2b17f1dbc 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -668,15 +668,14 @@ void LLViewerInventoryCategory::setVersion(S32 version)
 	mVersion = version;
 }
 
-bool LLViewerInventoryCategory::fetch()
+bool LLViewerInventoryCategory::fetch(S32 expiry_seconds)
 {
 	if((VERSION_UNKNOWN == getVersion())
 	   && mDescendentsRequested.hasExpired())	//Expired check prevents multiple downloads.
 	{
 		LL_DEBUGS(LOG_INV) << "Fetching category children: " << mName << ", UUID: " << mUUID << LL_ENDL;
-		const F32 FETCH_TIMER_EXPIRY = 10.0f;
 		mDescendentsRequested.reset();
-		mDescendentsRequested.setTimerExpirySec(FETCH_TIMER_EXPIRY);
+		mDescendentsRequested.setTimerExpirySec(expiry_seconds);
 
 		std::string url;
 		if (gAgent.getRegion())
@@ -685,7 +684,7 @@ bool LLViewerInventoryCategory::fetch()
 		}
 		else
 		{
-			LL_WARNS(LOG_INV) << "agent region is null" << LL_ENDL;
+			LL_WARNS_ONCE(LOG_INV) << "agent region is null" << LL_ENDL;
 		}
 		if (!url.empty() || AISAPI::isAvailable())
 		{
@@ -709,7 +708,13 @@ LLViewerInventoryCategory::EFetchType LLViewerInventoryCategory::getFetching()
 
 void LLViewerInventoryCategory::setFetching(LLViewerInventoryCategory::EFetchType fetching)
 {
-    if (fetching > mFetching) // allow a switch from normal to recursive
+    if (fetching == FETCH_FAILED)
+    {
+        const F32 FETCH_FAILURE_EXPIRY = 60.0f;
+        mDescendentsRequested.setTimerExpirySec(FETCH_FAILURE_EXPIRY);
+        mFetching = fetching;
+    }
+    else if (fetching > mFetching) // allow a switch from normal to recursive
     {
         if (mDescendentsRequested.hasExpired() || (mFetching == FETCH_NONE))
         {
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index e043285ffb0cd28afff2fb08fc65c630f85d6a68..0d0ccc6643046eb422c994cacf32cd114ad6f5fb 100644
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -209,13 +209,15 @@ class LLViewerInventoryCategory  : public LLInventoryCategory
 	S32 getVersion() const;
 	void setVersion(S32 version);
 
-	// Returns true if a fetch was issued (not nessesary in progress).
-	bool fetch();
+    // Returns true if a fetch was issued (not nessesary in progress).
+    // no requests will happen during expiry_seconds even if fetch completed
+    bool fetch(S32 expiry_seconds = 10);
 
     typedef enum {
         FETCH_NONE = 0,
         FETCH_NORMAL,
         FETCH_RECURSIVE,
+        FETCH_FAILED, // back off
     } EFetchType;
     EFetchType getFetching();
     // marks as fetch being in progress or as done
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index ad7c4bcefa34c028394744c24fab7c4888a706ee..03899b6b8f94bb7269d7e3c903db6b240042e553 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -431,7 +431,7 @@ class LLViewerMediaImpl
 	
 private:
 	// a single media url with some data and an impl.
-	boost::shared_ptr<LLPluginClassMedia> mMediaSource;
+	std::shared_ptr<LLPluginClassMedia> mMediaSource;
     LLMutex mLock;
 	F64		mZoomFactor;
 	LLUUID mTextureId;
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 94efab3f4ba991b13465fcf2d0b4aa54aff3c2b4..625d32f59d2db92441e25389efe1223901fec0a6 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -102,6 +102,7 @@
 #include "llsceneview.h"
 #include "llscenemonitor.h"
 #include "llselectmgr.h"
+#include "llsidepanelappearance.h"
 #include "llspellcheckmenuhandler.h"
 #include "llstatusbar.h"
 #include "lltextureview.h"
@@ -1463,6 +1464,31 @@ class LLAdvancedCheckDebugUnicode : public view_listener_t
 
 
 
+//////////////////
+// DEBUG CAMERA //
+//////////////////
+
+
+class LLAdvancedToggleDebugCamera : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		LLView::sDebugCamera = !(LLView::sDebugCamera);
+		LLFloaterCamera::onDebugCameraToggled();
+		return true;
+	}
+};
+
+class LLAdvancedCheckDebugCamera : public view_listener_t
+{
+	bool handleEvent(const LLSD& userdata)
+	{
+		return LLView::sDebugCamera;
+	}
+};
+
+
+
 ///////////////////////
 // XUI NAME TOOLTIPS //
 ///////////////////////
@@ -6709,6 +6735,13 @@ void handle_edit_outfit()
 
 void handle_now_wearing()
 {
+    LLSidepanelAppearance *panel_appearance = dynamic_cast<LLSidepanelAppearance *>(LLFloaterSidePanelContainer::getPanel("appearance"));
+    if (panel_appearance && panel_appearance->isInVisibleChain() && panel_appearance->isCOFPanelVisible())
+    {
+        LLFloaterReg::findInstance("appearance")->closeFloater();
+        return;
+    }
+
     LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "now_wearing"));
 }
 
@@ -9575,6 +9608,8 @@ void initialize_menus()
 	view_listener_t::addMenu(new LLAdvancedToggleDebugViews(), "Advanced.ToggleDebugViews");
 	view_listener_t::addMenu(new LLAdvancedCheckDebugUnicode(), "Advanced.CheckDebugUnicode");
 	view_listener_t::addMenu(new LLAdvancedToggleDebugUnicode(), "Advanced.ToggleDebugUnicode");
+	view_listener_t::addMenu(new LLAdvancedCheckDebugCamera(), "Advanced.CheckDebugCamera");
+	view_listener_t::addMenu(new LLAdvancedToggleDebugCamera(), "Advanced.ToggleDebugCamera");
 	view_listener_t::addMenu(new LLAdvancedToggleXUINameTooltips(), "Advanced.ToggleXUINameTooltips");
 	view_listener_t::addMenu(new LLAdvancedCheckXUINameTooltips(), "Advanced.CheckXUINameTooltips");
 	view_listener_t::addMenu(new LLAdvancedToggleDebugMouseEvents(), "Advanced.ToggleDebugMouseEvents");
diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h
index ff2ee693fd00e638b7e50492c32764a6f95538a8..6b9df6df287204a50926f7a124becaea0ffc56d4 100644
--- a/indra/newview/llviewermenufile.h
+++ b/indra/newview/llviewermenufile.h
@@ -145,7 +145,7 @@ class LLMediaFilePicker : public LLFilePickerThread
     virtual void notify(const std::vector<std::string>& filenames);
 
 private:
-    boost::shared_ptr<LLPluginClassMedia> mPlugin;
+    std::shared_ptr<LLPluginClassMedia> mPlugin;
 };
 
 
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index c50365db2aad18c59fdc07388b1eea6e696ad00c..ff2753d2406ebb0a6e27962af1b7acbf00512944 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -119,8 +119,6 @@
 #include "llviewerregion.h"
 #include "llfloaterregionrestarting.h"
 
-#include <boost/foreach.hpp>
-
 #include "llnotificationmanager.h" //
 #include "llexperiencecache.h"
 
@@ -4165,6 +4163,12 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data)
 					LLVOAvatar::AnimSourceIterator anim_it = avatarp->mAnimationSources.find(object_id);
 					for (;anim_it != avatarp->mAnimationSources.end(); ++anim_it)
 					{
+						if (anim_it->first != object_id)
+						{
+							// elements with the same key are always contiguous, bail if we went past the
+							// end of this object's animations
+							break;
+						}
 						if (anim_it->second == animation_id)
 						{
 							anim_found = TRUE;
@@ -5627,7 +5631,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp
 		BOOL caution = FALSE;
 		S32 count = 0;
 		std::string perms;
-		BOOST_FOREACH(script_perm_t script_perm, SCRIPT_PERMISSIONS)
+		for (const script_perm_t& script_perm : SCRIPT_PERMISSIONS)
 		{
 			if ((orig_questions & script_perm.permbit)
 				&& script_perm.caution)
@@ -5871,7 +5875,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
 		S32 known_questions = 0;
 		bool has_not_only_debit = questions ^ SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_DEBIT].permbit;
 		// check the received permission flags against each permission
-		BOOST_FOREACH(script_perm_t script_perm, SCRIPT_PERMISSIONS)
+		for (const script_perm_t& script_perm : SCRIPT_PERMISSIONS)
 		{
 			if (questions & script_perm.permbit)
 			{
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 5bc7523be1c3733298bbeb6a4f52dcc09d8275ca..a53bd982d438d0bea87821e4a97101dcddba0ad7 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -2043,6 +2043,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
 			{
 				LL_WARNS() << objectp->mID << " has self as parent, skipping!" 
 					<< LL_ENDL;
+                ++iter;
 				continue;
 			}
 
diff --git a/indra/newview/llviewerparcelaskplay.cpp b/indra/newview/llviewerparcelaskplay.cpp
index afbe2c94de8e56443501002fd6e2ce1a3a41db3e..aea06834b20dba1d85247e364c2b281508369e33 100644
--- a/indra/newview/llviewerparcelaskplay.cpp
+++ b/indra/newview/llviewerparcelaskplay.cpp
@@ -287,7 +287,7 @@ void LLViewerParcelAskPlay::saveSettings()
             if ((iter_parcel->second.mDate.secondsSinceEpoch() + (F64SecondsImplicit)U32Days(30)) > LLTimer::getTotalSeconds())
             {
                 // write unexpired parcels
-                std::string parcel_id = boost::lexical_cast<std::string>(iter_parcel->first);
+                std::string parcel_id = std::to_string(iter_parcel->first);
                 write_llsd[key][parcel_id] = LLSD();
                 write_llsd[key][parcel_id]["mode"] = (LLSD::Integer)iter_parcel->second.mMode;
                 write_llsd[key][parcel_id]["date"] = iter_parcel->second.mDate;
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 3225299493046e282fcce764a027c3246ea5493e..2bab50300b62f98b4d3f43197a67392e1022c708 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -592,7 +592,7 @@ std::string LLViewerShaderMgr::loadBasicShaders()
 
 	std::map<std::string, std::string> attribs;
 	attribs["MAX_JOINTS_PER_MESH_OBJECT"] = 
-		boost::lexical_cast<std::string>(LLSkinningUtil::getMaxJointCount());
+		std::to_string(LLSkinningUtil::getMaxJointCount());
 
     BOOL ssr = gSavedSettings.getBOOL("RenderScreenSpaceReflections");
 
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index ccef006a0709336746892cff142d08c455ebf474..346073b8a133fc270811586bbf40bdcb9975d730 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -538,8 +538,8 @@ class LLViewerWindow : public LLWindowCallbacks
 	bool			mStatesDirty;
 	U32			mCurrResolutionIndex;
 
-	boost::scoped_ptr<LLWindowListener> mWindowListener;
-	boost::scoped_ptr<LLViewerWindowListener> mViewerWindowListener;
+	std::unique_ptr<LLWindowListener> mWindowListener;
+	std::unique_ptr<LLViewerWindowListener> mViewerWindowListener;
 
 	// Object temporarily hovered over while dragging
 	LLPointer<LLViewerObject>	mDragHoveredObject;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 9579a5e4b126c953938a0b1bcd427fa4086f0969..8ecfa3eed1d814c4a6c50f3259180715a50b8865 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -4291,6 +4291,15 @@ void LLVOAvatar::updateOrientation(LLAgent& agent, F32 speed, F32 delta_time)
 				if (mTurning)
 				{
 					pelvis_rot_threshold *= 0.4f;
+                    // account for fps, assume that above value is for ~60fps
+                    constexpr F32 default_frame_sec = 0.016f;
+                    F32 prev_frame_sec = LLFrameTimer::getFrameDeltaTimeF32();
+                    if (default_frame_sec > prev_frame_sec)
+                    {
+                        // reduce threshold since turn rate per second is constant,
+                        // shorter frame means shorter turn.
+                        pelvis_rot_threshold *= prev_frame_sec/default_frame_sec;
+                    }
 				}
 
 				// am I done turning?
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 7b24b9ee0277bfcf117f31b81717d3238ff9a273..f12fc3babc708529e88d1b74bdc828a7e7ea66fe 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -834,7 +834,11 @@ void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id)
 	for (AnimSourceIterator motion_it = mAnimationSources.find(source_id); motion_it != mAnimationSources.end(); )
 	{
 		gAgent.sendAnimationRequest(motion_it->second, ANIM_REQUEST_STOP);
-		mAnimationSources.erase(motion_it++);
+		mAnimationSources.erase(motion_it);
+		// Must find() after each erase() to deal with potential iterator invalidation
+		// This also ensures that we don't go past the end of this source's animations
+		// into those of another source.
+		motion_it = mAnimationSources.find(source_id);
 	}
 
 
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 1b9aef193ccc188bcb68f2e61cc39b71d6cee461..310c9ee2977289306a2be4f23b8275df2a001a3f 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -5971,7 +5971,7 @@ void LLVivoxVoiceClient::filePlaybackSetMode(bool vox, float speed)
 }
 
 //------------------------------------------------------------------------
-std::set<LLVivoxVoiceClient::sessionState::wptr_t> LLVivoxVoiceClient::sessionState::mSession;
+std::set<LLVivoxVoiceClient::sessionState::wptr_t, std::owner_less<LLVivoxVoiceClient::sessionState::wptr_t>> LLVivoxVoiceClient::sessionState::mSession;
 
 
 LLVivoxVoiceClient::sessionState::sessionState() :
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index ae2aec0e9ce9372b15ca2ee12a174e6300824636..7e1835d876caa13019e278099747f44d68b6360e 100644
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -294,8 +294,8 @@ class LLVivoxVoiceClient :	public LLSingleton<LLVivoxVoiceClient>,
 		bool mAvatarIDValid;
 		bool mIsSelf;
 	};
-    typedef boost::shared_ptr<participantState> participantStatePtr_t;
-    typedef boost::weak_ptr<participantState> participantStateWptr_t;
+    typedef std::shared_ptr<participantState> participantStatePtr_t;
+    typedef std::weak_ptr<participantState> participantStateWptr_t;
 
     typedef std::map<const std::string, participantStatePtr_t> participantMap;
     typedef std::map<const LLUUID, participantStatePtr_t> participantUUIDMap;
@@ -303,10 +303,10 @@ class LLVivoxVoiceClient :	public LLSingleton<LLVivoxVoiceClient>,
 	struct sessionState
 	{
     public:
-        typedef boost::shared_ptr<sessionState> ptr_t;
-        typedef boost::weak_ptr<sessionState> wptr_t;
+        typedef std::shared_ptr<sessionState> ptr_t;
+        typedef std::weak_ptr<sessionState> wptr_t;
 
-        typedef boost::function<void(const ptr_t &)> sessionFunc_t;
+        typedef std::function<void(const ptr_t &)> sessionFunc_t;
 
         static ptr_t createSession();
 		~sessionState();
@@ -370,7 +370,7 @@ class LLVivoxVoiceClient :	public LLSingleton<LLVivoxVoiceClient>,
     private:
         sessionState();
 
-        static std::set<wptr_t> mSession;   // canonical list of outstanding sessions.
+        static std::set<wptr_t, std::owner_less<wptr_t>> mSession;   // canonical list of outstanding sessions.
         std::set<wptr_t>::iterator  mMyIterator;    // used for delete
 
         static void for_eachPredicate(const wptr_t &a, sessionFunc_t func);
@@ -381,7 +381,7 @@ class LLVivoxVoiceClient :	public LLSingleton<LLVivoxVoiceClient>,
         static bool testByCallerId(const LLVivoxVoiceClient::sessionState::wptr_t &a, LLUUID participantId);
 
 	};
-    typedef boost::shared_ptr<sessionState> sessionStatePtr_t;
+    typedef std::shared_ptr<sessionState> sessionStatePtr_t;
 
     typedef std::map<std::string, sessionStatePtr_t> sessionMap;
 	
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 57a7d6a90b38e2a1ab85d8b089af1509b0405372..e3f2afadc5d2c96d30ad3d0a5b3a1e20edec6f15 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4575,6 +4575,11 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
         }
     }
 
+    if (getClickAction() == CLICK_ACTION_IGNORE && !LLFloater::isVisible(gFloaterTools))
+    {
+        return FALSE;
+    }
+
 	BOOL ret = FALSE;
 
 	LLVolume* volume = getVolume();
diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp
index aa8c79b0d280a89e6cb30860017f94c18cc854aa..0edabf358f8b01cc000594445f1c46ccf4d138ef 100644
--- a/indra/newview/llwindowlistener.cpp
+++ b/indra/newview/llwindowlistener.cpp
@@ -388,7 +388,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request)
 	LLCoordGL pos(request["x"].asInteger(), request["y"].asInteger());
 	bool has_pos(request.has("x") && request.has("y"));
 
-	boost::scoped_ptr<LLView::TemporaryDrilldownFunc> tempfunc;
+	std::unique_ptr<LLView::TemporaryDrilldownFunc> tempfunc;
 
 	// Documentation for mouseDown(), mouseUp() and mouseMove() claims you
 	// must either specify ["path"], or both of ["x"] and ["y"]. You MAY
diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp
index b816f9a3b5ec2a738aa8b32b3a6a4c7a208593b0..3c2c6d15c45e7845ed302787402508013cf3f48b 100644
--- a/indra/newview/llxmlrpclistener.cpp
+++ b/indra/newview/llxmlrpclistener.cpp
@@ -544,7 +544,7 @@ class Poller
     const std::string mMethod;
     const std::string mReplyPump;
     LLTempBoundListener mBoundListener;
-    boost::scoped_ptr<LLXMLRPCTransaction> mTransaction;
+    std::unique_ptr<LLXMLRPCTransaction> mTransaction;
 	LLXMLRPCTransaction::EStatus mPreviousStatus; // To detect state changes.
 };
 
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index ba7e8d7298cb0d6c00722bc43ec32f44ee2bac63..a77c31eee341855c3d8f1bac03716acaddba6a51 100644
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -188,7 +188,7 @@ class LLXMLRPCTransaction::Handler : public LLCore::HttpHandler
 
 	virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response);
 
-	typedef boost::shared_ptr<LLXMLRPCTransaction::Handler> ptr_t;
+	typedef std::shared_ptr<LLXMLRPCTransaction::Handler> ptr_t;
 
 private:
 
diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml
index 4655a4d3948c212216bc6647fbf65559f63f771a..93b306d7d7bd1a4e07b127adf8deafc8ceb71f1c 100644
--- a/indra/newview/skins/default/xui/en/floater_camera.xml
+++ b/indra/newview/skins/default/xui/en/floater_camera.xml
@@ -138,13 +138,13 @@
         </panel>
     </panel>
     <panel
-     follows="all"
+     follows="left|top"
      height="102"
      layout="topleft"
      left_pad="2"
+     right="-2"
      name="buttons_panel"
-     top="22"
-     width="212">
+     top="22">
     <panel_camera_item
       name="front_view"
       tool_tip="Front View"
@@ -253,4 +253,22 @@
           function="CameraPresets.Save"/>
       </button>
   </panel>
+  <panel
+    name="viewer_camera_info"
+    left="0"
+    top="135"
+    width="400"
+    height="150"
+    border="true"
+    visible="false"
+    background_visible="true"/>
+  <panel
+    name="agent_camera_info"
+    left="0"
+    top="285"
+    width="400"
+    height="150"
+    border="true"
+    visible="false"
+    background_visible="true"/>
 </floater>
diff --git a/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml b/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml
new file mode 100644
index 0000000000000000000000000000000000000000..aa3500bac2914989453ceaffe0c25032186a0014
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+  legacy_header_height="18"
+  can_resize="false"
+  height="600"
+  layout="topleft"
+  min_height="175"
+  min_width="500"
+  name="contents"
+  help_topic="contents"
+  title="Inventory Thumbnails Helper"
+  width="800">
+    <scroll_list
+       top="20"
+       height="350"
+       draw_stripes="true"
+       draw_heading="true"
+       follows="all"
+       layout="topleft"
+       left="8"
+       multi_select="true"
+       name="inventory_thumbnails_list"
+       right="-8"
+       tool_tip="Paste items from your inventory">
+        <scroll_list.columns
+             dynamic_width="true"
+             label="Inventory Item"
+             name="item_name"
+             relative_width="0.4" />
+        <scroll_list.columns
+             dynamic_width="true"
+             label="Existing Texture"
+             name="existing_texture"
+             relative_width="0.3" />
+        <scroll_list.columns
+             dynamic_width="true"
+             label="New Texture"
+             name="new_texture"
+             relative_width="0.3" />
+    </scroll_list>
+    <text_editor
+      top="375"
+      height="140"
+      follows="all"
+      left="8"
+      right="-8"
+      name="output_log"
+      font="Monospace"
+      text_color="0.1 0.5 0.1 1.0"
+      width="480">
+    </text_editor>
+    <button
+      follows="left|bottom"
+      height="20"
+      label="Paste items from Inventory"
+      layout="topleft"
+      left="10"
+      name="paste_items_btn"
+      bottom="-60"
+      width="235" />
+    <button
+      follows="left|bottom"
+      height="20"
+      label="Paste textures from Inventory"
+      layout="topleft"
+      left_delta="0"
+      name="paste_textures_btn"
+      top_delta="26	"
+      width="235" />
+    <button
+      follows="left|bottom"
+      height="20"
+      label="Write Thumbnails"
+      layout="topleft"
+      left_delta="0"
+      name="write_thumbnails_btn"
+      top_delta="26	"
+      width="235" />
+    <button
+      follows="left|bottom"
+      height="20"
+      label="Log items with no thumbnail"
+      layout="bottomleft"
+      right="-10"
+      name="log_missing_thumbnails_btn"
+      bottom="60"
+      width="235" />
+    <button
+      follows="left|bottom"
+      height="20"
+      label="Clear thumbnails from pasted items"
+      layout="bottomleft"
+      right="-10"
+      name="clear_thumbnails_btn"
+      top_delta="26"
+      width="235" />
+
+
+</floater>
\ No newline at end of file
diff --git a/indra/newview/skins/default/xui/en/floater_publish_classified.xml b/indra/newview/skins/default/xui/en/floater_publish_classified.xml
index 2d7d03f7a0087588067a8327534025bd1dd6e25c..04840e1c64b90460609cb6c6d7a283ccd0c86d0b 100644
--- a/indra/newview/skins/default/xui/en/floater_publish_classified.xml
+++ b/indra/newview/skins/default/xui/en/floater_publish_classified.xml
@@ -25,6 +25,7 @@ Remember, Classified fees are non-refundable.
     </text>
     <spinner
      decimal_digits="0"
+     allow_digits_only="true"
      follows="left|top"
      font="SansSerif"
      halign="left"
@@ -36,7 +37,6 @@ Remember, Classified fees are non-refundable.
      layout="topleft"
      left="15"
      value="50"
-     min_val="50"
      max_val="999999"
      name="price_for_listing"
      top_pad="10"
diff --git a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml
index 41e018337031fd3581feadd433af30e6878ace11..c11f1c88cb7991c06fed79d6bfd86f1e8b9e82ef 100644
--- a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml
@@ -35,7 +35,7 @@
      layout="topleft"
      name="Folder Wearables Separator" />
     <menu_item_call
-     label="Replace Current Outfit"
+     label="Replace current outfit"
      layout="topleft"
      name="Replace Outfit">
         <menu_item_call.on_click
@@ -43,7 +43,7 @@
          parameter="replaceoutfit" />
     </menu_item_call>
     <menu_item_call
-     label="Add To Current Outfit"
+     label="Add folder items"
      layout="topleft"
      name="Add To Outfit">
         <menu_item_call.on_click
@@ -51,7 +51,7 @@
          parameter="addtooutfit" />
     </menu_item_call>
     <menu_item_call
-     label="Remove From Current Outfit"
+     label="Take off folder items"
      layout="topleft"
      name="Remove From Outfit">
         <menu_item_call.on_click
diff --git a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml
index 25d64ba74d99e9e6786988cae698b150b2481cfc..99cee83f4e451054e2c55438092c3675221e5b79 100755
--- a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml
+++ b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml
@@ -3,7 +3,7 @@
     layout="topleft"
     name="Outfit">
     <menu_item_call
-        label="Wear - Replace Current Outfit"
+        label="Replace current outfit"
         layout="topleft"
         name="wear_replace">
         <on_click
@@ -16,7 +16,7 @@
         parameter="wear_replace" />
     </menu_item_call>
     <menu_item_call
-        label="Wear - Add to Current Outfit"
+        label="Add outfit items"
         layout="topleft"
         name="wear_add">
         <on_click
@@ -29,7 +29,7 @@
         parameter="wear_add" />
     </menu_item_call>
     <menu_item_call
-        label="Take Off - Remove from Current Outfit"
+        label="Take off outfit items"
         layout="topleft"
         name="take_off">
         <on_click
@@ -41,17 +41,60 @@
         function="Outfit.OnVisible"
         parameter="take_off" />
     </menu_item_call>
+    <menu_item_separator/>
     <menu_item_call
-     label="Image..."
-     layout="topleft"
-     name="thumbnail">
+        label="Image..."
+        layout="topleft"
+        name="thumbnail">
+        <on_click
+        function="Outfit.Thumbnail" />
+    </menu_item_call>
+    <menu_item_call
+        label="Edit outfit"
+        layout="topleft"
+        name="edit">
+        <on_click
+        function="Outfit.Edit" />
+        <on_visible
+        function="Outfit.OnVisible"
+        parameter="edit" />
+    </menu_item_call>
+    <menu_item_call
+        label="Rename outfit"
+        layout="topleft"
+        name="rename">
+        <on_click
+        function="Outfit.Rename" />
+        <on_enable
+        function="Outfit.OnEnable"
+        parameter="rename" />
+    </menu_item_call>
+    <menu_item_call
+        label="Save to this outfit"
+        layout="topleft"
+        name="save">
+        <on_click
+         function="Outfit.Save" />
+    </menu_item_call>
+    <menu_item_separator>
+        <on_visible
+        function="Outfit.OnVisible"
+        parameter="delete" />
+    </menu_item_separator>
+    <menu_item_call
+        label="Delete outfit"
+        layout="topleft"
+        name="delete">
         <on_click
-         function="Outfit.Thumbnail" />
+        function="Outfit.Delete" />
+        <on_visible
+        function="Outfit.OnVisible"
+        parameter="delete" />
     </menu_item_call>
-    <menu_item_separator name="sepatator1" />
+    <menu_item_separator/>
     <menu
         height="175"
-        label="New Clothes"
+        label="New clothes"
         layout="topleft"
         left_delta="0"
         mouse_opaque="false"
@@ -157,7 +200,7 @@
     </menu>
     <menu
         height="85"
-        label="New Body Parts"
+        label="New body parts"
         layout="topleft"
         left_delta="0"
         mouse_opaque="false"
@@ -197,35 +240,4 @@
             parameter="eyes" />
         </menu_item_call>
     </menu>
-    <menu_item_separator name="sepatator2" />
-    <menu_item_call
-        label="Edit Outfit"
-        layout="topleft"
-        name="edit">
-        <on_click
-        function="Outfit.Edit" />
-        <on_visible
-        function="Outfit.OnVisible"
-        parameter="edit" />
-    </menu_item_call>
-    <menu_item_call
-        label="Rename Outfit"
-        layout="topleft"
-        name="rename">
-        <on_click
-        function="Outfit.Rename" />
-        <on_enable
-        function="Outfit.OnEnable"
-        parameter="rename" />
-    </menu_item_call>
-    <menu_item_call
-        label="Delete Outfit"
-        layout="topleft"
-        name="delete">
-        <on_click
-        function="Outfit.Delete" />
-        <on_visible
-        function="Outfit.OnVisible"
-        parameter="delete" />
-    </menu_item_call>
 </context_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index 488b39de06a60fc67d2f59352efd53333e3d020d..35ec0bf9e14c4f0e23abeb88e2f16081fd357ad3 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -264,7 +264,7 @@
      layout="topleft"
      name="Folder Wearables Separator" />
     <menu_item_call
-     label="Replace Current Outfit"
+     label="Replace current outfit"
      layout="topleft"
      name="Replace Outfit">
         <menu_item_call.on_click
@@ -272,7 +272,7 @@
          parameter="replaceoutfit" />
     </menu_item_call>
     <menu_item_call
-     label="Add To Current Outfit"
+     label="Add folder items"
      layout="topleft"
      name="Add To Outfit">
         <menu_item_call.on_click
@@ -280,7 +280,7 @@
          parameter="addtooutfit" />
     </menu_item_call>
     <menu_item_call
-     label="Remove From Current Outfit"
+     label="Take off folder items"
      layout="topleft"
      name="Remove From Outfit">
         <menu_item_call.on_click
diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
index 85eb941e31adb948b5c4b6424f69dc567006630d..8f36c7a00a0b1952e3a8af053a081ec6077d85c8 100644
--- a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
+++ b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
@@ -4,7 +4,7 @@
  visible="false"
  name="Gear Outfit">
     <menu_item_call
-     label="Wear - Replace Current Outfit"
+     label="Replace current outfit"
      layout="topleft"
      name="wear">
         <on_click
@@ -17,7 +17,7 @@
          parameter="wear" />
     </menu_item_call>
     <menu_item_call
-     label="Wear - Add to Current Outfit"
+     label="Add outfit items"
      layout="topleft"
      name="wear_add">
         <on_click
@@ -25,9 +25,11 @@
         <on_enable
          function="Gear.OnEnable"
          parameter="wear_add" />
+        <on_visible
+         function="Gear.OnVisible"/>
     </menu_item_call>
     <menu_item_call
-     label="Take Off - Remove from Current Outfit"
+     label="Take off outfit items"
      layout="topleft"
      name="take_off">
         <on_click
@@ -39,19 +41,88 @@
          function="Gear.OnVisible"
          parameter="take_off" />
     </menu_item_call>
+    <menu_item_separator name="wear_separator" />
     <menu_item_call
      label="Image..."
      layout="topleft"
      name="thumbnail">
+       <on_click
+        function="Gear.Thumbnail" />
+    </menu_item_call>
+    <menu_item_call
+     label="Rename outfit"
+     layout="topleft"
+     name="rename">
+        <on_click
+         function="Gear.Rename" />
+        <on_enable
+         function="Gear.OnEnable"
+         parameter="rename" />
+        <on_visible
+         function="Gear.OnVisible"
+         parameter="rename" />
+    </menu_item_call>
+    <menu_item_call
+     label="Save to this outfit"
+     layout="topleft"
+     name="save">
+        <on_click
+         function="Gear.Save" />
+        <on_visible
+         function="Gear.OnVisible"/>
+    </menu_item_call>
+    <menu_item_separator>
+        <on_visible
+        function="Gear.OnVisible"
+        parameter="delete" />
+    </menu_item_separator>
+    <menu_item_call
+     label="Delete outfit"
+     layout="topleft"
+     name="delete_outfit">
+        <on_click
+         function="Gear.Delete" />
+        <on_enable
+         function="Gear.OnEnable"
+         parameter="delete" />
+        <on_visible
+         function="Gear.OnVisible"
+         parameter="delete" />
+    </menu_item_call>
+    <menu_item_separator>
+        <on_visible
+         function="Gear.OnVisible"/>
+    </menu_item_separator>
+    <menu_item_check
+     label="Sort folders always by name"
+     layout="topleft"
+     name="sort_folders_by_name">
+        <on_click
+         function="Gear.SortByName" />
+        <on_check
+         function="CheckControl"
+         parameter="OutfitGallerySortByName" />
+    </menu_item_check>
+        <menu_item_call
+     label="Expand all folders"
+     layout="topleft"
+     name="expand">
+        <on_click
+         function="Gear.Expand" />
+    </menu_item_call>
+    <menu_item_call
+     label="Collapse all folders"
+     layout="topleft"
+     name="collapse">
         <on_click
-         function="Gear.Thumbnail" />
+         function="Gear.Collapse" />
     </menu_item_call>
-  <menu_item_separator name="sepatator1" />
+  <menu_item_separator/>
             <!-- copied (with minor modifications) from menu_inventory_add.xml -->
             <!--  *TODO: generate dynamically? -->
             <menu
              height="175"
-             label="New Clothes"
+             label="New clothes"
              layout="topleft"
              left_delta="0"
              mouse_opaque="false"
@@ -165,7 +236,7 @@
             </menu>
             <menu
              height="85"
-             label="New Body Parts"
+             label="New body parts"
              layout="topleft"
              left_delta="0"
              mouse_opaque="false"
@@ -206,57 +277,4 @@
                 </menu_item_call>
             </menu>
             <!-- copied from menu_inventory_add.xml -->
-
-    <menu_item_separator name="sepatator2" />
-    <menu_item_call
-     label="Expand all folders"
-     layout="topleft"
-     name="expand">
-        <on_click
-         function="Gear.Expand" />
-    </menu_item_call>
-    <menu_item_call
-     label="Collapse all folders"
-     layout="topleft"
-     name="collapse">
-        <on_click
-         function="Gear.Collapse" />
-    </menu_item_call>
-    <menu_item_call
-     label="Rename Outfit"
-     layout="topleft"
-     name="rename">
-        <on_click
-         function="Gear.Rename" />
-        <on_enable
-         function="Gear.OnEnable"
-         parameter="rename" />
-        <on_visible
-         function="Gear.OnVisible"
-         parameter="rename" />
-    </menu_item_call>
-    <menu_item_call
-     label="Delete Outfit"
-     layout="topleft"
-     name="delete_outfit">
-        <on_click
-         function="Gear.Delete" />
-        <on_enable
-         function="Gear.OnEnable"
-         parameter="delete" />
-        <on_visible
-         function="Gear.OnVisible"
-         parameter="delete" />
-    </menu_item_call>
-    <menu_item_separator name="sepatator3" />
-    <menu_item_check
-     label="Sort Folders Always by Name"
-     layout="topleft"
-     name="sort_folders_by_name">
-        <on_click
-         function="Gear.SortByName" />
-        <on_check
-         function="CheckControl"
-         parameter="OutfitGallerySortByName" />
-    </menu_item_check>
 </toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_outfit_tab.xml b/indra/newview/skins/default/xui/en/menu_outfit_tab.xml
index ae5fae864d9564715e43f89f9ed61306fa73b1a4..c6805edd63e98d9db55c356d33261c2f86dd0389 100644
--- a/indra/newview/skins/default/xui/en/menu_outfit_tab.xml
+++ b/indra/newview/skins/default/xui/en/menu_outfit_tab.xml
@@ -3,7 +3,7 @@
  layout="topleft"
  name="Outfit">
     <menu_item_call
-     label="Wear - Replace Current Outfit"
+     label="Replace current outfit"
      layout="topleft"
      name="wear_replace">
         <on_click
@@ -16,7 +16,7 @@
          parameter="wear_replace" />
     </menu_item_call>
     <menu_item_call
-     label="Wear - Add to Current Outfit"
+     label="Add outfit items"
      layout="topleft"
      name="wear_add">
         <on_click
@@ -29,7 +29,7 @@
          parameter="wear_add" />
     </menu_item_call>
     <menu_item_call
-     label="Take Off - Remove from Current Outfit"
+     label="Take off outfit items"
      layout="topleft"
      name="take_off">
         <on_click
@@ -41,19 +41,26 @@
          function="Outfit.OnVisible"
          parameter="take_off" />
     </menu_item_call>
+    <menu_item_separator />
     <menu_item_call
-     label="Edit Outfit"
-     layout="topleft"
-     name="edit">
+        label="Image..."
+        layout="topleft"
+        name="thumbnail">
+        <on_click
+        function="Outfit.Thumbnail" />
+    </menu_item_call>
+    <menu_item_call
+        label="Edit outfit"
+        layout="topleft"
+        name="edit">
         <on_click
          function="Outfit.Edit" />
         <on_visible
          function="Outfit.OnVisible"
          parameter="edit" />
     </menu_item_call>
-    <menu_item_separator />
     <menu_item_call
-     label="Rename Outfit"
+     label="Rename outfit"
      layout="topleft"
      name="rename">
         <on_click
@@ -63,7 +70,19 @@
          parameter="rename" />
     </menu_item_call>
     <menu_item_call
-     label="Delete Outfit"
+     label="Save to this outfit"
+     layout="topleft"
+     name="save">
+        <on_click
+         function="Outfit.Save" />
+    </menu_item_call>
+    <menu_item_separator>
+        <on_visible
+        function="Outfit.OnVisible"
+        parameter="delete" />
+    </menu_item_separator>
+    <menu_item_call
+     label="Delete outfit"
      layout="topleft"
      name="delete">
         <on_click
diff --git a/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml
index 910a0adc28f923f1e607d35678317c6d9ec57600..e4e86bb911ac1375bc296e8cda8cf5faf05d7cd0 100644
--- a/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml
+++ b/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml
@@ -49,4 +49,17 @@
          function="TeleportHistory.GearMenu.Enable"
          parameter="copy_slurl" />
     </menu_item_call>
+    <menu_item_separator
+     layout="topleft" />
+    <menu_item_call
+     label="Remove from history"
+     layout="topleft"
+     name="remove_from_history">
+        <on_click
+         function="TeleportHistory.GearMenu.Action"
+         parameter="remove" />
+        <on_enable
+         function="TeleportHistory.GearMenu.Enable"
+         parameter="remove" />
+    </menu_item_call>
 </toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index d580369ab26826a72a15ffe71874b5092a618372..53f703e56de6e2d550c6e223e7c18a66aae9d35d 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -3551,6 +3551,21 @@ function="World.EnvPreset"
             <menu_item_call.on_click
              function="Advanced.WebContentTest"
              parameter="http://duckduckgo.com"/>
+          </menu_item_call>
+            <menu_item_call
+             label="Inventory Thumbnails Helper"
+             name="Inventory Thumbnails Helper"
+				shortcut="control|alt|shift|X">
+                <menu_item_call.on_click
+                 function="Floater.Show"
+                 parameter="inventory_thumbnails_helper" />
+            </menu_item_call>
+            <menu_item_call
+           label="FB Connect Test"
+           name="FB Connect Test">
+            <menu_item_call.on_click
+             function="Advanced.WebContentTest"
+             parameter="https://cryptic-ridge-1632.herokuapp.com/"/>
           </menu_item_call>
           <menu_item_call
            label="Dump Fonts"
@@ -3640,6 +3655,14 @@ function="World.EnvPreset"
                 <menu_item_check.on_click
                  function="Advanced.ToggleDebugUnicode" />
             </menu_item_check>
+            <menu_item_check
+             label="Debug Camera Controls"
+             name="Debug Camera Controls">
+                <menu_item_check.on_check
+                 function="Advanced.CheckDebugCamera" />
+                <menu_item_check.on_click
+                 function="Advanced.ToggleDebugCamera" />
+            </menu_item_check>
             <menu_item_check
              label="Debug Name Tooltips"
              name="Debug Name Tooltips">
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 3ca284b0fa6a399508f9d63959be7a2dee487de3..3e1b1c4a67840b0a946a8834d2e8987910063dee 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -12254,6 +12254,50 @@ Would you like to save them first?
        notext="No"
        yestext="Yes"/>
   </notification>
+
+  <notification
+   icon="alertmodal.tga"
+   name="ConfirmOverwriteOutfit"
+   type="alertmodal">
+      <unique/>
+This will replace the items in the
+selected outfit with the items you
+are wearing now.
+      <tag>confirm</tag>
+      <usetemplate
+       ignoretext="Confirm before overwriting outfit"
+       name="okcancelignore"
+       notext="Cancel"
+       yestext="Save"/>
+  </notification>
+    
+  <notification
+    icon="alertmodal.tga"
+    name="ClearInventoryThumbnailsWarning"
+    type="alertmodal">
+        You are about to remove thumbnail images from the inventory items in the list. This change cannot be undone.
+
+        Would you like to proceed?
+   <tag>confirm</tag>
+   <usetemplate
+       name="okcancelbuttons"
+       notext="No"
+       yestext="Yes"/>
+  </notification>
+
+  <notification
+    icon="alertmodal.tga"
+    name="WriteInventoryThumbnailsWarning"
+    type="alertmodal">
+        You are about to overwrite thumbnail images for some or all of the inventory items in the list. This change cannot be undone.
+
+        Would you like to proceed?
+   <tag>confirm</tag>
+   <usetemplate
+       name="okcancelbuttons"
+       notext="No"
+       yestext="Yes"/>
+  </notification>
     
   <notification
     icon="notifytip.tga"
diff --git a/indra/newview/skins/default/xui/en/panel_settings_water.xml b/indra/newview/skins/default/xui/en/panel_settings_water.xml
index bec4f7852fb0809d77b39a0e5217f1c899b1237e..5e65b0e8a202cf0c1618f0d12f1a1fa38ab02edd 100644
--- a/indra/newview/skins/default/xui/en/panel_settings_water.xml
+++ b/indra/newview/skins/default/xui/en/panel_settings_water.xml
@@ -65,7 +65,7 @@
                 Density Exponent:
             </text>
             <slider
-                    decimal_digits="1"
+                    decimal_digits="2"
                     follows="left|top"
                     height="16"
                     increment="0.01"
diff --git a/indra/newview/tests/llremoteparcelrequest_test.cpp b/indra/newview/tests/llremoteparcelrequest_test.cpp
index 4f7f87b6b01ef39afd15e9453904ffdcf6f08080..4eddfb46e1c2577898d05ee8882b788fb40602a9 100644
--- a/indra/newview/tests/llremoteparcelrequest_test.cpp
+++ b/indra/newview/tests/llremoteparcelrequest_test.cpp
@@ -49,7 +49,7 @@ void LLCurl::Responder::failureResult(S32 status, const std::string& reason, con
 void LLCurl::Responder::successResult(const LLSD& content) { }
 void LLCurl::Responder::completeResult(S32 status, const std::string& reason, const LLSD& content) { }
 std::string LLCurl::Responder::dumpResponse() const { return "(failure)"; }
-void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { }
+void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,std::shared_ptr<LLBufferArray> const &) { }
 void LLMessageSystem::getF32(char const *,char const *,F32 &,S32) { }
 void LLMessageSystem::getU8(char const *,char const *,U8 &,S32) { }
 void LLMessageSystem::getS32(char const *,char const *,S32 &,S32) { }
@@ -110,7 +110,7 @@ namespace tut
 	{
 		set_test_name("observer pointer");
 
-		boost::scoped_ptr<TestObserver> observer(new TestObserver());
+		std::unique_ptr<TestObserver> observer(new TestObserver());
 
 		LLRemoteParcelInfoProcessor & processor = LLRemoteParcelInfoProcessor::instance();
 		processor.addObserver(LLUUID(TEST_PARCEL_ID), observer.get());
diff --git a/indra/test/io.cpp b/indra/test/io.cpp
index 40243a8ad6ef6505f9f2988db9b2c8dea9d3c6bc..99b49c8b29b352b0e4f5b0b1b8f29265fef7ddca 100644
--- a/indra/test/io.cpp
+++ b/indra/test/io.cpp
@@ -946,7 +946,7 @@ namespace tut
 		typedef LLCloneIOFactory<LLPipeStringInjector> emitter_t;
 		emitter_t* emitter = new emitter_t(
 			new LLPipeStringInjector("suckers never play me"));
-		boost::shared_ptr<LLChainIOFactory> factory(emitter);
+		std::shared_ptr<LLChainIOFactory> factory(emitter);
 		LLIOServerSocket* server = new LLIOServerSocket(
 			mPool,
 			mSocket,
@@ -993,7 +993,7 @@ namespace tut
 		LLPumpIO::chain_t chain;
 		typedef LLCloneIOFactory<LLIOFuzz> emitter_t;
 		emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000));
-		boost::shared_ptr<LLChainIOFactory> factory(emitter);
+		std::shared_ptr<LLChainIOFactory> factory(emitter);
 		LLIOServerSocket* server = new LLIOServerSocket(
 			mPool,
 			mSocket,
@@ -1036,7 +1036,7 @@ namespace tut
 		LLPumpIO::chain_t chain;
 		typedef LLCloneIOFactory<LLIOFuzz> emitter_t;
 		emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000));
-		boost::shared_ptr<LLChainIOFactory> factory(emitter);
+		std::shared_ptr<LLChainIOFactory> factory(emitter);
 		LLIOServerSocket* server = new LLIOServerSocket(
 			mPool,
 			mSocket,
@@ -1079,7 +1079,7 @@ namespace tut
 		LLPumpIO::chain_t chain;
 		typedef LLCloneIOFactory<LLIOFuzz> emitter_t;
 		emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000));
-		boost::shared_ptr<LLChainIOFactory> factory(emitter);
+		std::shared_ptr<LLChainIOFactory> factory(emitter);
 		LLIOServerSocket* server = new LLIOServerSocket(
 			mPool,
 			mSocket,
@@ -1120,7 +1120,7 @@ namespace tut
 		LLPumpIO::chain_t chain;
 		typedef LLCloneIOFactory<LLIOSleeper> sleeper_t;
 		sleeper_t* sleeper = new sleeper_t(new LLIOSleeper);
-		boost::shared_ptr<LLChainIOFactory> factory(sleeper);
+		std::shared_ptr<LLChainIOFactory> factory(sleeper);
 		LLIOServerSocket* server = new LLIOServerSocket(
 			mPool,
 			mSocket,
diff --git a/indra/test/llevents_tut.cpp b/indra/test/llevents_tut.cpp
index 17f64a49531850c38e438119f37af7ecc9860191..a38de71e4884ae704fde602e3b0792a451ef7311 100644
--- a/indra/test/llevents_tut.cpp
+++ b/indra/test/llevents_tut.cpp
@@ -368,10 +368,10 @@ void events_object::test<7>()
 	LLEventStream bob("bob"); 		// should work, previous one unregistered
 	LLEventStream bob1("bob", true);// allowed to tweak name
 	ensure_equals("tweaked LLEventStream name", bob1.getName(), "bob1");
-	std::vector<boost::shared_ptr<LLEventStream> > streams;
+	std::vector<std::shared_ptr<LLEventStream> > streams;
 	for (int i = 2; i <= 10; ++i)
 	{
-		streams.push_back(boost::shared_ptr<LLEventStream>(new LLEventStream("bob", true)));
+		streams.push_back(std::shared_ptr<LLEventStream>(new LLEventStream("bob", true)));
 	}
 	ensure_equals("last tweaked LLEventStream name", streams.back()->getName(), "bob10");
 }
diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index 94478a5263c912dee0608f26ea0ebf2e4f38414c..f1c5991330c2a6c11eb46dfcfa2de1c49add65c6 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -166,12 +166,12 @@ class LLReplayLogReal: public LLReplayLog, public boost::noncopyable
 
 	virtual void reset()
 	{
-		boost::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->reset();
+		std::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->reset();
 	}
 
 	virtual void replay(std::ostream& out)
 	{
-		boost::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->replay(out);
+		std::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->replay(out);
 	}
 
 private:
@@ -185,7 +185,7 @@ class LLTestCallback : public chained_callback
 
 public:
 	LLTestCallback(bool verbose_mode, std::ostream *stream,
-				   boost::shared_ptr<LLReplayLog> replayer) :
+				   std::shared_ptr<LLReplayLog> replayer) :
 		mVerboseMode(verbose_mode),
 		mTotalTests(0),
 		mPassedTests(0),
@@ -193,7 +193,7 @@ class LLTestCallback : public chained_callback
 		mSkippedTests(0),
 		// By default, capture a shared_ptr to std::cout, with a no-op "deleter"
 		// so that destroying the shared_ptr makes no attempt to delete std::cout.
-		mStream(boost::shared_ptr<std::ostream>(&std::cout, [](std::ostream*){})),
+		mStream(std::shared_ptr<std::ostream>(&std::cout, [](std::ostream*){})),
 		mReplayer(replayer)
 	{
 		if (stream)
@@ -207,7 +207,7 @@ class LLTestCallback : public chained_callback
 			// Allocate and assign in two separate steps, per Herb Sutter.
 			// (Until we turn on C++11 support, have to wrap *stream with
 			// boost::ref() due to lack of perfect forwarding.)
-			boost::shared_ptr<std::ostream> pstream(new TeeStream(std::cout, boost::ref(*stream)));
+			std::shared_ptr<std::ostream> pstream(new TeeStream(std::cout, boost::ref(*stream)));
 			mStream = pstream;
 		}
 	}
@@ -331,8 +331,8 @@ class LLTestCallback : public chained_callback
 	int mPassedTests;
 	int mFailedTests;
 	int mSkippedTests;
-	boost::shared_ptr<std::ostream> mStream;
-	boost::shared_ptr<LLReplayLog> mReplayer;
+	std::shared_ptr<std::ostream> mStream;
+	std::shared_ptr<LLReplayLog> mReplayer;
 };
 
 // TeamCity specific class which emits service messages
@@ -342,7 +342,7 @@ class LLTCTestCallback : public LLTestCallback
 {
 public:
 	LLTCTestCallback(bool verbose_mode, std::ostream *stream,
-					 boost::shared_ptr<LLReplayLog> replayer) :
+					 std::shared_ptr<LLReplayLog> replayer) :
 		LLTestCallback(verbose_mode, stream, replayer)
 	{
 	}
@@ -555,7 +555,7 @@ int main(int argc, char **argv)
 	apr_status_t apr_err;
 	const char* opt_arg = NULL;
 	int opt_id = 0;
-	boost::scoped_ptr<llofstream> output;
+	std::unique_ptr<llofstream> output;
 	const char *touch = NULL;
 
 	while(true)
@@ -614,7 +614,7 @@ int main(int argc, char **argv)
 
 	// set up logging
 	const char* LOGFAIL = getenv("LOGFAIL");
-	boost::shared_ptr<LLReplayLog> replayer{boost::make_shared<LLReplayLog>()};
+	std::shared_ptr<LLReplayLog> replayer{std::make_shared<LLReplayLog>()};
 
 	// Testing environment variables for both 'set' and 'not empty' allows a
 	// user to suppress a pre-existing environment variable by forcing empty.
diff --git a/indra/viewer_components/login/lllogin.h b/indra/viewer_components/login/lllogin.h
index 051641ff59697d186fe395354de3a9cce523c95c..de58ca0c294c8f13bc56c0373a65f478deebd6ca 100644
--- a/indra/viewer_components/login/lllogin.h
+++ b/indra/viewer_components/login/lllogin.h
@@ -121,7 +121,7 @@ class LLLogin
 
 private:
 	class Impl;
-	boost::scoped_ptr<Impl> mImpl;
+	std::unique_ptr<Impl> mImpl;
 };
 
 #endif // LL_LLLOGIN_H
diff --git a/scripts/code_tools/modified_strings.py b/scripts/code_tools/modified_strings.py
index e7a9d239dc7c5da4f93143598f6cbcf76ffc8932..20ed1b05552cc90f5f365897224ac368e4cae856 100644
--- a/scripts/code_tools/modified_strings.py
+++ b/scripts/code_tools/modified_strings.py
@@ -162,6 +162,8 @@ def make_translation_table(mod_tree, base_tree, lang, args):
         filename = mod_blob.path
         if mod_blob.type == "tree": # directory, skip
             continue
+        if args.files and os.path.basename(filename) not in args.files:
+            continue # process only the specified files
 
         if args.verbose:
             print(filename)
@@ -325,9 +327,11 @@ def save_translation_file(per_lang_data, aux_data, outfile):
     parser.add_argument("--deleted", action="store_true", default = False, help="show all translated entities which don't exist in english")
     parser.add_argument("--skip_spreadsheet", action="store_true", default = False, help="skip creating the translation spreadsheet")
     parser.add_argument("--rev", help="revision with modified strings, default HEAD", default="HEAD")
-    parser.add_argument("--rev_base", help="previous revision to compare against, default master", default="master")
+    parser.add_argument("--rev_base", help="previous revision to compare against, default main", default="main")
     parser.add_argument("--base_lang", help="base language, default en (normally leave unchanged - other values are only useful for testing)", default="en")
     parser.add_argument("--lang", help="target languages, or 'all_valid' or 'supported'; default is 'supported'", nargs="+", default = ["supported"])
+    parser.add_argument("--files", help='list of files to process', metavar='F', type=str, nargs='*')
+    parser.add_argument("--outfile", help='name of the output file', type=str, nargs='?', default="SL_Translations.xlsx")
     args = parser.parse_args()
 
     cwd = os.getcwd()
@@ -370,7 +374,7 @@ def save_translation_file(per_lang_data, aux_data, outfile):
     print("Target language(s) are", ",".join(sorted(langs)))
     sys.stdout.flush()
 
-    outfile = "SL_Translations.xlsx"
+    outfile = args.outfile
     try:
         f = open(outfile,"a+")
         f.close()