mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 414148: Avoid copy of some nsDependentC?Strings. sr=dbaron, a=mtschrep
This commit is contained in:
parent
19ab494e6e
commit
419b39f375
@ -628,7 +628,7 @@ nsTextBoxFrame::CalculateTitleForWidth(nsPresContext* aPresContext,
|
||||
return; // fits, done.
|
||||
}
|
||||
|
||||
const nsDependentString kEllipsis = nsContentUtils::GetLocalizedEllipsis();
|
||||
const nsDependentString& kEllipsis = nsContentUtils::GetLocalizedEllipsis();
|
||||
// start with an ellipsis
|
||||
mCroppedTitle.Assign(kEllipsis);
|
||||
|
||||
@ -819,7 +819,7 @@ nsTextBoxFrame::UpdateAccessTitle()
|
||||
return;
|
||||
}
|
||||
|
||||
const nsDependentString kEllipsis = nsContentUtils::GetLocalizedEllipsis();
|
||||
const nsDependentString& kEllipsis = nsContentUtils::GetLocalizedEllipsis();
|
||||
PRUint32 offset = mTitle.Length();
|
||||
if (StringEndsWith(mTitle, kEllipsis)) {
|
||||
offset -= kEllipsis.Length();
|
||||
|
@ -1350,7 +1350,7 @@ nsTreeBodyFrame::AdjustForCellText(nsAutoString& aText,
|
||||
if (width > maxWidth) {
|
||||
// See if the width is even smaller than the ellipsis
|
||||
// If so, clear the text completely.
|
||||
const nsDependentString kEllipsis = nsContentUtils::GetLocalizedEllipsis();
|
||||
const nsDependentString& kEllipsis = nsContentUtils::GetLocalizedEllipsis();
|
||||
nscoord ellipsisWidth;
|
||||
aRenderingContext.SetTextRunRTL(PR_FALSE);
|
||||
aRenderingContext.GetWidth(kEllipsis, ellipsisWidth);
|
||||
|
@ -741,8 +741,7 @@ void GetHTMLCharset(guchar * data, PRInt32 dataLength, nsCString& str)
|
||||
return;
|
||||
}
|
||||
// no "FFFE" and "FEFF", assume ASCII first to find "charset" info
|
||||
nsDependentCString htmlStr =
|
||||
nsDependentCString((const char *)data, dataLength);
|
||||
const nsDependentCString htmlStr((const char *)data, dataLength);
|
||||
nsACString::const_iterator start, end;
|
||||
htmlStr.BeginReading(start);
|
||||
htmlStr.EndReading(end);
|
||||
|
Loading…
Reference in New Issue
Block a user