From 5da967dc744f35d5270c7cb0b8b23b993ecda3e1 Mon Sep 17 00:00:00 2001
From: Steven Bennetts <steve@lindenlab.com>
Date: Fri, 8 May 2009 07:58:49 +0000
Subject: [PATCH] merge skinning-7 -r 119501-119577 -> viewer-2.0.0-1  *NOTE:
 This overlaps a little with the skinning-7 -> skinning-8 merge of
 119500-119692 -- James ignore-dead-branch

---
 indra/llui/llui.cpp               |  6 ++--
 indra/llui/llui.h                 |  6 ++--
 indra/llui/lluiimage.h            |  2 +-
 indra/llui/llview.cpp             | 11 +++++--
 indra/llui/llview.h               | 52 +++++++++++++++----------------
 indra/newview/llfloaterland.cpp   | 18 +++++------
 indra/newview/llfloaterurlentry.h |  4 +--
 indra/newview/llnamelistctrl.cpp  |  6 ++--
 indra/newview/llnamelistctrl.h    | 12 ++++++-
 9 files changed, 67 insertions(+), 50 deletions(-)

diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index dfe435d2e32..1cb69723707 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -1930,7 +1930,7 @@ LLLocalClipRect::LLLocalClipRect(const LLRect &rect, BOOL enabled)
 
 namespace LLInitParam
 {
-	TypedParam<LLUIColor >::TypedParam(BlockDescriptor& descriptor, const std::string& name, const LLUIColor& value, ParamDescriptor::validation_func_t func)
+	TypedParam<LLUIColor >::TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func)
 	:	super_t(descriptor, name, value, func),
 		red("red"),
 		green("green"),
@@ -1960,7 +1960,7 @@ namespace LLInitParam
 		declare("blue", LLColor4::blue);
 	}
 
-	TypedParam<const LLFontGL*>::TypedParam(BlockDescriptor& descriptor, const std::string& name, const LLFontGL*const value, ParamDescriptor::validation_func_t func)
+	TypedParam<const LLFontGL*>::TypedParam(BlockDescriptor& descriptor, const char* name, const LLFontGL*const value, ParamDescriptor::validation_func_t func)
 	:	super_t(descriptor, name, value, func),
 		name("", std::string("")),
 		size("size", std::string("")),
@@ -1991,7 +1991,7 @@ namespace LLInitParam
 		return mData.mValue;
 	}
 
-	TypedParam<LLRect>::TypedParam(BlockDescriptor& descriptor, const std::string& name, const LLRect& value, ParamDescriptor::validation_func_t func)
+	TypedParam<LLRect>::TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func)
 	:	super_t(descriptor, name, value, func),
 		left("left"),
 		top("top"),
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index b5a42bce13c..18aa1aa1432 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -706,7 +706,7 @@ namespace LLInitParam
 						width,
 						height;
 
-		TypedParam(BlockDescriptor& descriptor, const std::string& name, const LLRect& value, ParamDescriptor::validation_func_t func);
+		TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func);
 
 		LLRect getValueFromBlock() const;
 	};
@@ -729,7 +729,7 @@ namespace LLInitParam
 		Optional<F32> alpha;
 		Optional<std::string> control;
 
-		TypedParam(BlockDescriptor& descriptor, const std::string& name, const LLUIColor& value, ParamDescriptor::validation_func_t func);
+		TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func);
 		LLUIColor getValueFromBlock() const;
 	};
 
@@ -743,7 +743,7 @@ namespace LLInitParam
 		Optional<std::string> size;
 		Optional<std::string> style;
 
-		TypedParam(BlockDescriptor& descriptor, const std::string& name, const LLFontGL* const value, ParamDescriptor::validation_func_t func);
+		TypedParam(BlockDescriptor& descriptor, const char* name, const LLFontGL* const value, ParamDescriptor::validation_func_t func);
 		const LLFontGL* getValueFromBlock() const;
 	};
 
