From d60f16540dba5616cd8260046b44ebc2a1047065 Mon Sep 17 00:00:00 2001
From: Josh Bell <josh@lindenlab.com>
Date: Thu, 4 Jan 2007 02:04:29 +0000
Subject: [PATCH] svn merge
 svn+ssh://svn.lindenlab.com/svn/linden/release@56429
 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance@56431

This turned up the following "lost" changes:

	llapp.cpp (from maintenance r55371) - SIGPIPE fix, possibly
	llfontgl.cpp (from maintenance r50207) - whitespace only
	inventorybridge.cpp (property - non-executable)
	skins/xui/*/* (from maintenance r55380) - XML processing instruction went AWOL
---
 indra/llcommon/linden_common.h              |  13 +--
 indra/llcommon/llapp.cpp                    |   2 +-
 indra/llcommon/llpreprocessor.h             |   3 -
 indra/llcommon/llprocessor.cpp              |   9 +-
 indra/llcommon/llprocessor.h                |   5 +-
 indra/llcommon/llsdutil.cpp                 |  19 ++--
 indra/llcommon/llsys.cpp                    |  14 ++-
 indra/llcommon/lltimer.cpp                  |  19 ++--
 indra/llmessage/llhost.cpp                  |  20 ++--
 indra/llmessage/llmail.cpp                  |   7 ++
 indra/llmessage/llmail.h                    |   2 +-
 indra/llmessage/net.cpp                     |  18 ++--
 indra/llrender/llfontgl.cpp                 |   2 +-
 indra/llrender/llgldbg.cpp                  |   3 +-
 indra/llui/llcombobox.cpp                   |   2 +-
 indra/llui/lltabcontainer.cpp               |   3 +-
 indra/llui/lluictrlfactory.cpp              |  22 ++++-
 indra/llui/llview.cpp                       |  31 +++++-
 indra/llui/llview.h                         |   2 +
 indra/llvfs/lldir_win32.h                   |  14 +--
 indra/llwindow/llkeyboardwin32.cpp          |   6 ++
 indra/llwindow/llwindow.cpp                 |   4 +-
 indra/llwindow/llwindow.h                   |  13 ---
 indra/llwindow/llwindowwin32.cpp            |  17 +---
 indra/llwindow/llwindowwin32.h              |   7 +-
 indra/newview/lldirpicker.cpp               |   2 +-
 indra/newview/lldrawpool.cpp                |   4 -
 indra/newview/lldrawpool.h                  |   2 +-
 indra/newview/llfilepicker.cpp              |   6 +-
 indra/newview/llinventorybridge.cpp         |   0
 indra/newview/lloverlaybar.cpp              |  10 +-
 indra/newview/llpanelavatar.cpp             |  27 +++++-
 indra/newview/llpanelavatar.h               |   2 +
 indra/newview/llpanelclassified.cpp         |  29 ++++--
 indra/newview/llpanelclassified.h           |   3 +
 indra/newview/llpanelface.cpp               | 101 --------------------
 indra/newview/llpanelface.h                 |  52 ----------
 indra/newview/llstartup.cpp                 |  47 +--------
 indra/newview/llurlwhitelist.cpp            |  18 ----
 indra/newview/llviewerdisplay.cpp           |   2 +-
 indra/newview/llviewerobject.cpp            |  44 +++------
 indra/newview/llviewerobjectlist.cpp        |  42 ++------
 indra/newview/llviewerparcelmgr.cpp         |   9 +-
 indra/newview/llviewerprecompiledheaders.h  |  12 ++-
 indra/newview/llviewerwindow.cpp            |   2 +-
 indra/newview/llvoavatar.cpp                |   1 -
 indra/newview/llweb.cpp                     |  11 ---
 indra/win_crash_logger/win_crash_logger.cpp |   4 +-
 48 files changed, 245 insertions(+), 442 deletions(-)
 mode change 100755 => 100644 indra/newview/llinventorybridge.cpp

diff --git a/indra/llcommon/linden_common.h b/indra/llcommon/linden_common.h
index 199d3808093..3e9ec14eb38 100644
--- a/indra/llcommon/linden_common.h
+++ b/indra/llcommon/linden_common.h
@@ -27,17 +27,6 @@
 #include <string>
 #include "llfile.h"
 
-#if LL_WINDOWS
-// Limit Windows API to small and manageable set.
-// If you get undefined symbols, find the appropriate
-// Windows header file and include that in your .cpp file.
-// Please don't take this out -- it helps with library
-// compile times. JC
-#define WIN32_LEAN_AND_MEAN
-#include <winsock2.h>
-#include <windows.h>
-#endif	//	LL_WINDOWS
-
 #include "stdtypes.h"
 #include "lldefs.h"
 #include "llerror.h"
@@ -50,4 +39,4 @@
 #pragma warning (3 : 4702) // we like level 3, not 4
 #endif	//	LL_WINDOWS
 
-#endif	//	not LL_LINDEN_COMMON_H
+#endif
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index fda6d89a72e..87e7016f396 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -499,6 +499,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
 	switch (signum)
 	{
 	case SIGALRM:
+	case SIGPIPE:
 	case SIGUSR2:
 		// We don't care about these signals, ignore them
 		if (LLApp::sLogInSignal)
@@ -548,7 +549,6 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
 		
 		// Change the signal that we reraise to SIGABRT, so we generate a core dump.
 		signum = SIGABRT;
-	case SIGPIPE:
 	case SIGBUS:
 	case SIGSEGV:
 	case SIGQUIT:
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index 829ae0de210..564c32cb0d2 100644
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -26,15 +26,12 @@
 
 #if LL_DARWIN
 	#define LL_QUICKTIME_ENABLED	1
-	#define LL_MOZILLA_ENABLED		0
 	#define LL_LIBXUL_ENABLED		1
 #elif LL_WINDOWS
 	#define LL_QUICKTIME_ENABLED	1
-	#define LL_MOZILLA_ENABLED		0
 	#define LL_LIBXUL_ENABLED		1
 #elif LL_LINUX
 	#define LL_QUICKTIME_ENABLED	0
-	#define LL_MOZILLA_ENABLED		0
 	#define LL_LIBXUL_ENABLED		0
 #endif
 
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 04e1bc08398..64f4875489f 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -26,10 +26,17 @@
 
 #include "linden_common.h"
 
+#include "processor.h"
+
 #include <stdio.h>
 #include <string.h>
 #include <memory.h>
-#include "processor.h"
+
+#if LL_WINDOWS
+#	define WIN32_LEAN_AND_MEAN
+#	include <winsock2.h>
+#	include <windows.h>
+#endif
 
 #if !LL_DARWIN
 
diff --git a/indra/llcommon/llprocessor.h b/indra/llcommon/llprocessor.h
index ad44e2ccb3a..8453263f9d3 100644
--- a/indra/llcommon/llprocessor.h
+++ b/indra/llcommon/llprocessor.h
@@ -11,15 +11,14 @@
 ///////////////////////////////////////////
 
 
-#ifndef PROCESSOR_H
-#define PROCESSOR_H
+#ifndef LLPROCESSOR_H
+#define LLPROCESSOR_H
 
 // Options:
 ///////////
 #if LL_WINDOWS
 #define PROCESSOR_FREQUENCY_MEASURE_AVAILABLE
 #endif
-// Includes <windows.h> --> code gets os-dependend (Win32)
 
 
 typedef struct ProcessorExtensions
diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp
index 9305f82e055..8fe43736e46 100644
--- a/indra/llcommon/llsdutil.cpp
+++ b/indra/llcommon/llsdutil.cpp
@@ -8,16 +8,21 @@
  * $License$
  */
 
