summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2012-01-04 14:06:36 -0800
committerLeslie Linden <leslie@lindenlab.com>2012-01-04 14:06:36 -0800
commit1c4474f8945316118870d7d8389d6bfb619ad239 (patch)
tree0b9aa54bd789f94c9270600199738e7432366472 /indra/llui
parent912833bafa9a59734432787158e36b66ee9586aa (diff)
parent377a9ab9ac3b098492cbd010f3091c713ac6dc83 (diff)
Merge from viewer-experience
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llmenugl.cpp7
-rw-r--r--indra/llui/llscrolllistcell.cpp10
-rw-r--r--indra/llui/lltextbase.cpp15
-rw-r--r--indra/llui/llview.cpp6
-rw-r--r--indra/llui/llview.h2
5 files changed, 36 insertions, 4 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index cb237fca7c..95ecbb1c94 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -947,9 +947,14 @@ LLMenuItemBranchGL::LLMenuItemBranchGL(const LLMenuItemBranchGL::Params& p)
LLMenuItemBranchGL::~LLMenuItemBranchGL()
{
- delete mBranchHandle.get();
+ if (mBranchHandle.get())
+ {
+ mBranchHandle.get()->die();
+ }
}
+
+
// virtual
LLView* LLMenuItemBranchGL::getChildView(const std::string& name, BOOL recurse) const
{
diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp
index 9d25c7180d..786e18b187 100644
--- a/indra/llui/llscrolllistcell.cpp
+++ b/indra/llui/llscrolllistcell.cpp
@@ -29,6 +29,8 @@
#include "llscrolllistcell.h"
+#include "lltrans.h"
+
#include "llcheckboxctrl.h"
#include "llui.h" // LLUIImage
#include "lluictrlfactory.h"
@@ -428,7 +430,13 @@ LLScrollListDate::LLScrollListDate( const LLScrollListCell::Params& p)
void LLScrollListDate::setValue(const LLSD& value)
{
mDate = value.asDate();
- LLScrollListText::setValue(mDate.asRFC1123());
+
+ std::string date_str = LLTrans::getString("ScrollListCellDateFormat");
+ LLSD substitution;
+ substitution["datetime"] = mDate.secondsSinceEpoch();
+ LLStringUtil::format(date_str, substitution);
+
+ LLScrollListText::setValue(date_str);
}
const LLSD LLScrollListDate::getValue() const
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 1f890b625f..0040be45c7 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1513,6 +1513,8 @@ void LLTextBase::getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg
LLTextBase::segment_set_t::iterator LLTextBase::getEditableSegIterContaining(S32 index)
{
segment_set_t::iterator it = getSegIterContaining(index);
+ segment_set_t::iterator orig_it = it;
+
if (it == mSegments.end()) return it;
if (!(*it)->canEdit()
@@ -1520,13 +1522,18 @@ LLTextBase::segment_set_t::iterator LLTextBase::getEditableSegIterContaining(S32
&& it != mSegments.begin())
{
it--;
+ if ((*it)->canEdit())
+ {
+ return it;
+ }
}
- return it;
+ return orig_it;
}
LLTextBase::segment_set_t::const_iterator LLTextBase::getEditableSegIterContaining(S32 index) const
{
segment_set_t::const_iterator it = getSegIterContaining(index);
+ segment_set_t::const_iterator orig_it = it;
if (it == mSegments.end()) return it;
if (!(*it)->canEdit()
@@ -1534,8 +1541,12 @@ LLTextBase::segment_set_t::const_iterator LLTextBase::getEditableSegIterContaini
&& it != mSegments.begin())
{
it--;
+ if ((*it)->canEdit())
+ {
+ return it;
+ }
}
- return it;
+ return orig_it;
}
LLTextBase::segment_set_t::iterator LLTextBase::getSegIterContaining(S32 index)
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index d2966fbe98..b86d4d0d09 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -121,6 +121,7 @@ LLView::Params::Params()
LLView::LLView(const LLView::Params& p)
: mVisible(p.visible),
+ mInDraw(false),
mName(p.name),
mParentView(NULL),
mReshapeFlags(FOLLOWS_NONE),
@@ -281,6 +282,8 @@ void LLView::moveChildToBackOfTabGroup(LLUICtrl* child)
// virtual
bool LLView::addChild(LLView* child, S32 tab_group)
{
+ llassert_always(mInDraw == false);
+
if (!child)
{
return false;
@@ -330,6 +333,7 @@ bool LLView::addChildInBack(LLView* child, S32 tab_group)
// remove the specified child from the view, and set it's parent to NULL.
void LLView::removeChild(LLView* child)
{
+ llassert_always(mInDraw == false);
//llassert_always(sDepth == 0); // Avoid re-ordering while drawing; it can cause subtle iterator bugs
if (child->mParentView == this)
{
@@ -1081,6 +1085,7 @@ void LLView::draw()
void LLView::drawChildren()
{
+ mInDraw = true;
if (!mChildList.empty())
{
LLView* rootp = LLUI::getRootView();
@@ -1124,6 +1129,7 @@ void LLView::drawChildren()
}
--sDepth;
}
+ mInDraw = false;
}
void LLView::dirtyRect()
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index f21fb37e18..f1fac5f69c 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -612,6 +612,8 @@ private:
S32 mNextInsertionOrdinal;
+ bool mInDraw;
+
static LLWindow* sWindow; // All root views must know about their window.
typedef std::map<std::string, LLView*> default_widget_map_t;