summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.cpp
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2009-11-19 09:28:35 -0800
committerRick Pasetto <rick@lindenlab.com>2009-11-19 09:28:35 -0800
commit51e640e5d753ac9dc005cd6827db77988a04b8fa (patch)
tree85cb5fc6626626b42df6a425a0663a515ac5362c /indra/llui/lltextbase.cpp
parentd4ba73ed721fa0811474fc53300f560539d38018 (diff)
parent3e46ee6274d04d91657da92953b167fe94eb7f59 (diff)
Merge from remote repo
Diffstat (limited to 'indra/llui/lltextbase.cpp')
-rw-r--r--indra/llui/lltextbase.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 9706878a57..cd795282f9 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1451,7 +1451,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
}
}
-void LLTextBase::setText(const LLStringExplicit &utf8str)
+void LLTextBase::setText(const LLStringExplicit &utf8str ,const LLStyle::Params& input_params)
{
// clear out the existing text and segments
getViewModel()->setDisplay(LLWStringUtil::null);
@@ -1466,7 +1466,7 @@ void LLTextBase::setText(const LLStringExplicit &utf8str)
std::string text(utf8str);
LLStringUtil::removeCRLF(text);
- appendText(text, false);
+ appendText(text, false, input_params);
onValueChange(0, getLength());
}
@@ -1507,8 +1507,11 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c
link_params.color = match.getColor();
// apply font name from requested style_params
std::string font_name = LLFontGL::nameFromFont(style_params.font());
- link_params.font.name.setIfNotProvided(font_name);
- link_params.font.style = "UNDERLINE";
+ std::string font_size = LLFontGL::sizeFromFont(style_params.font());
+ link_params.font.name(font_name);
+ link_params.font.size(font_size);
+ link_params.font.style("UNDERLINE");
+
link_params.link_href = match.getUrl();
// output the text before the Url
@@ -2377,6 +2380,14 @@ bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt
width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars);
// if last character is a newline, then return true, forcing line break
llwchar last_char = text[mStart + first_char + num_chars - 1];
+
+ LLUIImagePtr image = mStyle->getImage();
+ if( image.notNull())
+ {
+ width += image->getWidth();
+ height = llmax(height, image->getHeight());
+ }
+
return num_chars >= 1 && last_char == '\n';
}