-#if LL_LINUX
-#include <netinet/in.h>
-#endif
-#if LL_DARWIN
-#include <arpa/inet.h>
-#endif
-
 #include "linden_common.h"
+
 #include "llsdutil.h"
 
+#if LL_WINDOWS
+#	define WIN32_LEAN_AND_MEAN
+#	include <winsock2.h>	// for htonl
+#elif LL_LINUX
+#	include <netinet/in.h>
+#elif LL_DARWIN
+#	include <arpa/inet.h>
+#endif
+
+
+
 // vector3
 LLSD ll_sd_from_vector3(const LLVector3& vec)
 {
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 9c54ddaac1a..b50c0a13ce2 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -8,15 +8,21 @@
 
 #include "linden_common.h"
 
+#include "llsys.h"
+
 #include <iostream>
 #include <zlib/zlib.h>
 #include "processor.h"
 
-#if LL_DARWIN
-#include <sys/sysctl.h>
-#include <sys/utsname.h>
+#if LL_WINDOWS
+#	define WIN32_LEAN_AND_MEAN
+#	include <winsock2.h>
+#	include <windows.h>
+#elif LL_DARWIN
+#	include <sys/sysctl.h>
+#	include <sys/utsname.h>
 #elif LL_LINUX
-#include <sys/utsname.h>
+#	include <sys/utsname.h>
 const char MEMINFO_FILE[] = "/proc/meminfo";
 const char CPUINFO_FILE[] = "/proc/cpuinfo";
 #endif
diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp
index bd054f02d8e..a8118258f99 100644
--- a/indra/llcommon/lltimer.cpp
+++ b/indra/llcommon/lltimer.cpp
@@ -8,15 +8,19 @@
 
 #include "linden_common.h"
 
+#include "lltimer.h"
 
-#if LL_WINDOWS
-#include <time.h>
+#include "u64.h"
 
+#if LL_WINDOWS
+#	define WIN32_LEAN_AND_MEAN
+#	include <winsock2.h>
+#	include <windows.h>
+#	include <time.h>
 #elif LL_LINUX
-#include <time.h>
-#include <sys/time.h>
-#include <sched.h>
-
+#	include <time.h>
+#	include <sys/time.h>
+#	include <sched.h>
 #elif LL_DARWIN
 #	include <time.h>
 #	include <sys/time.h>
@@ -25,9 +29,6 @@
 #endif
 
 
-#include "lltimer.h"
-#include "u64.h"
-
 //
 // Locally used constants
 //
diff --git a/indra/llmessage/llhost.cpp b/indra/llmessage/llhost.cpp
index f4a1740663d..501d9465c23 100644
--- a/indra/llmessage/llhost.cpp
+++ b/indra/llmessage/llhost.cpp
@@ -8,19 +8,21 @@
 
 #include "linden_common.h"
 
-
-#if !LL_WINDOWS
-#include <netdb.h>
-#include <netinet/in.h>	// ntonl()
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#endif
-
 #include "llhost.h"
 
 #include "llerror.h"
 
+#if LL_WINDOWS
+	#define WIN32_LEAN_AND_MEAN
+	#include <winsock2.h>
+#else
+	#include <netdb.h>
+	#include <netinet/in.h>	// ntonl()
+	#include <sys/types.h>
+	#include <sys/socket.h>
+	#include <arpa/inet.h>
+#endif
+
 LLHost LLHost::invalid(INVALID_PORT,INVALID_HOST_IP_ADDRESS);
 
 LLHost::LLHost(const std::string& ip_and_port)
diff --git a/indra/llmessage/llmail.cpp b/indra/llmessage/llmail.cpp
index 9fe8e89b200..4dd550901e6 100644
--- a/indra/llmessage/llmail.cpp
+++ b/indra/llmessage/llmail.cpp
@@ -8,6 +8,13 @@
 
 #include "linden_common.h"
 
+// APR on Windows needs full windows headers
+#ifdef LL_WINDOWS
+#	undef WIN32_LEAN_AND_MEAN
+#	include <winsock2.h>
+#	include <windows.h>
+#endif
+
 #include <string>
 #include <sstream>
 #include <boost/regex.hpp>
diff --git a/indra/llmessage/llmail.h b/indra/llmessage/llmail.h
index e34b827f5fc..af022647765 100644
--- a/indra/llmessage/llmail.h
+++ b/indra/llmessage/llmail.h
@@ -9,7 +9,7 @@
 #ifndef LL_LLMAIL_H
 #define LL_LLMAIL_H
 
-#include "apr-1/apr_pools.h"
+typedef struct apr_pool_t apr_pool_t;
 
 // if hostname is NULL, then the host is resolved as 'mail'
 void init_mail(const std::string& hostname, apr_pool_t* pool);
diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp
index 2b712840d82..bf8927c7b92 100644
--- a/indra/llmessage/net.cpp
+++ b/indra/llmessage/net.cpp
@@ -14,13 +14,17 @@
 #include <stdexcept>
 #include <stdio.h>
 
-#if !LL_WINDOWS					//  Windows Versions 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <fcntl.h>
-#include <errno.h>
+#if LL_WINDOWS
+	#define WIN32_LEAN_AND_MEAN
+	#include <winsock2.h>
+	#include <windows.h>
+#else
+	#include <sys/types.h>
+	#include <sys/socket.h>
+	#include <netinet/in.h>
+	#include <arpa/inet.h>
+	#include <fcntl.h>
+	#include <errno.h>
 #endif
 
 // linden library includes
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 4e369a8b6b5..a52582a3aa4 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -113,7 +113,7 @@ void LLFontGL::init()
 		mImageGLp = new LLImageGL(FALSE);
 		//RN: use nearest mipmap filtering to obviate the need to do pixel-accurate positioning
 		mImageGLp->bind();
-		mImageGLp->setMipFilterNearest(TRUE,TRUE);
+		mImageGLp->setMipFilterNearest(TRUE, TRUE);
 	}
 	if (mRawImageGLp.isNull())
 	{
diff --git a/indra/llrender/llgldbg.cpp b/indra/llrender/llgldbg.cpp
index 2c61ebb8511..146560f43de 100644
--- a/indra/llrender/llgldbg.cpp
+++ b/indra/llrender/llgldbg.cpp
@@ -11,9 +11,10 @@
 
 #include "linden_common.h"
 
-#include "llglheaders.h"
+#include "llgldbg.h"
 
 #include "llgl.h"
+#include "llglheaders.h"
 
 
 //------------------------------------------------------------------------
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp
index d64abfe6983..fc7a29887b4 100644
--- a/indra/llui/llcombobox.cpp
+++ b/indra/llui/llcombobox.cpp
@@ -747,7 +747,7 @@ BOOL LLComboBox::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_
 
 	if (LLUI::sShowXUINames)
 	{
-		tool_tip = mName;
+		tool_tip = getShowNamesToolTip();
 	}
 	else
 	{
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 9c356f95246..1ba991f9161 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1048,7 +1048,7 @@ BOOL LLTabContainer::selectTab(S32 which)
 // 			tuple->mTabPanel->setFocus(is_selected); // not clear that we want to do this here.
 			tuple->mButton->setToggleState( is_selected );
 			// RN: this limits tab-stops to active button only, which would require arrow keys to switch tabs
-			tuple->mButton->setTabStop( is_selected && mTabList.size() > 1 );
+			tuple->mButton->setTabStop( is_selected );
 			
 			if( is_selected && mMaxScrollPos > 0)
 			{
@@ -1466,4 +1466,3 @@ BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask,	BOOL drop,	EDrag
 
 	return LLView::handleDragAndDrop(x,	y, mask, drop, type, cargo_data,  accept, tooltip);
 }
-
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index 7e286f0bee8..7f62194e588 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -385,6 +385,7 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp)
 {
 	// TomY TODO: Break this function into buildMenu and buildMenuBar
 	LLXMLNodePtr root;
+	LLMenuGL*    menu;
 
 	if (!LLUICtrlFactory::getLayeredXMLNode(filename, root))
 	{
@@ -398,12 +399,23 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp)
 		return NULL;
 	}
 
+	
+
 	if (root->hasName("menu"))
 	{
-		return (LLMenuGL*)LLMenuGL::fromXML(root, parentp, this);
+		menu = (LLMenuGL*)LLMenuGL::fromXML(root, parentp, this);
+	}
+	else
+	{
+		menu = (LLMenuGL*)LLMenuBarGL::fromXML(root, parentp, this);
+	}
+	
+	if (LLUI::sShowXUINames)
+	{
+		menu->mToolTipMsg = filename;
 	}
 
-	return (LLMenuGL*)LLMenuBarGL::fromXML(root, parentp, this);
+    return menu;
 }
 
 //-----------------------------------------------------------------------------
