summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
authorBrian McGroarty <soft@lindenlab.com>2008-05-07 20:48:38 +0000
committerBrian McGroarty <soft@lindenlab.com>2008-05-07 20:48:38 +0000
commitd273ba2ce2707c6a2fe45c08fdc2524aae19ad00 (patch)
tree56b3723fed44031e888de9019b1ad127acdb1806 /indra/newview/llselectmgr.cpp
parente1e1212daae33723e7da325f295a5c3a6bb78979 (diff)
Back out QAR-520 maintenance-7 merge -- svn merge -r 86947:86946 svn+ssh://svn.lindenlab.com/svn/linden/release dataserver-is-deprecated
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r--indra/newview/llselectmgr.cpp52
1 files changed, 14 insertions, 38 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 96c9ec113b..5eacb25ded 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -2827,53 +2827,27 @@ void LLSelectMgr::selectForceDelete()
SEND_ONLY_ROOTS);
}
-void LLSelectMgr::selectGetAggregateSaleInfo(U32 &num_for_sale,
- BOOL &is_for_sale_mixed,
- BOOL &is_sale_price_mixed,
- S32 &total_sale_price,
- S32 &individual_sale_price)
-{
- num_for_sale = 0;
- is_for_sale_mixed = FALSE;
- is_sale_price_mixed = FALSE;
- total_sale_price = 0;
- individual_sale_price = 0;
+// returns TRUE if anything is for sale. calculates the total price
+// and stores that value in price.
+BOOL LLSelectMgr::selectIsForSale(S32& price)
+{
+ BOOL any_for_sale = FALSE;
+ price = 0;
- // Empty set.
- if (getSelection()->root_begin() == getSelection()->root_end())
- return;
-
- LLSelectNode *node = *(getSelection()->root_begin());
- const BOOL first_node_for_sale = node->mSaleInfo.isForSale();
- const S32 first_node_sale_price = node->mSaleInfo.getSalePrice();
-
for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
iter != getSelection()->root_end(); iter++)
{
LLSelectNode* node = *iter;
- const BOOL node_for_sale = node->mSaleInfo.isForSale();
- const S32 node_sale_price = node->mSaleInfo.getSalePrice();
-
- // Set mixed if the fields don't match the first node's fields.
- if (node_for_sale != first_node_for_sale)
- is_for_sale_mixed = TRUE;
- if (node_sale_price != first_node_sale_price)
- is_sale_price_mixed = TRUE;
-
- if (node_for_sale)
+ if (node->mSaleInfo.isForSale())
{
- total_sale_price += node_sale_price;
- num_for_sale ++;
+ price += node->mSaleInfo.getSalePrice();
+ any_for_sale = TRUE;
}
}
-
- individual_sale_price = first_node_sale_price;
- if (is_for_sale_mixed)
- {
- is_sale_price_mixed = TRUE;
- individual_sale_price = 0;
- }
+
+ return any_for_sale;
+
}
// returns TRUE if all nodes are valid. method also stores an
@@ -3529,6 +3503,8 @@ void LLSelectMgr::selectionSetObjectCategory(const LLCategory& category)
void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info)
{
+ // Only one sale info at a time for now
+ if(mSelectedObjects->getRootObjectCount() != 1) return;
sendListToRegions("ObjectSaleInfo",
packAgentAndSessionID,
packObjectSaleInfo,