summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolmgr.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-03-11 01:47:36 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-03-11 01:47:36 +0000
commit377ae59c21215473cf05e3cb8a86eb14c9e7715c (patch)
treea8cb48901c3c30bc1c2ddfd5d8b2d0cab7c6c95d /indra/newview/lltoolmgr.cpp
parent9d12bd5e273b8cb032e25574461a8b4528d96343 (diff)
merge Branch_1-19-1-Viewer -r 80930 : 81609 -> release
DEV-11202: Unhandled Excpetion in pipeline.cpp. Merged over updated windlight ui help text from windlight14. Reverting a const change in a virtual that was not propagated to all overrides. DEV-10957 stop and pause Media and music buttons do not work DEV-10762 Displayed page in the client browser disappears when crossing property boundaries. DEV-11220 replace misspellings in alerts.xml parameters of 'messsage' DEV-11221 fix a misspelling of 'participants' in floater_chat_history.xml tooltip DEV-11193 clean up some viewer strings related to Windlight help text svn merge -r81144:81147 svn+ssh://svn/svn/linden/branches/1-19-1-viewer-threads DEV-11110 Media browser history dropdown does not save items across sessions Ran the xuiparse -process tool on all en-us xml files. This does NOT change any data, merely reorders attributes and cleans up tab/spacing. DEV-11349 XML CLEANUP: fix duplicate sibling names in en-us xui files DEV-11348 Change to llmimetypes.cpp broke Media Type dropdown dev-10623 "parcels that played movies no longer work in combo-merge-ui" DEV-11379 - crash in LLTabContainer::draw() DEV-11377 Elminiate dangerous LLLinkedList and LLDoubleLinkedList from newview DEV-11158 sculpties on the top10 crash list DEV-11404 "Send Current URL to Parcel" does not set the MIME type merge 80958:80959 maint-ui-9-qa, DEV-11105 -- Searching for people with 3 characters like "j l" hurts the database. DEV-10489: no draw distance cheating DEV-879: water noise frequency DEV-10764: macbook air support DEV-10878: Linux Intel945 support DEV-7551: featuretable adjustments for framerate. DEV-11426 Enormous mini-map. DEV-11505 - Crash in gunzip_file. Removed final LinkedList, SkipMap, and AssocList templates from the Viewer! DEV-11115 truncated word in the Advanced Water Editor's modal help dialog
Diffstat (limited to 'indra/newview/lltoolmgr.cpp')
-rw-r--r--indra/newview/lltoolmgr.cpp50
1 files changed, 29 insertions, 21 deletions
diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp
index 0e46ece794..c365f14674 100644
--- a/indra/newview/lltoolmgr.cpp
+++ b/indra/newview/lltoolmgr.cpp
@@ -438,9 +438,7 @@ void LLToolMgr::clearSavedTool()
void LLToolset::addTool(LLTool* tool)
{
- llassert( !mToolList.checkData( tool ) ); // check for duplicates
-
- mToolList.addDataAtEnd( tool );
+ mToolList.push_back( tool );
if( !mSelectedTool )
{
mSelectedTool = tool;
@@ -457,7 +455,7 @@ void LLToolset::selectTool(LLTool* tool)
void LLToolset::selectToolByIndex( S32 index )
{
- LLTool *tool = mToolList.getNthData( index );
+ LLTool *tool = (index >= 0 && index < (S32)mToolList.size()) ? mToolList[index] : NULL;
if (tool)
{
mSelectedTool = tool;
@@ -467,13 +465,14 @@ void LLToolset::selectToolByIndex( S32 index )
BOOL LLToolset::isToolSelected( S32 index )
{
- return (mToolList.getNthData( index ) == mSelectedTool);
+ LLTool *tool = (index >= 0 && index < (S32)mToolList.size()) ? mToolList[index] : NULL;
+ return (tool == mSelectedTool);
}
void LLToolset::selectFirstTool()
{
- mSelectedTool = mToolList.getFirstData();
+ mSelectedTool = (0 < mToolList.size()) ? mToolList[0] : NULL;
if (gToolMgr)
{
gToolMgr->setCurrentTool( mSelectedTool );
@@ -484,43 +483,52 @@ void LLToolset::selectFirstTool()
void LLToolset::selectNextTool()
{
LLTool* next = NULL;
- for( LLTool* cur = mToolList.getFirstData(); cur; cur = mToolList.getNextData() )
+ for( tool_list_t::iterator iter = mToolList.begin();
+ iter != mToolList.end(); )
{
- if( cur == mSelectedTool )
+ LLTool* cur = *iter++;
+ if( cur == mSelectedTool && iter != mToolList.end() )
{
- next = mToolList.getNextData();
+ next = *iter;
break;
}
}
- if( !next )
+ if( next )
{
- next = mToolList.getFirstData();
+ mSelectedTool = next;
+ gToolMgr->setCurrentTool( mSelectedTool );
+ }
+ else
+ {
+ selectFirstTool();
}
-
- mSelectedTool = next;
- gToolMgr->setCurrentTool( mSelectedTool );
}
void LLToolset::selectPrevTool()
{
LLTool* prev = NULL;
- for( LLTool* cur = mToolList.getLastData(); cur; cur = mToolList.getPreviousData() )
+ for( tool_list_t::reverse_iterator iter = mToolList.rbegin();
+ iter != mToolList.rend(); )
{
- if( cur == mSelectedTool )
+ LLTool* cur = *iter++;
+ if( cur == mSelectedTool && iter != mToolList.rend() )
{
- prev = mToolList.getPreviousData();
+ prev = *iter;
break;
}
}
- if( !prev )
+ if( prev )
{
- prev = mToolList.getLastData();
+ mSelectedTool = prev;
+ gToolMgr->setCurrentTool( mSelectedTool );
+ }
+ else if (mToolList.size() > 0)
+ {
+ selectToolByIndex((S32)mToolList.size()-1);
}
- mSelectedTool = prev;
- gToolMgr->setCurrentTool( mSelectedTool );
}
void select_tool( void *tool_pointer )