Bug 1387381 - Remove nsXPIDLString local variables. r=erahm.

nsXPIDLStrings are marked as VOIDED upon initialization. Most of these local
nsXPIDLString variables are immediately set via getter_Copies(), which will
either assign a string value (using Adopt()) or do SetIsVoid(). These can be
trivially converted to nsString, which will get the same treatment.

The patch suitably converts the remaining nsXPIDLString local variable as well.
This commit is contained in:
Nicholas Nethercote
2017-08-08 16:07:55 +10:00
parent 84a1d0d32f
commit d24ecfe191
32 changed files with 71 additions and 83 deletions

View File

@@ -1382,18 +1382,15 @@ ChromeTooltipListener::sTooltipCallback(nsITimer* aTimer,
// if there is text associated with the node, show the tip and fire
// off a timer to auto-hide it.
nsXPIDLString tooltipText;
nsXPIDLString directionText;
if (self->mTooltipTextProvider) {
nsString tooltipText;
nsString directionText;
bool textFound = false;
self->mTooltipTextProvider->GetNodeText(
self->mPossibleTooltipNode, getter_Copies(tooltipText),
getter_Copies(directionText), &textFound);
if (textFound) {
nsString tipText(tooltipText);
nsString dirText(directionText);
LayoutDeviceIntPoint screenDot = widget->WidgetToScreenOffset();
double scaleFactor = 1.0;
if (shell->GetPresContext()) {
@@ -1404,7 +1401,7 @@ ChromeTooltipListener::sTooltipCallback(nsITimer* aTimer,
// ShowTooltip expects widget-relative position.
self->ShowTooltip(self->mMouseScreenX - screenDot.x / scaleFactor,
self->mMouseScreenY - screenDot.y / scaleFactor,
tipText, dirText);
tooltipText, directionText);
}
}