Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
NiranV
Black Dragon Viewer
Commits
8c44d0e5
Commit
8c44d0e5
authored
Jun 22, 2019
by
Kitty Barnett
Browse files
Options
Browse Files
Download
Plain Diff
Merged with .Catznip tip
--HG-- branch : Catznip
parents
8d25e465
03f10b1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
indra/newview/llchatitemscontainerctrl.cpp
indra/newview/llchatitemscontainerctrl.cpp
+18
-17
No files found.
indra/newview/llchatitemscontainerctrl.cpp
View file @
8c44d0e5
...
...
@@ -160,27 +160,28 @@ void LLFloaterIMNearbyChatToastPanel::addMessage(const LLSD& notification, bool
// Copied from LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
S32
chars_in_line
=
mMsgText
->
getRect
().
getWidth
()
/
messageFont
->
getWidth
(
"c"
);
S32
max_lines
=
notification
[
"available_height"
].
asInteger
()
/
(
mMsgText
->
getTextPixelHeight
()
+
4
);
S32
new_line_chars
=
std
::
count
(
messageText
.
begin
(),
messageText
.
end
(),
'\n'
)
;
S32
lines_count
=
(
messageText
.
size
()
-
new_line_chars
)
/
chars_in_line
+
new_line_chars
+
1
;
int
lines
=
0
;
int
chars
=
0
;
//Remove excessive chars if message is not fit in available height. MAINT-6891
if
(
lines_count
>
max_lines
)
//Remove excessive chars if message does not fit in available height. MAINT-6891
std
::
string
::
iterator
it
;
for
(
it
=
messageText
.
begin
();
it
<
messageText
.
end
()
&&
lines
<
max_lines
;
it
++
)
{
while
(
lines_count
>
max_lines
)
if
(
*
it
==
'\n'
)
++
lines
;
else
++
chars
;
if
(
chars
>=
chars_in_line
)
{
std
::
size_t
nl_pos
=
messageText
.
rfind
(
'\n'
);
if
(
nl_pos
!=
std
::
string
::
npos
)
{
nl_pos
=
nl_pos
>
messageText
.
length
()
-
chars_in_line
?
nl_pos
:
messageText
.
length
()
-
chars_in_line
;
messageText
.
erase
(
messageText
.
begin
()
+
nl_pos
,
messageText
.
end
());
}
else
{
messageText
.
erase
(
messageText
.
end
()
-
chars_in_line
,
messageText
.
end
());
}
new_line_chars
=
std
::
count
(
messageText
.
begin
(),
messageText
.
end
(),
'\n'
);
lines_count
=
(
messageText
.
size
()
-
new_line_chars
)
/
chars_in_line
+
new_line_chars
;
chars
=
0
;
++
lines
;
}
}
if
(
it
<
messageText
.
end
())
{
messageText
.
erase
(
it
,
messageText
.
end
());
messageText
+=
" ..."
;
}
// [/SL:KB]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment