summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-10-14 16:47:43 -0700
committerMerov Linden <merov@lindenlab.com>2011-10-14 16:47:43 -0700
commit4c6f04c50225a4a5494974c3a6e13bee76cfbb6f (patch)
tree5e0356c0fd66837582a3f01f71e65e004c2db84d /indra/newview
parent93ed1489a5da6781c6bdd5ee2263e6b6147835c8 (diff)
EXP-1363 : Fix caret position in multiple lines or columns situation
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lltoolbarview.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index b43c4e80fa..21e682f072 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -416,24 +416,30 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t
// Suppress the command from the toolbars (including the one it's dropped in,
// this will handle move position).
int old_rank = LLToolBar::RANK_NONE;
+ LLToolBar* old_toolbar = NULL;
int rank;
if ((rank = gToolBarView->mToolbarLeft->removeCommand(command_id)) != LLToolBar::RANK_NONE)
{
old_rank = rank;
+ old_toolbar = gToolBarView->mToolbarLeft;
}
if ((rank = gToolBarView->mToolbarRight->removeCommand(command_id)) != LLToolBar::RANK_NONE)
{
old_rank = rank;
+ old_toolbar = gToolBarView->mToolbarRight;
}
if ((rank = gToolBarView->mToolbarBottom->removeCommand(command_id)) != LLToolBar::RANK_NONE)
{
old_rank = rank;
+ old_toolbar = gToolBarView->mToolbarBottom;
}
// Now insert it in the toolbar at the detected rank
if (!toolbar->isReadOnly())
{
- if ((old_rank != LLToolBar::RANK_NONE) && (old_rank < new_rank))
+ if ((old_toolbar == toolbar) && (old_rank != LLToolBar::RANK_NONE) && (old_rank < new_rank))
{
+ // If we just removed the command from the same toolbar, we need to consider that it might
+ // change the target rank.
new_rank -= 1;
}
toolbar->addCommand(command->id(),new_rank);