diff --git a/indra/llui/lluiimage.h b/indra/llui/lluiimage.h
index cd660a09540..ae43b501723 100644
--- a/indra/llui/lluiimage.h
+++ b/indra/llui/lluiimage.h
@@ -94,7 +94,7 @@ namespace LLInitParam
 	public:
 		Optional<std::string> name;
 
-		TypedParam(BlockDescriptor& descriptor, const std::string& name, super_t::value_assignment_t value, ParamDescriptor::validation_func_t func)
+		TypedParam(BlockDescriptor& descriptor, const char* name, super_t::value_assignment_t value, ParamDescriptor::validation_func_t func)
 		:	super_t(descriptor, name, value, func)
 		{
 		}
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 462fd16b607..536d0c23f81 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -2341,7 +2341,14 @@ void LLView::initFromParams(const LLView::Params& params)
 
 void LLView::parseFollowsFlags(const LLView::Params& params)
 {
-	if (params.follows.string.isProvided())
+	// preserve follows flags set by code if user did not override
+	if (!params.follows.isProvided()) 
+	{
+		return;
+	}
+
+	// interpret either string or bitfield version of follows
+	if (params.follows.string.isChosen())
 	{
 		setFollows(FOLLOWS_NONE);
 
@@ -2378,7 +2385,7 @@ void LLView::parseFollowsFlags(const LLView::Params& params)
 			++token_iter;
 		}
 	}
-	else if (params.follows.flags.isProvided())
+	else if (params.follows.flags.isChosen())
 	{
 		setFollows(params.follows.flags);
 	}
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 69ae7dd993a..85e190c7d28 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -154,41 +154,41 @@ class LLView : public LLMouseHandler, public LLMortician
 
 	struct Params : public LLInitParam::Block<Params>
 	{
-		Mandatory<std::string>	name;
-
-		Optional<bool>			enabled,
-								visible;
-		Optional<bool>			mouse_opaque;
-		Optional<bool>			use_bounding_rect;
-		Optional<S32>			tab_group,
-								default_tab_group;
-		Optional<std::string>	tool_tip;
-
-		Optional<S32>			sound_flags;
-		Optional<bool>			serializable;
-		Optional<Follows>		follows;
-		Optional<std::string>	hover_cursor;
+		Mandatory<std::string>		name;
+
+		Optional<bool>				enabled,
+									visible;
+		Optional<bool>				mouse_opaque;
+		Optional<bool>				use_bounding_rect;
+		Optional<S32>				tab_group,
+									default_tab_group;
+		Optional<std::string>		tool_tip;
+
+		Optional<S32>				sound_flags;
+		Optional<bool>				serializable;
+		Optional<Follows>			follows;
+		Optional<std::string>		hover_cursor;
 		
 		// font params
 		Optional<const LLFontGL*>	font;
 		Optional<LLFontGL::HAlign>	font_halign;
 		Optional<LLFontGL::VAlign>	font_valign;
 
-		Optional<std::string>	layout;
-		Optional<LLRect>		rect;
-		Optional<S32>			top_delta,
-								bottom_delta,
-								right_delta,
-								left_delta;
-								
-		Optional<bool>			center_horiz,
-								center_vert;
+		Optional<std::string>		layout;
+		Optional<LLRect>			rect;
+		Optional<S32>				top_delta,
+									bottom_delta,
+									right_delta,
+									left_delta;
+									
+		Optional<bool>				center_horiz,
+									center_vert;
 
 		// these are nested attributes for LLLayoutPanel
 		//FIXME: get parent context involved in parsing traversal
-		Deprecated				user_resize,
-								auto_resize,
-								needs_translate;
+		Deprecated					user_resize,
+									auto_resize,
+									needs_translate;
 
 		Params();
 	};
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 1de656144f4..347fe45b823 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -1462,26 +1462,26 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo
 
 		if (is_group_owned)
 		{
-			item_params.cells.add().type("icon").value(self->mIconGroup->getName());
-			item_params.cells.add().value(OWNER_GROUP).font(FONT);
+			item_params.cells.add().type("icon").value(self->mIconGroup->getName()).column("type");
+			item_params.cells.add().value(OWNER_GROUP).font(FONT).column("online_status");
 		}
 		else if (is_online)
 		{
-			item_params.cells.add().type("icon").value(self->mIconAvatarOnline->getName());
-			item_params.cells.add().value(OWNER_ONLINE).font(FONT);
+			item_params.cells.add().type("icon").value(self->mIconAvatarOnline->getName()).column("type");
+			item_params.cells.add().value(OWNER_ONLINE).font(FONT).column("online_status");
 		}
 		else  // offline
 		{
-			item_params.cells.add().type("icon").value(self->mIconAvatarOffline->getName());
-			item_params.cells.add().value(OWNER_OFFLINE).font(FONT);
+			item_params.cells.add().type("icon").value(self->mIconAvatarOffline->getName()).column("type");
+			item_params.cells.add().value(OWNER_OFFLINE).font(FONT).column("online_status");
 		}
 
 		// Placeholder for name.