@@ -432,6 +444,12 @@ LLPieMenu *LLUICtrlFactory::buildPieMenu(const LLString &filename, LLView* paren
 	LLPieMenu *menu = new LLPieMenu(name);
 	parentp->addChild(menu);
 	menu->initXML(root, parentp, this);
+
+	if (LLUI::sShowXUINames)
+	{
+		menu->mToolTipMsg = filename;
+	}
+
 	return menu;
 }
 
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 6323a408bbd..64ba319151c 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -811,6 +811,35 @@ BOOL LLView::handleHover(S32 x, S32 y, MASK mask)
 	return handled;
 }
 
+LLString LLView::getShowNamesToolTip()
+{
+	LLView* view = getParent();
+	LLString name;
+	LLString tool_tip = mName;
+
+	while (view)
+	{
+		name = view->getName();
+
+		if (name == "root") break;
+
+		if (view->getToolTip().find(".xml") != LLString::npos)
+		{
+			tool_tip = view->getToolTip() + "/" +  tool_tip;
+			break;
+		}
+		else
+		{
+			tool_tip = view->getName() + "/" +  tool_tip;
+		}
+
+		view = view->getParent();
+	}
+
+	return "/" + tool_tip;
+}
+
+
 BOOL LLView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen)
 {
 	BOOL handled = FALSE;
@@ -834,7 +863,7 @@ BOOL LLView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_scre
 		if (LLUI::sShowXUINames && (mToolTipMsg.find(".xml", 0) == LLString::npos) && 
 			(mName.find("Drag", 0) == LLString::npos))
 		{
-			tool_tip = mName;
+			tool_tip = getShowNamesToolTip();
 		}
 		else
 		{
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 63d85fbcdc8..9a36c56e3ec 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -352,6 +352,8 @@ class LLView : public LLMouseHandler, public LLMortician, public LLSimpleListene
 	// then display mToolTipMsg if no child handled it.
 	/*virtual*/ BOOL	handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect);
 
+	LLString getShowNamesToolTip();
+
 	virtual void	draw();
 
 	void			drawDebugRect();
diff --git a/indra/llvfs/lldir_win32.h b/indra/llvfs/lldir_win32.h
index fbeeef2732a..237185b793b 100644
--- a/indra/llvfs/lldir_win32.h
+++ b/indra/llvfs/lldir_win32.h
@@ -17,18 +17,18 @@ class LLDir_Win32 : public LLDir
 	LLDir_Win32();
 	virtual ~LLDir_Win32();
 
-	virtual void initAppDirs(const std::string &app_name);
-public:	
-	virtual std::string getCurPath();
-	virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask);
-	virtual BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname, BOOL wrap);
-	virtual void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname);
+	/*virtual*/ void initAppDirs(const std::string &app_name);
+
+	/*virtual*/ std::string getCurPath();
+	/*virtual*/ U32 countFilesInDir(const std::string &dirname, const std::string &mask);
+	/*virtual*/ BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname, BOOL wrap);
+	/*virtual*/ void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname);
 	/*virtual*/ BOOL fileExists(const std::string &filename);
 
 private:
 	BOOL LLDir_Win32::getNextFileInDir(const llutf16string &dirname, const std::string &mask, std::string &fname, BOOL wrap);
 	
-	HANDLE mDirSearch_h;
+	void* mDirSearch_h;
 	llutf16string mCurrentDir;
 };
 
diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp
index 6f5383428e3..ddc099418c2 100644
--- a/indra/llwindow/llkeyboardwin32.cpp
+++ b/indra/llwindow/llkeyboardwin32.cpp
@@ -9,9 +9,15 @@
 #if LL_WINDOWS
 
 #include "linden_common.h"
+
 #include "llkeyboardwin32.h"
+
 #include "llwindow.h"
 
