summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-04-24 19:28:15 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-04-24 19:28:15 +0300
commit85f2447b3ddf7e4b91cd5963cb2e7668d48ab2a9 (patch)
tree494487bbc57c79d17921b7443003d2a118e24ddb /indra/llui
parent398369233fc2621eb447701e26082057fb0c97d7 (diff)
parentd98fc504a1d4bc292ba86acdda053c8b4598a193 (diff)
Merge branch 'main' into marchcat/a-merge
# Conflicts: # autobuild.xml # indra/llimage/llimage.cpp # indra/llui/llsearcheditor.cpp # indra/llui/llview.cpp # indra/newview/llagent.cpp # indra/newview/llappviewer.cpp # indra/newview/llfloatercamera.cpp # indra/newview/llfloatereditsky.cpp # indra/newview/llfloatereditwater.cpp # indra/newview/llinventoryfunctions.cpp # indra/newview/lloutfitgallery.cpp # indra/newview/lloutfitslist.cpp # indra/newview/llpanelgroupbulkban.cpp # indra/newview/llsidepanelappearance.cpp # indra/newview/llvovolume.cpp
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llcommandmanager.cpp4
-rw-r--r--indra/llui/llfiltereditor.h1
-rw-r--r--indra/llui/llfloater.cpp10
-rw-r--r--indra/llui/lllayoutstack.cpp41
-rw-r--r--indra/llui/llloadingindicator.cpp3
-rw-r--r--indra/llui/llmenugl.cpp3
-rw-r--r--indra/llui/llnotifications.cpp58
-rw-r--r--indra/llui/llnotifications.h38
-rw-r--r--indra/llui/llnotificationslistener.cpp11
-rw-r--r--indra/llui/llsearcheditor.cpp5
-rw-r--r--indra/llui/lltoolbar.cpp13
-rw-r--r--indra/llui/lltooltip.cpp10
-rw-r--r--indra/llui/lluicolortable.cpp3
-rw-r--r--indra/llui/llview.cpp28
-rw-r--r--indra/llui/llview.h3
15 files changed, 123 insertions, 108 deletions
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index 3e159365e5..8ef7bd837f 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -34,8 +34,6 @@
#include "llerror.h"
#include "llxuiparser.h"
-#include <boost/foreach.hpp>
-
//
// LLCommandId class
@@ -182,7 +180,7 @@ bool LLCommandManager::load()
return false;
}
- BOOST_FOREACH(LLCommand::Params& commandParams, commandsParams.commands)
+ for (const LLCommand::Params& commandParams : commandsParams.commands)
{
LLCommand * command = new LLCommand(commandParams);
diff --git a/indra/llui/llfiltereditor.h b/indra/llui/llfiltereditor.h
index 3a05bc05a1..52cad3bff4 100644
--- a/indra/llui/llfiltereditor.h
+++ b/indra/llui/llfiltereditor.h
@@ -43,6 +43,7 @@ class LLFilterEditor : public LLSearchEditor
public:
struct Params : public LLInitParam::Block<Params, LLSearchEditor::Params>
{};
+ virtual ~LLFilterEditor() {}
protected:
LLFilterEditor(const Params&);
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index ccd60dc536..25006abf2c 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -59,7 +59,6 @@
#include "llmultifloater.h"
#include "llsdutil.h"
#include "lluiusage.h"
-#include <boost/foreach.hpp>
// use this to control "jumping" behavior when Ctrl-Tabbing
@@ -1849,6 +1848,8 @@ void LLFloater::onClickTearOff(LLFloater* self)
{
if (self->mSaveRect)
{
+ LLRect screen_rect = self->calcScreenRect();
+ self->mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert();
self->storeRectControl();
}
self->setMinimized(false); // to reenable minimize button if it was minimized
@@ -2461,7 +2462,7 @@ void LLFloaterView::reshape(S32 width, S32 height, bool called_from_parent)
//{
// floaterp->translate(translate_x, translate_y);
//}
- BOOST_FOREACH(LLHandle<LLFloater> dependent_floater, floaterp->mDependents)
+ for (LLHandle<LLFloater> dependent_floater : floaterp->mDependents)
{
if (dependent_floater.get())
{
@@ -2476,10 +2477,9 @@ void LLFloaterView::reshape(S32 width, S32 height, bool called_from_parent)
void LLFloaterView::restoreAll()
{
// make sure all subwindows aren't minimized
- child_list_t child_list = *(getChildList());
- for (child_list_const_iter_t child_it = child_list.begin(); child_it != child_list.end(); ++child_it)
+ for (auto child : *getChildList())
{
- LLFloater* floaterp = dynamic_cast<LLFloater*>(*child_it);
+ LLFloater* floaterp = dynamic_cast<LLFloater*>(child);
if (floaterp)
{
floaterp->setMinimized(false);
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 2db0101769..7c834e0127 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -395,8 +395,7 @@ void LLLayoutStack::updateLayout()
: getRect().getHeight();
// first, assign minimum dimensions
- LLLayoutPanel* panelp = NULL;
- BOOST_FOREACH(panelp, mPanels)
+ for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -409,12 +408,15 @@ void LLLayoutStack::updateLayout()
llassert(total_visible_fraction < 1.05f);
// don't need spacing after last panel
- space_to_distribute += panelp ? ll_round((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
+ if (!mPanels.empty())
+ {
+ space_to_distribute += ll_round(F32(mPanelSpacing) * mPanels.back()->getVisibleAmount());
+ }
S32 remaining_space = space_to_distribute;
if (space_to_distribute > 0 && total_visible_fraction > 0.f)
{ // give space proportionally to visible auto resize panels
- BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+ for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -427,7 +429,7 @@ void LLLayoutStack::updateLayout()
}
// distribute any left over pixels to non-collapsed, visible panels
- BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+ for (LLLayoutPanel* panelp : mPanels)
{
if (remaining_space == 0) break;
@@ -443,7 +445,7 @@ void LLLayoutStack::updateLayout()
F32 cur_pos = (mOrientation == HORIZONTAL) ? 0.f : (F32)getRect().getHeight();
- BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+ for (LLLayoutPanel* panelp : mPanels)
{
F32 panel_dim = llmax(panelp->getExpandedMinDim(), panelp->mTargetDim);
@@ -538,7 +540,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const
{
if (!panelp) return NULL;
- BOOST_FOREACH(LLLayoutPanel* p, mPanels)
+ for (LLLayoutPanel* p : mPanels)
{
if (p == panelp)
{
@@ -552,7 +554,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) c
{
LLLayoutPanel* result = NULL;
- BOOST_FOREACH(LLLayoutPanel* p, mPanels)
+ for (LLLayoutPanel* p : mPanels)
{
if (p->getName() == name)
{
@@ -566,7 +568,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) c
void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp)
{
- BOOST_FOREACH(LLLayoutPanel* lp, mPanels)
+ for (LLLayoutPanel* lp : mPanels)
{
if (lp->mResizeBar == NULL)
{
@@ -669,7 +671,7 @@ void LLLayoutStack::updateFractionalSizes()
{
F32 total_resizable_dim = 0.f;
- BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+ for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -677,7 +679,7 @@ void LLLayoutStack::updateFractionalSizes()
}
}
- BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+ for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -698,7 +700,7 @@ void LLLayoutStack::normalizeFractionalSizes()
S32 num_auto_resize_panels = 0;
F32 total_fractional_size = 0.f;
- BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+ for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -709,7 +711,7 @@ void LLLayoutStack::normalizeFractionalSizes()
if (total_fractional_size == 0.f)
{ // equal distribution
- BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+ for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -719,7 +721,7 @@ void LLLayoutStack::normalizeFractionalSizes()
}
else
{ // renormalize
- BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+ for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -736,7 +738,7 @@ bool LLLayoutStack::animatePanels()
//
// animate visibility
//
- BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+ for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->getVisible())
{
@@ -834,7 +836,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
LLLayoutPanel* other_resize_panel = NULL;
LLLayoutPanel* following_panel = NULL;
- BOOST_REVERSE_FOREACH(LLLayoutPanel* panelp, mPanels)
+ BOOST_REVERSE_FOREACH(LLLayoutPanel* panelp, mPanels) // Should replace this when C++20 reverse view adaptor becomes available...
{
if (panelp->mAutoResize)
{
@@ -883,7 +885,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
AFTER_RESIZED_PANEL
} which_panel = BEFORE_RESIZED_PANEL;
- BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+ for (LLLayoutPanel* panelp : mPanels)
{
if (!panelp->getVisible() || panelp->mCollapsed)
{
@@ -974,6 +976,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
MIN_FRACTIONAL_SIZE,
MAX_FRACTIONAL_SIZE);
}
+ break;
default:
break;
}
@@ -990,8 +993,8 @@ void LLLayoutStack::reshape(S32 width, S32 height, bool called_from_parent)
void LLLayoutStack::updateResizeBarLimits()
{
- LLLayoutPanel* previous_visible_panelp = NULL;
- BOOST_REVERSE_FOREACH(LLLayoutPanel* visible_panelp, mPanels)
+ LLLayoutPanel* previous_visible_panelp{ nullptr };
+ BOOST_REVERSE_FOREACH(LLLayoutPanel* visible_panelp, mPanels) // Should replace this when C++20 reverse view adaptor becomes available...
{
if (!visible_panelp->getVisible() || visible_panelp->mCollapsed)
{
diff --git a/indra/llui/llloadingindicator.cpp b/indra/llui/llloadingindicator.cpp
index 1ede5b706f..e8b6b7e43b 100644
--- a/indra/llui/llloadingindicator.cpp
+++ b/indra/llui/llloadingindicator.cpp
@@ -34,7 +34,6 @@
// Project includes
#include "lluictrlfactory.h"
#include "lluiimage.h"
-#include "boost/foreach.hpp"
// registered in llui.cpp to avoid being left out by MS linker
//static LLDefaultChildRegistry::Register<LLLoadingIndicator> r("loading_indicator");
@@ -52,7 +51,7 @@ LLLoadingIndicator::LLLoadingIndicator(const Params& p)
void LLLoadingIndicator::initFromParams(const Params& p)
{
- BOOST_FOREACH(LLUIImage* image, p.images().image)
+ for (LLUIImage* image : p.images().image)
{
mImages.push_back(image);
}
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 79a8bc5ba4..25f32d9671 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -60,7 +60,6 @@
#include "v2math.h"
#include <set>
#include <boost/tokenizer.hpp>
-#include <boost/foreach.hpp>
// static
LLMenuHolderGL *LLMenuGL::sMenuContainer = NULL;
@@ -2162,7 +2161,7 @@ void LLMenuGL::arrange( void )
}
else
{
- BOOST_FOREACH(LLMenuItemGL* itemp, mItems)
+ for (LLMenuItemGL* itemp : mItems)
{
// do first so LLMenuGLItemCall can call on_visible to determine if visible
itemp->buildDrawLabel();
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 8185f2d597..9ba8e9e645 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -45,7 +45,6 @@
#include <algorithm>
#include <boost/regex.hpp>
-#include <boost/foreach.hpp>
const std::string NOTIFICATION_PERSIST_VERSION = "0.93";
@@ -444,14 +443,14 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
mSoundName = p.sound;
}
- BOOST_FOREACH(const LLNotificationTemplate::UniquenessContext& context, p.unique.contexts)
+ for (const LLNotificationTemplate::UniquenessContext& context : p.unique.contexts)
{
mUniqueContext.push_back(context.value);
}
LL_DEBUGS("Notifications") << "notification \"" << mName << "\": tag count is " << p.tags.size() << LL_ENDL;
- BOOST_FOREACH(const LLNotificationTemplate::Tag& tag, p.tags)
+ for (const LLNotificationTemplate::Tag& tag : p.tags)
{
LL_DEBUGS("Notifications") << " tag \"" << std::string(tag.value) << "\"" << LL_ENDL;
mTags.push_back(tag.value);
@@ -994,6 +993,7 @@ LLBoundListener LLNotificationChannelBase::connectChangedImpl(const LLEventListe
// all of the notifications that are already in the channel
// we use a special signal called "load" in case the channel wants to care
// only about new notifications
+ LLMutexLock lock(&mItemsMutex);
for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it)
{
slot(LLSD().with("sigtype", "load").with("id", (*it)->id()));
@@ -1153,7 +1153,7 @@ LLNotificationChannel::LLNotificationChannel(const Params& p)
LLInstanceTracker<LLNotificationChannel, std::string>(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()),
mName(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString())
{
- BOOST_FOREACH(const std::string& source, p.sources)
+ for (const std::string& source : p.sources)
{
connectToChannel(source);
}
@@ -1171,29 +1171,33 @@ LLNotificationChannel::LLNotificationChannel(const std::string& name,
connectToChannel(parent);
}
-bool LLNotificationChannel::isEmpty() const
+LLNotificationChannel::~LLNotificationChannel()
{
- return mItems.empty();
+ for (LLBoundListener &listener : mListeners)
+ {
+ listener.disconnect();
+ }
}
-S32 LLNotificationChannel::size() const
+bool LLNotificationChannel::isEmpty() const
{
- return mItems.size();
+ return mItems.empty();
}
-LLNotificationChannel::Iterator LLNotificationChannel::begin()
+S32 LLNotificationChannel::size() const
{
- return mItems.begin();
+ return mItems.size();
}
-LLNotificationChannel::Iterator LLNotificationChannel::end()
+size_t LLNotificationChannel::size()
{
- return mItems.end();
+ return mItems.size();
}
-size_t LLNotificationChannel::size()
+void LLNotificationChannel::forEachNotification(NotificationProcess process)
{
- return mItems.size();
+ LLMutexLock lock(&mItemsMutex);
+ std::for_each(mItems.begin(), mItems.end(), process);
}
std::string LLNotificationChannel::summarize()
@@ -1201,7 +1205,8 @@ std::string LLNotificationChannel::summarize()
std::string s("Channel '");
s += mName;
s += "'\n ";
- for (LLNotificationChannel::Iterator it = begin(); it != end(); ++it)
+ LLMutexLock lock(&mItemsMutex);
+ for (LLNotificationChannel::Iterator it = mItems.begin(); it != mItems.end(); ++it)
{
s += (*it)->summarize();
s += "\n ";
@@ -1213,14 +1218,14 @@ void LLNotificationChannel::connectToChannel( const std::string& channel_name )
{
if (channel_name.empty())
{
- LLNotifications::instance().connectChanged(
- boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
+ mListeners.push_back(LLNotifications::instance().connectChanged(
+ boost::bind(&LLNotificationChannelBase::updateItem, this, _1)));
}
else
{
mParents.push_back(channel_name);
LLNotificationChannelPtr p = LLNotifications::instance().getChannel(channel_name);
- p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
+ mListeners.push_back(p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1)));
}
}
@@ -1521,7 +1526,7 @@ void replaceFormText(LLNotificationForm::Params& form, const std::string& patter
form.ignore.text = replace;
}
- BOOST_FOREACH(LLNotificationForm::FormElement& element, form.form_elements.elements)
+ for (LLNotificationForm::FormElement& element : form.form_elements.elements)
{
if (element.button.isChosen() && element.button.text() == pattern)
{
@@ -1571,19 +1576,19 @@ bool LLNotifications::loadTemplates()
mTemplates.clear();
- BOOST_FOREACH(LLNotificationTemplate::GlobalString& string, params.strings)
+ for (const LLNotificationTemplate::GlobalString& string : params.strings)
{
mGlobalStrings[string.name] = string.value;
}
std::map<std::string, LLNotificationForm::Params> form_templates;
- BOOST_FOREACH(LLNotificationTemplate::Template& notification_template, params.templates)
+ for (const LLNotificationTemplate::Template& notification_template : params.templates)
{
form_templates[notification_template.name] = notification_template.form;
}
- BOOST_FOREACH(LLNotificationTemplate::Params& notification, params.notifications)
+ for (LLNotificationTemplate::Params& notification : params.notifications)
{
if (notification.form_ref.form_template.isChosen())
{
@@ -1638,7 +1643,7 @@ bool LLNotifications::loadVisibilityRules()
mVisibilityRules.clear();
- BOOST_FOREACH(LLNotificationVisibilityRule::Rule& rule, params.rules)
+ for (const LLNotificationVisibilityRule::Rule& rule : params.rules)
{
mVisibilityRules.push_back(LLNotificationVisibilityRulePtr(new LLNotificationVisibilityRule(rule)));
}
@@ -1731,6 +1736,7 @@ void LLNotifications::cancel(LLNotificationPtr pNotif)
void LLNotifications::cancelByName(const std::string& name)
{
+ LLMutexLock lock(&mItemsMutex);
std::vector<LLNotificationPtr> notifs_to_cancel;
for (LLNotificationSet::iterator it=mItems.begin(), end_it = mItems.end();
it != end_it;
@@ -1755,6 +1761,7 @@ void LLNotifications::cancelByName(const std::string& name)
void LLNotifications::cancelByOwner(const LLUUID ownerId)
{
+ LLMutexLock lock(&mItemsMutex);
std::vector<LLNotificationPtr> notifs_to_cancel;
for (LLNotificationSet::iterator it = mItems.begin(), end_it = mItems.end();
it != end_it;
@@ -1802,11 +1809,6 @@ LLNotificationPtr LLNotifications::find(LLUUID uuid)
}
}
-void LLNotifications::forEachNotification(NotificationProcess process)
-{
- std::for_each(mItems.begin(), mItems.end(), process);
-}
-
std::string LLNotifications::getGlobalString(const std::string& key) const
{
GlobalStringMap::const_iterator it = mGlobalStrings.find(key);
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 5fb18d8299..ccc8a42a6c 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -738,16 +738,19 @@ class LLNotificationChannelBase :
{
LOG_CLASS(LLNotificationChannelBase);
public:
- LLNotificationChannelBase(LLNotificationFilter filter)
- : mFilter(filter),
- mItems()
- {}
+ LLNotificationChannelBase(LLNotificationFilter filter)
+ : mFilter(filter)
+ , mItems()
+ , mItemsMutex()
+ {}
+
virtual ~LLNotificationChannelBase()
{
// explicit cleanup for easier issue detection
mChanged.disconnect_all_slots();
mPassedFilter.disconnect_all_slots();
mFailedFilter.disconnect_all_slots();
+ LLMutexLock lock(&mItemsMutex);
mItems.clear();
}
// you can also connect to a Channel, so you can be notified of
@@ -786,6 +789,7 @@ protected:
LLStandardSignal mChanged;
LLStandardSignal mPassedFilter;
LLStandardSignal mFailedFilter;
+ LLMutex mItemsMutex;
// these are action methods that subclasses can override to take action
// on specific types of changes; the management of the mItems list is
@@ -835,7 +839,7 @@ public:
LLNotificationChannel(const Params& p = Params());
LLNotificationChannel(const std::string& name, const std::string& parent, LLNotificationFilter filter);
- virtual ~LLNotificationChannel() {}
+ virtual ~LLNotificationChannel();
typedef LLNotificationSet::iterator Iterator;
std::string getName() const { return mName; }
@@ -844,21 +848,23 @@ public:
{
return boost::iterator_range<parents_iter>(mParents);
}
-
- void connectToChannel(const std::string& channel_name);
-
+
bool isEmpty() const;
S32 size() const;
-
- Iterator begin();
- Iterator end();
- size_t size();
-
+ size_t size();
+
+ typedef boost::function<void(LLNotificationPtr)> NotificationProcess;
+ void forEachNotification(NotificationProcess process);
+
std::string summarize();
+protected:
+ void connectToChannel(const std::string& channel_name);
+
private:
std::string mName;
std::vector<std::string> mParents;
+ std::vector<LLBoundListener> mListeners;
};
// An interface class to provide a clean linker seam to the LLNotifications class.
@@ -924,10 +930,6 @@ public:
void update(const LLNotificationPtr pNotif);
LLNotificationPtr find(LLUUID uuid);
-
- typedef boost::function<void (LLNotificationPtr)> NotificationProcess;
-
- void forEachNotification(NotificationProcess process);
// This is all stuff for managing the templates
// take your template out
@@ -990,7 +992,7 @@ private:
bool mIgnoreAllNotifications;
- boost::scoped_ptr<LLNotificationsListener> mListener;
+ std::unique_ptr<LLNotificationsListener> mListener;
std::vector<LLNotificationChannelPtr> mDefaultChannels;
};
diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp
index e73ba1fbe9..859222f907 100644
--- a/indra/llui/llnotificationslistener.cpp
+++ b/indra/llui/llnotificationslistener.cpp
@@ -32,7 +32,6 @@
#include "llnotificationtemplate.h"
#include "llsd.h"
#include "llui.h"
-#include <boost/foreach.hpp>
LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) :
LLEventAPI("LLNotifications",
@@ -149,11 +148,11 @@ void LLNotificationsListener::listChannelNotifications(const LLSD& params) const
if (channel)
{
LLSD notifications(LLSD::emptyArray());
- for (LLNotificationChannel::Iterator ni(channel->begin()), nend(channel->end());
- ni != nend; ++ni)
- {
- notifications.append(asLLSD(*ni));
- }
+ std::function<void(LLNotificationPtr)> func = [notifications](LLNotificationPtr ni) mutable
+ {
+ notifications.append(asLLSD(ni));
+ };
+ channel->forEachNotification(func);
response["notifications"] = notifications;
}
LLEventPumps::instance().obtain(params["reply"]).post(response);
diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp
index 6da0c69457..46fb8c64b5 100644
--- a/indra/llui/llsearcheditor.cpp
+++ b/indra/llui/llsearcheditor.cpp
@@ -109,6 +109,11 @@ LLSearchEditor::~LLSearchEditor()
mKeystrokeCallback = NULL;
mTextChangedCallback = NULL;
setCommitOnFocusLost(false);
+
+ mSearchButton = NULL;
+ mClearButton = NULL;
+ mSearchEditor->deleteAllChildren();
+ deleteAllChildren();
}
//virtual
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 580d91fb4b..4e961a0a18 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -27,7 +27,6 @@
#include "linden_common.h"
-#include <boost/foreach.hpp>
#include "lltoolbar.h"
#include "llcommandmanager.h"
@@ -219,7 +218,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p)
mCenteringStack->addChild(LLUICtrlFactory::create<LLLayoutPanel>(border_panel_p));
- BOOST_FOREACH(LLCommandId id, p.commands)
+ for (const auto& id : p.commands)
{
addCommand(id);
}
@@ -417,7 +416,7 @@ bool LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask)
// Determine which button the mouse was over during the click in case the context menu action
// is intended to affect the button.
mRightMouseTargetButton = NULL;
- BOOST_FOREACH(LLToolBarButton* button, mButtons)
+ for (LLToolBarButton* button : mButtons)
{
LLRect button_rect;
button->localRectToOtherView(button->getLocalRect(), &button_rect, this);
@@ -505,7 +504,7 @@ void LLToolBar::setButtonType(LLToolBarEnums::ButtonType button_type)
void LLToolBar::resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row, S32 max_row_girth)
{
// make buttons in current row all same girth
- BOOST_FOREACH(LLToolBarButton* button, buttons_in_row)
+ for (LLToolBarButton* button : buttons_in_row)
{
if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL)
{
@@ -693,7 +692,7 @@ void LLToolBar::updateLayoutAsNeeded()
std::vector<LLToolBarButton*> buttons_in_row;
- BOOST_FOREACH(LLToolBarButton* button, mButtons)
+ for (LLToolBarButton* button : mButtons)
{
button->reshape(button->mWidthRange.getMin(), button->mDesiredHeight);
button->autoResize();
@@ -878,7 +877,7 @@ void LLToolBar::createButtons()
{
std::set<LLUUID> set_flashing;
- BOOST_FOREACH(LLToolBarButton* button, mButtons)
+ for (LLToolBarButton* button : mButtons)
{
if (button->getFlashTimer() && button->getFlashTimer()->isFlashingInProgress())
{
@@ -896,7 +895,7 @@ void LLToolBar::createButtons()
mButtonMap.clear();
mRightMouseTargetButton = NULL;
- BOOST_FOREACH(LLCommandId& command_id, mButtonCommands)
+ for (const LLCommandId& command_id : mButtonCommands)
{
LLToolBarButton* button = createButton(command_id);
mButtons.push_back(button);
diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp
index 4df2c0cb6d..4c138eff65 100644
--- a/indra/llui/lltooltip.cpp
+++ b/indra/llui/lltooltip.cpp
@@ -444,7 +444,13 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params)
tooltip_params.rect = LLRect (0, 1, 1, 0);
if (tooltip_params.create_callback.isProvided())
- mToolTip = tooltip_params.create_callback()(tooltip_params);
+ {
+ mToolTip = tooltip_params.create_callback()(tooltip_params);
+ if (mToolTip == NULL)
+ {
+ return;
+ }
+ }
else
mToolTip = LLUICtrlFactory::create<LLToolTip> (tooltip_params);
@@ -496,7 +502,7 @@ void LLToolTipMgr::show(const LLToolTip::Params& params)
{
if (!params.styled_message.isProvided()
&& (!params.message.isProvided() || params.message().empty())
- && !params.image.isProvided()) return;
+ && !params.image.isProvided() && !params.create_callback.isProvided()) return;
// fill in default tooltip params from tool_tip.xml
LLToolTip::Params params_with_defaults(params);
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index 096336045c..f43bdf1fdc 100644
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -32,7 +32,6 @@
#include "llui.h"
#include "lluicolortable.h"
#include "lluictrlfactory.h"
-#include <boost/foreach.hpp>
LLUIColorTable::ColorParams::ColorParams()
: value("value"),
@@ -208,7 +207,7 @@ bool LLUIColorTable::loadFromSettings()
// pass constraint=LLDir::ALL_SKINS because we want colors.xml from every
// skin dir
- BOOST_FOREACH(std::string colors_path,
+ for (const std::string& colors_path :
gDirUtilp->findSkinnedFilenames(LLDir::SKINBASE, "colors.xml", LLDir::ALL_SKINS))
{
result |= loadFromFilename(colors_path, mLoadedColors);
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index f3ef7591e9..57c635b019 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -32,7 +32,6 @@
#include <sstream>
#include <boost/tokenizer.hpp>
-#include <boost/foreach.hpp>
#include <boost/bind.hpp>
#include "llrender.h"
@@ -61,6 +60,7 @@ static const S32 LINE_HEIGHT = 15;
S32 LLView::sDepth = 0;
bool LLView::sDebugRects = false;
bool LLView::sDebugUnicode = false;
+bool LLView::sDebugCamera = false;
bool LLView::sIsRectDirty = false;
LLRect LLView::sDirtyRect;
bool LLView::sDebugRectsShowNames = true;
@@ -593,7 +593,7 @@ void LLView::deleteAllChildren()
void LLView::setAllChildrenEnabled(bool b)
{
- BOOST_FOREACH(LLView* viewp, mChildList)
+ for (LLView* viewp : mChildList)
{
viewp->setEnabled(b);
}
@@ -622,7 +622,7 @@ void LLView::onVisibilityChange ( bool new_visibility )
{
bool old_visibility;
bool log_visibility_change = LLViewerEventRecorder::instance().getLoggingStatus();
- BOOST_FOREACH(LLView* viewp, mChildList)
+ for (LLView* viewp : mChildList)
{
if (!viewp)
{
@@ -726,7 +726,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m
{
if ( getVisible() && getEnabled() )
{
- BOOST_FOREACH(LLView* viewp, mChildList)
+ for (LLView* viewp : mChildList)
{
if ((viewp->*method)(c, mask, true))
{
@@ -745,7 +745,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m
template <typename METHOD, typename XDATA>
LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra, bool allow_mouse_block)
{
- BOOST_FOREACH(LLView* viewp, mChildList)
+ for (LLView* viewp : mChildList)
{
S32 local_x = x - viewp->getRect().mLeft;
S32 local_y = y - viewp->getRect().mBottom;
@@ -774,7 +774,7 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA
LLView* LLView::childrenHandleToolTip(S32 x, S32 y, MASK mask)
{
- BOOST_FOREACH(LLView* viewp, mChildList)
+ for (LLView* viewp : mChildList)
{
S32 local_x = x - viewp->getRect().mLeft;
S32 local_y = y - viewp->getRect().mBottom;
@@ -806,7 +806,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask,
// default to not accepting drag and drop, will be overridden by handler
*accept = ACCEPT_NO;
- BOOST_FOREACH(LLView* viewp, mChildList)
+ for (LLView* viewp : mChildList)
{
S32 local_x = x - viewp->getRect().mLeft;
S32 local_y = y - viewp->getRect().mBottom;
@@ -832,7 +832,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask,
LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask)
{
- BOOST_FOREACH(LLView* viewp, mChildList)
+ for (LLView* viewp : mChildList)
{
S32 local_x = x - viewp->getRect().mLeft;
S32 local_y = y - viewp->getRect().mBottom;
@@ -860,7 +860,7 @@ LLView* LLView::childFromPoint(S32 x, S32 y, bool recur)
if (!getVisible())
return NULL;
- BOOST_FOREACH(LLView* viewp, mChildList)
+ for (LLView* viewp : mChildList)
{
S32 local_x = x - viewp->getRect().mLeft;
S32 local_y = y - viewp->getRect().mBottom;
@@ -1379,7 +1379,7 @@ void LLView::reshape(S32 width, S32 height, bool called_from_parent)
mRect.mTop = getRect().mBottom + height;
// move child views according to reshape flags
- BOOST_FOREACH(LLView* viewp, mChildList)
+ for (LLView* viewp : mChildList)
{
if (viewp != NULL)
{
@@ -1451,7 +1451,7 @@ LLRect LLView::calcBoundingRect()
{
LLRect local_bounding_rect = LLRect::null;
- BOOST_FOREACH(LLView* childp, mChildList)
+ for (LLView* childp : mChildList)
{
// ignore invisible and "top" children when calculating bounding rect
// such as combobox popups
@@ -1614,7 +1614,7 @@ LLView* LLView::findChildView(const std::string& name, bool recurse) const
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
// Look for direct children *first*
- BOOST_FOREACH(LLView* childp, mChildList)
+ for (LLView* childp : mChildList)
{
llassert(childp);
if (childp->getName() == name)
@@ -1625,7 +1625,7 @@ LLView* LLView::findChildView(const std::string& name, bool recurse) const
if (recurse)
{
// Look inside each child as well.
- BOOST_FOREACH(LLView* childp, mChildList)
+ for (LLView* childp : mChildList)
{
llassert(childp);
LLView* viewp = childp->findChildView(name, recurse);
@@ -2809,7 +2809,7 @@ S32 LLView::notifyParent(const LLSD& info)
bool LLView::notifyChildren(const LLSD& info)
{
bool ret = false;
- BOOST_FOREACH(LLView* childp, mChildList)
+ for (LLView* childp : mChildList)
{
ret = ret || childp->notifyChildren(info);
}
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 1e35f0092d..dcc77a79d1 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -662,6 +662,9 @@ public:
// Show hexadecimal byte values of unicode symbols in a tooltip
static bool sDebugUnicode;
+ // Show camera position and direction in Camera Controls floater
+ static bool sDebugCamera;
+
static bool sIsRectDirty;
static LLRect sDirtyRect;