-		item_params.cells.add().font(FONT);
+		item_params.cells.add().font(FONT).column("name");
 
 		object_count_str = llformat("%d", object_count);
-		item_params.cells.add().value(object_count_str).font(FONT);
-		item_params.cells.add().value(formatted_time((time_t)most_recent_time)).font(FONT);
+		item_params.cells.add().value(object_count_str).font(FONT).column("count");
+		item_params.cells.add().value(formatted_time((time_t)most_recent_time)).font(FONT).column("mostrecent");
 
 		self->mOwnerList->addRow(item_params);
 
diff --git a/indra/newview/llfloaterurlentry.h b/indra/newview/llfloaterurlentry.h
index 6f83c18d071..0aeca823b80 100644
--- a/indra/newview/llfloaterurlentry.h
+++ b/indra/newview/llfloaterurlentry.h
@@ -1,6 +1,6 @@
 /**
- * @file llfloaternamedesc.h
- * @brief LLFloaterNameDesc class definition
+ * @file llfloaterurlentry.h
+ * @brief LLFloaterURLEntry class definition
  *
  * $LicenseInfo:firstyear=2007&license=viewergpl$
  * 
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index eee64b56518..95d787840ff 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -54,7 +54,7 @@ void LLNameListCtrl::NameTypeNames::declareValues()
 }
 
 LLNameListCtrl::Params::Params()
-:	name_column("name_column"),
+:	name_column(""),
 	allow_calling_card_drop("allow_calling_card_drop", false)
 {
 	name = "name_list";
@@ -63,8 +63,8 @@ LLNameListCtrl::Params::Params()
 LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p)
 :	LLScrollListCtrl(p),
 	mAllowCallingCardDrop(p.allow_calling_card_drop),
-	mNameColumn(p.name_column),
-	mNameColumnIndex(0)
+	mNameColumn(p.name_column.column_name),
+	mNameColumnIndex(p.name_column.column_index)
 {}
 
 // public
diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h
index 759ea938f98..379cd48a6a6 100644
--- a/indra/newview/llnamelistctrl.h
+++ b/indra/newview/llnamelistctrl.h
@@ -66,9 +66,19 @@ class LLNameListCtrl
 		{}		
 	};
 
+	struct NameColumn : public LLInitParam::Choice<NameColumn>
+	{
+		Option<S32>				column_index;
+		Option<std::string>		column_name;
+		NameColumn()
+		:	column_name("name_column"),
+			column_index("name_column_index", 0)
+		{}
+	};
+
 	struct Params : public LLInitParam::Block<Params, LLScrollListCtrl::Params>
 	{
-		Optional<std::string>	name_column;
+		Optional<NameColumn>	name_column;
 		Optional<bool>	allow_calling_card_drop;
 		Params();
 	};
-- 
GitLab