+#define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <windows.h>
+
 LLKeyboardWin32::LLKeyboardWin32()
 {
 	// Set up key mapping for windows - eventually can read this from a file?
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 21774fe2333..d5e1e770530 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -23,6 +23,7 @@
 
 #include "llerror.h"
 #include "llkeyboard.h"
+#include "linked_lists.h"
 
 //static instance for default callbacks
 LLWindowCallbacks	LLWindow::sDefaultCallbacks;
@@ -305,7 +306,8 @@ void LLSplashScreen::hide()
 // LLWindowManager
 //
 
-LLLinkedList<LLWindow> LLWindowManager::sWindowList;
+// TODO: replace with std::set
+static LLLinkedList<LLWindow> sWindowList;
 
 LLWindow* LLWindowManager::createWindow(
 	char *title,
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index 703eee32d04..442f4c9667d 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -12,7 +12,6 @@
 #include <sys/stat.h>
 
 #include "llrect.h"
-#include "linked_lists.h"
 #include "llcoord.h"
 #include "llstring.h"
 
@@ -272,9 +271,6 @@ const S32 OSBTN_CANCEL = 3;
 
 class LLWindowManager
 {
-private:
-	static LLLinkedList<LLWindow> sWindowList;
-
 public:
 	static LLWindow* createWindow(
 		char *title,
@@ -316,13 +312,4 @@ void shell_open(const char* file_path);
 
 void simpleEscapeString ( std::string& stringIn  );
 
-
-#if LL_WINDOWS
-	// return Win32 specific window handle
-	HWND llwindow_get_hwnd(LLWindow *window);
-
-	// backdoor for special case handling of Win32 messages
-	void llwindow_install_wndproc(LLWindow *window, WNDPROC wnd_proc);
-#endif
-
 #endif // _LL_window_h_
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index ad56b975778..daa1a26b3d3 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -10,6 +10,8 @@
 
 #if LL_WINDOWS && !LL_MESA_HEADLESS
 
+#include "llwindowwin32.h"
+
 #include <commdlg.h>
 #include <WinUser.h>
 #include <mapi.h>
@@ -20,7 +22,7 @@
 #define DIRECTINPUT_VERSION 0x0800
 #include <dinput.h>
 
-#include "llwindowwin32.h"
+
 #include "llkeyboardwin32.h"
 #include "llerror.h"
 #include "llgl.h"
@@ -3023,19 +3025,6 @@ LRESULT CALLBACK LLSplashScreenWin32::windowProc(HWND h_wnd, UINT u_msg,
 // Helper Funcs
 //
 
-HWND llwindow_get_hwnd(LLWindow *window)
-{
-	//assumes we are dealing with a Win32 window
-	return ((LLWindowWin32*)window)->mWindowHandle;
-}
-
-
-void llwindow_install_wndproc(LLWindow *window, WNDPROC wnd_proc)
-{
-	//assumes we are dealing with a Win32 window
-	((LLWindowWin32*)window)->mWndProc = wnd_proc;
-}
-
 S32 OSMessageBoxWin32(const char* text, const char* caption, U32 type)
 {
 	UINT uType;
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index 6803ad6f2ab..0b6fd5157a3 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -9,6 +9,11 @@
 #ifndef LL_LLWINDOWWIN32_H
 #define LL_LLWINDOWWIN32_H
 
+// Limit Windows API to small and manageable set.
+#define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <windows.h>
+
 #include "llwindow.h"
 
 // Hack for async host by name
@@ -152,8 +157,6 @@ class LLWindowWin32 : public LLWindow
 	BOOL		mMousePositionModified;
 	BOOL		mInputProcessingPaused;
 
-	friend HWND llwindow_get_hwnd(LLWindow *window); 
-	friend void llwindow_install_wndproc(LLWindow *window, WNDPROC wnd_proc);
 	friend class LLWindowManager;
 };
 
diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp
index 5a01bfdc844..0628d544492 100644
--- a/indra/newview/lldirpicker.cpp
+++ b/indra/newview/lldirpicker.cpp
@@ -56,7 +56,7 @@ BOOL LLDirPicker::getDir(LLString* filename)
    memset(&bi, 0, sizeof(bi));
 
    bi.ulFlags   = BIF_USENEWUI;
-   bi.hwndOwner = llwindow_get_hwnd(gViewerWindow->getWindow());;
+   bi.hwndOwner = (HWND)gViewerWindow->getPlatformWindow();
    bi.lpszTitle = NULL;
 
    ::OleInitialize(NULL);
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index 0ef9eed7a33..899d49f3803 100644
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -20,7 +20,6 @@
 #include "lldrawpoolbump.h"
 #include "lldrawpoolclouds.h"
 #include "lldrawpoolground.h"
-#include "lldrawpoolmedia.h"
 #include "lldrawpoolsimple.h"
 #include "lldrawpoolsky.h"
 #include "lldrawpoolstars.h"
@@ -93,9 +92,6 @@ LLDrawPool *LLDrawPool::createPool(const U32 type, LLViewerImage *tex0)
 	case POOL_BUMP:
 		poolp = new LLDrawPoolBump(tex0);
 		break;
-	case POOL_MEDIA:
-		poolp = new LLDrawPoolMedia(tex0);
-		break;
 	case POOL_HUD:
 		poolp = new LLDrawPoolHUD();
 		break;
diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h
index a66d7d14c7d..c00cbf14e4a 100644
--- a/indra/newview/lldrawpool.h
+++ b/indra/newview/lldrawpool.h
@@ -163,7 +163,7 @@ class LLDrawPool
 		POOL_GROUND,
 		POOL_TERRAIN,	
 		POOL_SIMPLE,
-		POOL_MEDIA,
+		POOL_MEDIA,		// unused
 		POOL_BUMP,
 		POOL_AVATAR,
 		POOL_TREE,
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 776a2e4dc25..587f1eb2530 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -130,7 +130,7 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter)
 	// don't provide default file selection
 	mFilesW[0] = '\0';
 
-	mOFN.hwndOwner = llwindow_get_hwnd(gViewerWindow->getWindow());
+	mOFN.hwndOwner = (HWND)gViewerWindow->getPlatformWindow();
 	mOFN.lpstrFile = mFilesW;
 	mOFN.nMaxFile = SINGLE_FILENAME_BUFFER_SIZE;
 	mOFN.Flags = OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR ;
@@ -167,7 +167,7 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter)
 	// don't provide default file selection
 	mFilesW[0] = '\0';
 
-	mOFN.hwndOwner = llwindow_get_hwnd(gViewerWindow->getWindow());
+	mOFN.hwndOwner = (HWND)gViewerWindow->getPlatformWindow();
 	mOFN.lpstrFile = mFilesW;
 	mOFN.nFilterIndex = 1;
 	mOFN.nMaxFile = FILENAME_BUFFER_SIZE;
@@ -238,7 +238,7 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const char* filename)
 	{
 		mFilesW[0] = '\0';
 	}
-	mOFN.hwndOwner = llwindow_get_hwnd(gViewerWindow->getWindow());
+	mOFN.hwndOwner = (HWND)gViewerWindow->getPlatformWindow();
 
 	switch( filter )
 	{
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
old mode 100755
new mode 100644
diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp
index ed99cbe8559..32ae42363bf 100644
--- a/indra/newview/lloverlaybar.cpp
+++ b/indra/newview/lloverlaybar.cpp
@@ -534,16 +534,8 @@ void LLOverlayBar::onPlayButtonPressed( const LLMediaRemoteCtrlObserver::EventTy
 		LLParcel* parcel = gParcelMgr->getAgentParcel();
 		if (parcel)
 		{
-			bool web_url = (parcel->getParcelFlag(PF_URL_WEB_PAGE) || parcel->getParcelFlag(PF_URL_RAW_HTML));
 			LLString path( "" );
-			#if LL_MOZILLA_ENABLED
-			LLString mozilla_subdir;
-			if (web_url)
-			{
-				path = get_mozilla_path();
-			}
-			#endif
-			LLMediaEngine::getInstance ()->convertImageAndLoadUrl( true, web_url, path );
+			LLMediaEngine::getInstance ()->convertImageAndLoadUrl( true, false, path );
 			mMediaRemote->setTransportState ( LLMediaRemoteCtrl::Play, TRUE );
 		}
 	};
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index b013befca56..6f812e9e35d 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -824,6 +824,20 @@ void LLPanelAvatarClassified::enableControls(BOOL self)
 {
 }
 
+BOOL LLPanelAvatarClassified::titleIsValid()
+{
+	LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this, "classified tab");
+	for (S32 i = 0; i < tabs->getTabCount(); i++)
+	{
+		LLPanelClassified* panel = (LLPanelClassified*)tabs->getPanelByIndex(i);
+		if ( ! panel->titleIsValid() )
+		{
+			return FALSE;
+		}
+	}
+
+	return TRUE;
+}
 
 void LLPanelAvatarClassified::apply()
 {
@@ -1624,12 +1638,15 @@ void LLPanelAvatar::onClickOK(void *userdata)
 	{
 		self->sendAvatarPropertiesUpdate();
 
-		self->mPanelClassified->apply();
-
-		LLFloaterAvatarInfo *infop = LLFloaterAvatarInfo::getInstance(self->mAvatarID);
-		if (infop)
+		if ( self->mPanelClassified->titleIsValid() )
 		{
-			infop->close();
+			self->mPanelClassified->apply();
+
+			LLFloaterAvatarInfo *infop = LLFloaterAvatarInfo::getInstance(self->mAvatarID);
+			if (infop)
+			{
+				infop->close();
+			}
 		}
 	}
 }
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index d6b0d235b0d..a17dc69cfc0 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -176,6 +176,8 @@ class LLPanelAvatarClassified : public LLPanel
 	void apply();
 	void enableControls(BOOL own_avatar);
 
+	BOOL titleIsValid();
+
 	// Delete all the classified sub-panels from the tab container
 	void deleteClassifiedPanels();
 
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index 7c84d0f6a5a..dbd97fc7d16 100644
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -224,6 +224,24 @@ BOOL LLPanelClassified::postBuild()
     return TRUE;
 }
 
+BOOL LLPanelClassified::titleIsValid()
+{
+	// Disallow leading spaces, punctuation, etc. that screw up
+	// sort order.
+	const LLString& name = mNameEditor->getText();
+	if (name.empty())
+	{
+		gViewerWindow->alertXml("BlankClassifiedName");
+		return FALSE;
+	}
+	if (!isalnum(name[0]))
+	{
+		gViewerWindow->alertXml("ClassifiedMustBeAlphanumeric");
+		return FALSE;
+	}
+
+	return TRUE;
+}
 
 void LLPanelClassified::apply()
 {
@@ -602,17 +620,10 @@ void LLPanelClassified::onClickUpdate(void* data)
 
 	// Disallow leading spaces, punctuation, etc. that screw up
 	// sort order.
-	const LLString& name = self->mNameEditor->getText();
-	if (name.empty())
+	if ( ! self->titleIsValid() )
 	{
-		gViewerWindow->alertXml("BlankClassifiedName");
 		return;
-	}
-	if (!isalnum(name[0]))
-	{
-		gViewerWindow->alertXml("ClassifiedMustBeAlphanumeric");
-		return;
-	}
+	};
 
 	// if already paid for, just do the update
 	if (self->mPaidFor)
diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h
index e3e7a299bfa..6d5be1df095 100644
--- a/indra/newview/llpanelclassified.h
+++ b/indra/newview/llpanelclassified.h
@@ -55,6 +55,9 @@ class LLPanelClassified : public LLPanel
 	static void setClickThrough(const LLUUID& classified_id,
 								S32 teleport, S32 map, S32 profile);
 
+	// check that the title is valid (E.G. starts with a number or letter)
+	BOOL titleIsValid();
+
 	// Schedules the panel to request data
 	// from the server next time it is drawn.
 	void markForServerRequest();
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index d023be66f25..d9ef9e4c133 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -51,13 +51,6 @@ BOOL	LLPanelFace::postBuild()
 	LLTextureCtrl*	mTextureCtrl;
 	LLColorSwatchCtrl*	mColorSwatch;
 
-	#if LL_MOZILLA_ENABLED
-	LLTextBox*		mLabelMediaType;
-	LLComboBox*		mComboMediaType;
-	LLTextBox*		mLabelMediaURL;
-	LLLineEditor*	mLineMediaURL;
-	#endif
-
 	LLTextBox*		mLabelTexGen;
 	LLComboBox*		mComboTexGen;
 
@@ -111,36 +104,6 @@ BOOL	LLPanelFace::postBuild()
 		mColorSwatch->setCanApplyImmediately(TRUE);
 	}
 
