summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/CMakeLists.txt18
-rw-r--r--indra/llui/llflatlistview.cpp3
-rw-r--r--indra/llui/llflatlistview.h3
-rw-r--r--indra/llui/lllineeditor.cpp6
-rw-r--r--indra/llui/lltextbase.cpp41
-rw-r--r--indra/llui/llview.cpp14
-rw-r--r--indra/llui/llview.h8
7 files changed, 55 insertions, 38 deletions
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt
index 864f3f699e..761e4b67b3 100644
--- a/indra/llui/CMakeLists.txt
+++ b/indra/llui/CMakeLists.txt
@@ -242,12 +242,12 @@ target_link_libraries(llui
${LLCOMMON_LIBRARIES} # must be after llimage, llwindow, llrender
)
-if(LL_TESTS)
- # Add tests
- include(LLAddBuildTest)
- SET(llui_TEST_SOURCE_FILES
- llurlmatch.cpp
- llurlentry.cpp
- )
- LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}")
-endif(LL_TESTS)
+# Add tests
+if (LL_TESTS)
+ include(LLAddBuildTest)
+ SET(llui_TEST_SOURCE_FILES
+ llurlmatch.cpp
+ llurlentry.cpp
+ )
+ LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}")
+endif (LL_TESTS) \ No newline at end of file
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index c57c02f4b1..97a52fada4 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -87,9 +87,6 @@ bool LLFlatListView::addItem(LLPanel * item, const LLSD& value /*= LLUUID::null*
mItemsPanel->addChild(item);
break;
default:
- LL_WARNS("") << "Unsupported position." << LL_ENDL;
- delete new_pair;
- return false;
break;
}
diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h
index 0515853698..92bf429031 100644
--- a/indra/llui/llflatlistview.h
+++ b/indra/llui/llflatlistview.h
@@ -450,8 +450,9 @@ private:
*/
class LLFlatListViewEx : public LLFlatListView
{
- LOG_CLASS(LLFlatListViewEx);
public:
+ LOG_CLASS(LLFlatListViewEx);
+
struct Params : public LLInitParam::Block<Params, LLFlatListView::Params>
{
/**
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index aed391c780..4064b7cc84 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -388,7 +388,11 @@ void LLLineEditor::setText(const LLStringExplicit &new_text)
setCursor(llmin((S32)mText.length(), getCursor()));
// Set current history line to end of history.
- if(mLineHistory.end() != mLineHistory.begin())
+ if (mLineHistory.empty())
+ {
+ mCurrentHistoryLine = mLineHistory.end();
+ }
+ else
{
mCurrentHistoryLine = mLineHistory.end() - 1;
}
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 49537ef78f..333513d7d7 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1634,6 +1634,9 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
while ( LLUrlRegistry::instance().findUrl(text, match,
boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3)) )
{
+
+ LLTextUtil::processUrlMatch(&match,this);
+
start = match.getStart();
end = match.getEnd()+1;
@@ -1655,10 +1658,6 @@ void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Para
std::string subtext=text.substr(0,start);
appendAndHighlightText(subtext, part, style_params);
}
-
- // inserts an avatar icon preceding the Url if appropriate
- LLTextUtil::processUrlMatch(&match,this);
-
// output the styled Url
appendAndHighlightTextImpl(match.getLabel(), part, link_params, match.underlineOnHoverOnly());
@@ -2914,11 +2913,18 @@ bool LLImageTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width
S32 LLImageTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const
{
LLUIImagePtr image = mStyle->getImage();
+
+ if (image.isNull())
+ {
+ return 1;
+ }
+
S32 image_width = image->getWidth();
if(line_offset == 0 || num_pixels>image_width + IMAGE_HPAD)
{
return 1;
}
+
return 0;
}
@@ -2928,18 +2934,21 @@ F32 LLImageTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 select
{
LLColor4 color = LLColor4::white % mEditor.getDrawContext().mAlpha;
LLUIImagePtr image = mStyle->getImage();
- S32 style_image_height = image->getHeight();
- S32 style_image_width = image->getWidth();
- // Text is drawn from the top of the draw_rect downward
-
- S32 text_center = draw_rect.mTop - (draw_rect.getHeight() / 2);
- // Align image to center of draw rect
- S32 image_bottom = text_center - (style_image_height / 2);
- image->draw(draw_rect.mLeft, image_bottom,
- style_image_width, style_image_height, color);
-
- const S32 IMAGE_HPAD = 3;
- return draw_rect.mLeft + style_image_width + IMAGE_HPAD;
+ if (image.notNull())
+ {
+ S32 style_image_height = image->getHeight();
+ S32 style_image_width = image->getWidth();
+ // Text is drawn from the top of the draw_rect downward
+
+ S32 text_center = draw_rect.mTop - (draw_rect.getHeight() / 2);
+ // Align image to center of draw rect
+ S32 image_bottom = text_center - (style_image_height / 2);
+ image->draw(draw_rect.mLeft, image_bottom,
+ style_image_width, style_image_height, color);
+
+ const S32 IMAGE_HPAD = 3;
+ return draw_rect.mLeft + style_image_width + IMAGE_HPAD;
+ }
}
return 0.0;
}
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 267640a226..e32b349df4 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -114,7 +114,8 @@ LLView::Params::Params()
}
LLView::LLView(const LLView::Params& p)
-: mName(p.name),
+: mVisible(p.visible),
+ mName(p.name),
mParentView(NULL),
mReshapeFlags(FOLLOWS_NONE),
mFromXUI(p.from_xui),
@@ -123,7 +124,6 @@ LLView::LLView(const LLView::Params& p)
mNextInsertionOrdinal(0),
mHoverCursor(getCursorFromString(p.hover_cursor)),
mEnabled(p.enabled),
- mVisible(p.visible),
mMouseOpaque(p.mouse_opaque),
mSoundFlags(p.sound_flags),
mUseBoundingRect(p.use_bounding_rect),
@@ -1299,7 +1299,13 @@ void LLView::drawChildren()
{
if (!mChildList.empty())
{
- LLRect rootRect = getRootView()->getRect();
+ static const LLRect* rootRect = NULL;
+
+ if (!mParentView)
+ {
+ rootRect = &mRect;
+ }
+
LLRect screenRect;
++sDepth;
@@ -1313,7 +1319,7 @@ void LLView::drawChildren()
{
// Only draw views that are within the root view
localRectToScreen(viewp->getRect(),&screenRect);
- if ( rootRect.overlaps(screenRect) && LLUI::sDirtyRect.overlaps(screenRect))
+ if ( rootRect->overlaps(screenRect) && LLUI::sDirtyRect.overlaps(screenRect))
{
LLUI::pushMatrix();
{
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index a5d8e31640..b7cd87e269 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -287,7 +287,7 @@ public:
void setAllChildrenEnabled(BOOL b);
virtual void setVisible(BOOL visible);
- BOOL getVisible() const { return mVisible; }
+ const BOOL& getVisible() const { return mVisible; }
virtual void setEnabled(BOOL enabled);
BOOL getEnabled() const { return mEnabled; }
/// 'available' in this context means 'visible and enabled': in other
@@ -548,11 +548,13 @@ private:
LLView* mParentView;
child_list_t mChildList;
- std::string mName;
// location in pixels, relative to surrounding structure, bottom,left=0,0
+ BOOL mVisible;
LLRect mRect;
LLRect mBoundingRect;
+
std::string mLayout;
+ std::string mName;
U32 mReshapeFlags;
@@ -574,8 +576,6 @@ private:
LLRootHandle<LLView> mHandle;
BOOL mLastVisible;
- BOOL mVisible;
-
S32 mNextInsertionOrdinal;
static LLWindow* sWindow; // All root views must know about their window.