diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2019-04-26 11:17:53 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2019-04-26 11:17:53 -0400 |
commit | 0d596aa4de2f583862274350ce6287c0ed8c2bec (patch) | |
tree | 90a6ca5b29d5c99b585233d059e16dccc23a2e19 /indra/llui/llcombobox.cpp | |
parent | 70aa89f708254c47766f4629e9131ea492829129 (diff) | |
parent | 85b431d5137886927efef35ca558bc8a998a5212 (diff) |
Automated merge with file:///Users/nat/linden/viewer-gridselect
Diffstat (limited to 'indra/llui/llcombobox.cpp')
-rw-r--r-- | indra/llui/llcombobox.cpp | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 00a933a0bb..b2ad38bddf 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -243,7 +243,14 @@ LLScrollListItem* LLComboBox::add(const std::string& name, EAddPosition pos, BOO item->setEnabled(enabled); if (!mAllowTextEntry && mLabel.empty()) { - selectFirstItem(); + if (mControlVariable) + { + setValue(mControlVariable->getValue()); // selects the appropriate item + } + else + { + selectFirstItem(); + } } return item; } @@ -255,7 +262,14 @@ LLScrollListItem* LLComboBox::add(const std::string& name, const LLUUID& id, EAd item->setEnabled(enabled); if (!mAllowTextEntry && mLabel.empty()) { - selectFirstItem(); + if (mControlVariable) + { + setValue(mControlVariable->getValue()); // selects the appropriate item + } + else + { + selectFirstItem(); + } } return item; } @@ -268,7 +282,14 @@ LLScrollListItem* LLComboBox::add(const std::string& name, void* userdata, EAddP item->setUserdata( userdata ); if (!mAllowTextEntry && mLabel.empty()) { - selectFirstItem(); + if (mControlVariable) + { + setValue(mControlVariable->getValue()); // selects the appropriate item + } + else + { + selectFirstItem(); + } } return item; } @@ -280,7 +301,14 @@ LLScrollListItem* LLComboBox::add(const std::string& name, LLSD value, EAddPosit item->setEnabled(enabled); if (!mAllowTextEntry && mLabel.empty()) { - selectFirstItem(); + if (mControlVariable) + { + setValue(mControlVariable->getValue()); // selects the appropriate item + } + else + { + selectFirstItem(); + } } return item; } |