-#if LL_MOZILLA_ENABLED
-	mLabelMediaType = LLUICtrlFactory::getTextBoxByName(this,"web_label");
-	if(mLabelMediaType)
-		mLabelMediaType->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
-
-	mComboMediaType = LLUICtrlFactory::getComboBoxByName(this,"web_type_combo");
-	if(mComboMediaType)
-	{
-		mComboMediaType->setCommitCallback(onCommitMediaInfo);
-		mComboMediaType->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
-		mComboMediaType->setCallbackUserData( this );
-		mComboMediaType->add("None");
-		mComboMediaType->add("Web page");
-	}
-	
-	mLabelMediaURL = LLUICtrlFactory::getTextBoxByName(this,"url_label");
-	if(mLabelMediaURL)
-	{
-		mLabelMediaURL->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
-	}
-
-	mLineMediaURL = LLUICtrlFactory::getLineEditorByName(this,"url_line");
-	if(mLineMediaURL)
-	{
-		mLineMediaURL->setCommitCallback(onCommitMediaInfo);
-		mLineMediaURL->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP);
-		mLineMediaURL->setCommitOnFocusLost(TRUE);
-		mLineMediaURL->setCallbackUserData( this );
-	}
-#endif
 	mLabelColorTransp = LLUICtrlFactory::getTextBoxByName(this,"color trans");
 	if(mLabelColorTransp)
 	{
@@ -250,19 +213,6 @@ void LLPanelFace::sendFullbright()
 	gSelectMgr->selectionSetFullbright( fullbright );
 }
 
-#if LL_MOZILLA_ENABLED
-void LLPanelFace::sendMediaInfo()
-{
-	if (mComboMediaType)
-	{
-		U8 media_type = (U8) mComboMediaType->getCurrentIndex();
-		std::string media_url = mLineMediaURL->getText();
-
-		gSelectMgr->selectionSetMediaTypeAndURL( media_type, media_url );
-	}
-}
-#endif
-
 void LLPanelFace::sendColor()
 {
 	
@@ -397,48 +347,6 @@ void LLPanelFace::getState()
 				//mBtnAutoFix->setEnabled ( editable );
 			}
 		childSetEnabled("button apply",editable);
-		//mBtnApply->setEnabled( editable );
-
-		#if LL_MOZILLA_ENABLED
-		if (gSavedSettings.getBOOL("UseWebPagesOnPrims"))
-		{
-			// Web page selection
-			mLabelMediaType->setEnabled(editable);
-			mLabelMediaType->setToolTip("Experimental");
-
-			// JAMESDEBUG - use viewerobject mMedia->mMediaType when transmission is wired in
-			U8 media_type = LLViewerObject::MEDIA_TYPE_NONE;
-			bool same = gSelectMgr->selectionGetMediaType( &media_type );
-			mComboMediaType->setTentative( !same );
-			mComboMediaType->setEnabled( editable );
-			mComboMediaType->setCurrentByIndex( (S32)media_type );
-			mComboMediaType->setToolTip("Experimental");
-
-			mLabelMediaURL->setEnabled(editable);
-			mLabelMediaURL->setToolTip("Experimental");
-
-			const std::string& media_url = objectp->getMediaURL();
-			mLineMediaURL->setEnabled( editable );
-			mLineMediaURL->setText( media_url );
-			mLineMediaURL->setToolTip("Experimental");
-		}
-		else
-		{
-			mLabelMediaType->setEnabled(FALSE);
-			mLabelMediaType->setToolTip("Disabled because 'Show web pages on objects' preference is disabled");
-
-			mComboMediaType->setEnabled( FALSE );
-			mComboMediaType->setCurrentByIndex( LLViewerObject::MEDIA_TYPE_NONE );
-			mComboMediaType->setToolTip("Disabled because 'Show web pages on objects' preference is disabled");
-
-			mLabelMediaURL->setEnabled(FALSE);
-			mLabelMediaURL->setToolTip("Disabled because 'Show web pages on objects' preference is disabled");
-
-			mLineMediaURL->setEnabled( FALSE );
-			mLineMediaURL->setText( "" );
-			mLineMediaURL->setToolTip("Disabled because 'Show web pages on objects' preference is disabled");
-		}
-		#endif
 
 		// Texture
 		LLUUID id;
@@ -895,15 +803,6 @@ void LLPanelFace::onCommitTextureInfo( LLUICtrl* ctrl, void* userdata )
 	self->sendTextureInfo();
 }
 
-#if LL_MOZILLA_ENABLED
-// static
-void LLPanelFace::onCommitMediaInfo(LLUICtrl* ctrl, void* data)
-{
-	LLPanelFace* self = (LLPanelFace*) data;
-	self->sendMediaInfo();
-}
-#endif
-
 // Commit the number of repeats per meter
 // static
 void LLPanelFace::onClickApply(void* userdata)
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index 03f361d23cf..dc58caff2aa 100644
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -49,9 +49,6 @@ class LLPanelFace : public LLPanel
 	void			sendTexGen();				// applies and sends bump map
 	void			sendShiny();			// applies and sends shininess
 	void			sendFullbright();		// applies and sends full bright
-	#if LL_MOZILLA_ENABLED
-	void			sendMediaInfo();		// web page settings and URL
-	#endif
 
 	// this function is to return TRUE if the dra should succeed.
 	static BOOL onDragTexture(LLUICtrl* ctrl, LLInventoryItem* item, void* ud);
@@ -68,9 +65,6 @@ class LLPanelFace : public LLPanel
 	static void		onCommitTexGen(			LLUICtrl* ctrl, void* userdata);
 	static void		onCommitShiny(			LLUICtrl* ctrl, void* userdata);
 	static void		onCommitFullbright(		LLUICtrl* ctrl, void* userdata);
-	#if LL_MOZILLA_ENABLED
-	static void		onCommitMediaInfo(		LLUICtrl* ctrl, void* data);
-	#endif
 
 	static void		onClickApply(void*);
 	static void		onClickAutoFix(void*);
@@ -85,52 +79,6 @@ class LLPanelFace : public LLPanel
 	static F32		valueTexGen(LLViewerObject* object, S32 face);
 	static F32		valueShiny(LLViewerObject* object, S32 face);
 	static F32		valueFullbright(LLViewerObject* object, S32 face);
-
-protected:
-	//LLTextureCtrl*	mTextureCtrl;
-	//LLColorSwatchCtrl*	mColorSwatch;
-
-	//#if LL_MOZILLA_ENABLED
-	//LLTextBox*		mLabelMediaType;
-	//LLComboBox*		mComboMediaType;
-	//LLTextBox*		mLabelMediaURL;
-	//LLLineEditor*	mLineMediaURL;
-	//#endif
-
-	//LLTextBox		*mLabelTexScale;
-	//LLSpinCtrl		*mCtrlTexScaleS;
-	//LLSpinCtrl		*mCtrlTexScaleT;
-
-	//LLCheckBoxCtrl	*mCheckFlipScaleS;
-	//LLCheckBoxCtrl	*mCheckFlipScaleT;
-
-	//LLTextBox		*mLabelTexOffset;
-	//LLSpinCtrl		*mCtrlTexOffsetS;
-	//LLSpinCtrl		*mCtrlTexOffsetT;
-
-	//LLTextBox		*mLabelTexRotation;
-	//LLSpinCtrl		*mCtrlTexRotation;
-
-	//LLTextBox*		mLabelTexGen;
-	//LLComboBox*		mComboTexGen;
-
-	//LLTextBox*		mLabelShininess;
-	//LLComboBox*		mComboShininess;
-
-	//LLTextBox*		mLabelBumpiness;
-	//LLComboBox*		mComboBumpiness;
-
-	//LLCheckBoxCtrl	*mCheckFullbright;
-	//
-	//LLTextBox*		mLabelColorTransp;
-	//LLSpinCtrl*		mCtrlColorTransp;		// transparency = 1 - alpha
-
-	//LLTextBox*		mLabelRepeatsPerMeter;
-	//LLSpinCtrl*		mCtrlRepeatsPerMeter;
-	//LLButton*		mBtnApply;
-
-	//LLTextBox*		mLabelTexAutoFix;
-	//LLButton*		mBtnAutoFix;
 };
 
 #endif
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index fea8924b781..74c1d443297 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -11,9 +11,9 @@
 #include "llstartup.h"
 
 #if LL_WINDOWS
-#include <process.h>		// _spawnl()
+#	include <process.h>		// _spawnl()
 #else
-#include <sys/stat.h>		// mkdir()
+#	include <sys/stat.h>		// mkdir()
 #endif
 
 #include "audioengine.h"
@@ -108,7 +108,6 @@
 #include "llviewerdisplay.h"
 #include "llviewergesture.h"
 #include "llviewerimagelist.h"
-#include "llviewermedialist.h"
 #include "llviewermenu.h"
 #include "llviewermessage.h"
 #include "llviewernetwork.h"
@@ -497,7 +496,7 @@ BOOL idle_startup()
 #if LL_WINDOWS
 				// FMOD on Windows needs the window handle to stop playing audio
 				// when window is minimized. JC
-				void* window_handle = (void*)llwindow_get_hwnd(gViewerWindow->getWindow());
+				void* window_handle = (HWND)gViewerWindow->getPlatformWindow();
 #else
 				void* window_handle = NULL;
 #endif
@@ -1854,46 +1853,6 @@ BOOL idle_startup()
 		}
 		#endif
 
-		// Get list of URLs approved for usage
-		// CP: removed since they're not useful without Mozilla enabled
-		#if LL_MOZILLA_ENABLED
-		LLUrlWhiteList::getInstance()->load();
-		#endif
-
-		// initialize mozilla if we're using web page on a prim or not using an external browser for floater
-		BOOL use_web_pages_on_prims = gSavedSettings.getBOOL("UseWebPagesOnPrims");
-		BOOL use_external_browser = gSavedSettings.getBOOL("UseExternalBrowser");
-
-use_external_browser = false;
-
-		if (use_web_pages_on_prims || !use_external_browser)
-		{
-			//llinfos << "Initializing web browser...." << llendl;
-			//set_startup_status(0.48f, "Initializing web browser...", gAgent.mMOTD.c_str());
-			//display_startup();
-			// initialize mozilla
-			LLString mozilla_path = gDirUtilp->getExecutableDir();
-			mozilla_path.append( gDirUtilp->getDirDelimiter() );
-#if LL_DEBUG
-			mozilla_path.append( "mozilla_debug" );
-#else
-			mozilla_path.append( "mozilla" );
-#endif
-
-#if LL_MOZILLA_ENABLED
-			if (!gMozillaInitialized)
-			{
-				void* platform_window = gViewerWindow->getPlatformWindow();
-				mozilla_init_embedding(platform_window, mozilla_path);
-			}
-#endif
-
-			if (use_web_pages_on_prims)
-			{
-				gMediaList = new LLViewerMediaList(2);
-			}
-		}
-
 		gStartupState++;
 		return do_normal_idle;
 	}
diff --git a/indra/newview/llurlwhitelist.cpp b/indra/newview/llurlwhitelist.cpp
index d582d2d19f0..65f7229abfc 100644
--- a/indra/newview/llurlwhitelist.cpp
+++ b/indra/newview/llurlwhitelist.cpp
@@ -200,22 +200,4 @@ bool LLUrlWhiteList::getNext ( LLString& valueOut )
 bool LLUrlWhiteList::containsMatch ( const LLString& patternIn )
 {
 	return false;
-
-	// CP: removed since they're not useful without Mozilla enabled
-	#if LL_MOZILLA_ENABLED
-	LLString pattern = url_cleanup(patternIn);
-	
-	if (pattern.empty()) return false;	
-	
-	LLStringListIter iter = std::find ( mUrlList.begin (), mUrlList.end (), pattern );
-
-	if ( iter != mUrlList.end () )
-	{
-		return true;
-	}
-	else
-	{	
-		return false;
-	};
-	#endif
 }
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 3a38ba52eed..1a4ffadeee9 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -183,7 +183,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield)
 		static F32 last_update_time = 0.f;
 		if ((gFrameTimeSeconds - last_update_time) > 1.f)
 		{
-			InvalidateRect(llwindow_get_hwnd(gViewerWindow->getWindow()), NULL, FALSE);
+			InvalidateRect((HWND)gViewerWindow->getPlatformWindow(), NULL, FALSE);
 			last_update_time = gFrameTimeSeconds;
 		}
 #elif LL_DARWIN
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 2d97c6f2a4f..7db94eb9724 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -49,7 +49,6 @@
 #include "llviewercamera.h"
 #include "llviewerimagelist.h"
 #include "llviewerinventory.h"
-#include "llviewermedialist.h"
 #include "llviewerobjectlist.h"
 #include "llviewerparceloverlay.h"
 #include "llviewerpartsource.h"
@@ -3266,16 +3265,8 @@ void LLViewerObject::setMediaType(U8 media_type)
 	else if (mMedia->mMediaType != media_type)
 	{
 		mMedia->mMediaType = media_type;
-		if (gMediaList)
-		{
-			// we're using web pages on prims
-			gMediaList->updatedMediaURL(this);
-		}
-		if (mDrawable.notNull())
-		{
-			// move this object's faces into LLDrawPoolMedia
-			gPipeline.markTextured(mDrawable);
-		}
+
+		// TODO: update materials with new image
 	}
 }
 
@@ -3300,30 +3291,15 @@ void LLViewerObject::setMediaURL(const LLString& media_url)
 		mMedia = new LLViewerObjectMedia;
 		mMedia->mMediaURL = media_url;
 		mMedia->mPassedWhitelist = FALSE;
-		if (gMediaList)
-		{
-			gMediaList->addedMediaURL(this);
-		}
-		if (mDrawable.notNull())
-		{
-			// move this object's faces into LLDrawPoolMedia
-			gPipeline.markTextured(mDrawable);
-		}
+
+		// TODO: update materials with new image
 	}
 	else if (mMedia->mMediaURL != media_url)
 	{
 		mMedia->mMediaURL = media_url;
 		mMedia->mPassedWhitelist = FALSE;
-		if (gMediaList)
-		{
-			// we're using web pages on prims
-			gMediaList->updatedMediaURL(this);
-		}
-		if (mDrawable.notNull())
-		{
-			// move this object's faces into LLDrawPoolMedia
-			gPipeline.markTextured(mDrawable);
-		}
+
+		// TODO: update materials with new image
 	}
 }
 
@@ -4137,6 +4113,12 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow
 		}
 	}
 
+	if ( mAudioSourcep )
+	{
+		gAudiop->cleanupAudioSource(mAudioSourcep);
+		mAudioSourcep = NULL;
+	}
+
 	getAudioSource(owner_id);
 
 	if (mAudioSourcep)
@@ -4153,8 +4135,6 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow
 
 LLAudioSource *LLViewerObject::getAudioSource(const LLUUID& owner_id)
 {
-	LLMemType mt(LLMemType::MTYPE_OBJECT);
-	
 	if (!mAudioSourcep)
 	{
 		// Arbitrary low gain for a sound that's not playing.
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index e1fed125639..e2c1bc06957 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -44,7 +44,6 @@
 #include "lldatapacker.h"
 #include <zlib/zlib.h>
 #include "object_flags.h"
-#include "llviewermedialist.h"
 
 extern BOOL gVelocityInterpolate;
 extern BOOL gPingInterpolate;
@@ -178,11 +177,13 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
 										   U32 i, 
 										   const EObjectUpdateType update_type, 
 										   LLDataPacker* dpp, 
-										   BOOL justCreated)
+										   BOOL just_created)
 {
 	LLMessageSystem* msg = gMessageSystem;
 
-	U32 pum_flags = objectp->processUpdateMessage(msg, user_data, i, update_type, dpp);
+	// ignore returned flags
+	objectp->processUpdateMessage(msg, user_data, i, update_type, dpp);
+
 	if (objectp->isDead())
 	{
 		// The update failed
@@ -196,7 +197,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
 	// Update the image levels of textures for this object.
 	objectp->updateTextures(gAgent);
 
-	if (justCreated) 
+	if (just_created) 
 	{
 		gPipeline.addObject(objectp);
 	}
@@ -207,7 +208,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
 	findOrphans(objectp, msg->getSenderIP(), msg->getSenderPort());
 
 	// If we're just wandering around, don't create new objects selected.
-	if (justCreated 
+	if (just_created 
 		&& update_type != OUT_TERSE_IMPROVED 
 		&& objectp->mCreateSelected)
 	{
@@ -223,37 +224,6 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp,
 		gViewerWindow->getWindow()->decBusyCount();
 		gViewerWindow->getWindow()->setCursor( UI_CURSOR_ARROW );
 	}
-
-	if (gMediaList)
-	{
-		// we're using web pages on prims
-		if (pum_flags & LLViewerObject::MEDIA_URL_ADDED)
-		{
-			//llwarns << "WEBONPRIM media url added " << objectp->getMediaURL() << llendl;
-			gMediaList->addedMediaURL(objectp);
-		}
-
-		if (pum_flags & LLViewerObject::MEDIA_URL_UPDATED)
-		{
-			//llwarns << "WEBONPRIM media url updated " << objectp->getMediaURL() << llendl;
-			gMediaList->updatedMediaURL(objectp);
-		}
-
-		if (pum_flags & LLViewerObject::MEDIA_URL_REMOVED)
-		{
-			//llwarns << "WEBONPRIM media url removed " << objectp->getMediaURL() << llendl;
-			gMediaList->removedMediaURL(objectp);
-		}
-
-		// Make sure we get moved in or out of LLDrawPoolMedia, as needed
-		if (pum_flags & (LLViewerObject::MEDIA_URL_ADDED | LLViewerObject::MEDIA_URL_REMOVED | LLViewerObject::MEDIA_URL_UPDATED))
-		{
-			if (objectp->mDrawable.notNull())
-			{
-				gPipeline.markTextured(objectp->mDrawable);
-			}
-		}
-	}
 }
 
 void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 8e7edab927e..b29b49b3996 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1866,15 +1866,8 @@ void prepare_video(const LLParcel *parcel)
 void start_video(const LLParcel *parcel)
 {
 	prepare_video(parcel);
-	bool web_url = (parcel->getParcelFlag(PF_URL_WEB_PAGE) || parcel->getParcelFlag(PF_URL_RAW_HTML));
 	std::string path( "" );
-	#if LL_MOZILLA_ENABLED
-	if (web_url)
-	{
-		path = get_mozilla_path();
-	}
-	#endif
-	LLMediaEngine::getInstance ()->convertImageAndLoadUrl ( true, web_url, path);
+	LLMediaEngine::getInstance ()->convertImageAndLoadUrl ( true, false, path);
 }
 
 void stop_video()
diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h
index 5c50fef58e9..76efdb85955 100644
--- a/indra/newview/llviewerprecompiledheaders.h
+++ b/indra/newview/llviewerprecompiledheaders.h
@@ -15,10 +15,18 @@
 // in viewer.
 // It is used to precompile headers for improved build speed.
 
-// Reference headers your program requires here:
 #include "linden_common.h"
 
-// The rest of the common system headers go here:
+// We may want to take the windows.h include out, but it used to be in 
+// linden_common.h, and hence in all the libraries.  This is better. JC
+#if LL_WINDOWS
+	// Limit Windows API to small and manageable set.
+	// If you get undefined symbols, find the appropriate
+	// Windows header file and include that in your .cpp file.
+	#define WIN32_LEAN_AND_MEAN
+	#include <winsock2.h>
+	#include <windows.h>
+#endif
 
 // Work around stupid Microsoft STL warning
 #ifdef LL_WINDOWS
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index ea73a969d66..331502c28ad 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1023,7 +1023,7 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window,  S32 x,  S32 y, S32 width,  S
 #if LL_WINDOWS
 	if (gNoRender)
 	{
-		HWND window_handle = llwindow_get_hwnd(window);
+		HWND window_handle = (HWND)window->getPlatformWindow();
 		PAINTSTRUCT ps; 
 		HDC hdc; 
  
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index d1e4de54785..d1bcacb5c4d 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -35,7 +35,6 @@
 #include "lldrawable.h"
 #include "lldrawpoolavatar.h"
 #include "lldrawpoolalpha.h"
-#include "lldrawpoolmedia.h"
 #include "lldrawpoolbump.h"
 #include "lldriverparam.h"
 #include "lleditingmotion.h"
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index d57bb7da822..1f87cf225d6 100644
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -19,18 +19,7 @@
 // static
 void LLWeb::loadURL(std::string url)
 {
-#if LL_MOZILLA_ENABLED
-	if (gSavedSettings.getBOOL("UseExternalBrowser"))
-	{
-		loadURLExternal(url);
-	}
-	else
-	{
-		LLFloaterHTML::show((void*)url.c_str());
-	}
-#else
 	loadURLExternal(url);
-#endif
 }
 
 
diff --git a/indra/win_crash_logger/win_crash_logger.cpp b/indra/win_crash_logger/win_crash_logger.cpp
index e9198e8ff9d..decb70d822a 100644
--- a/indra/win_crash_logger/win_crash_logger.cpp
+++ b/indra/win_crash_logger/win_crash_logger.cpp
@@ -9,9 +9,11 @@
 // win_crash_logger.cpp : Defines the entry point for the application.
 //
 
+// Must be first include, precompiled headers.
+#include "stdafx.h"
+
 #include "linden_common.h"
 #include "llcontrol.h"
-#include "stdafx.h"
 #include "resource.h"
 
 #include <stdio.h>
-- 
GitLab