зеркало из https://github.com/mozilla/pjs.git
Bug 554687 patch 2: Use nsSMILValue::Swap instead of operator= where appropriate. r=roc
This commit is contained in:
Родитель
62e2faafc2
Коммит
b3f82754a8
|
@ -301,7 +301,9 @@ nsSMILAnimationFunction::ComposeResult(const nsISMILAttr& aSMILAttr,
|
|||
|
||||
// If additive animation isn't required or isn't supported, set the value.
|
||||
if (!IsAdditive() || NS_FAILED(aResult.SandwichAdd(result))) {
|
||||
aResult = result;
|
||||
aResult.Swap(result);
|
||||
// Note: The old value of aResult is now in |result|, and it will get
|
||||
// cleaned up when |result| goes out of scope, when this function returns.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -453,7 +453,7 @@ nsSVGAngle::SMILOrient::ValueFromString(const nsAString& aStr,
|
|||
val.mU.mOrient.mUnit = unitType;
|
||||
val.mU.mOrient.mOrientType = nsIDOMSVGMarkerElement::SVG_MARKER_ORIENT_ANGLE;
|
||||
}
|
||||
aValue = val;
|
||||
aValue.Swap(val);
|
||||
aCanCache = PR_TRUE;
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -186,8 +186,8 @@ nsSVGTransformSMILAttr::ParseValue(const nsAString& aSpec,
|
|||
return;
|
||||
}
|
||||
|
||||
// Success! Initialize our outparam with parsed value.
|
||||
aResult = val;
|
||||
// Success! Populate our outparam with parsed value.
|
||||
aResult.Swap(val);
|
||||
}
|
||||
|
||||
inline PRBool
|
||||
|
|
|
@ -284,12 +284,8 @@ nsSVGViewBox::SMILViewBox
|
|||
return res;
|
||||
}
|
||||
nsSMILValue val(&SVGViewBoxSMILType::sSingleton);
|
||||
// Check for OOM when the nsSMILValue ctor called SVGViewBoxSMILType::Init:
|
||||
if (val.IsNull()) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*static_cast<nsSVGViewBoxRect*>(val.mU.mPtr) = viewBox;
|
||||
aValue = val;
|
||||
aValue.Swap(val);
|
||||
aCanCache = PR_TRUE;
|
||||
|
||||
return NS_OK;
|
||||
|
@ -299,10 +295,7 @@ nsSMILValue
|
|||
nsSVGViewBox::SMILViewBox::GetBaseValue() const
|
||||
{
|
||||
nsSMILValue val(&SVGViewBoxSMILType::sSingleton);
|
||||
// Check for OOM when the nsSMILValue ctor called SVGViewBoxSMILType::Init:
|
||||
if (!val.IsNull()) {
|
||||
*static_cast<nsSVGViewBoxRect*>(val.mU.mPtr) = mVal->mBaseVal;
|
||||
}
|
||||
*static_cast<nsSVGViewBoxRect*>(val.mU.mPtr) = mVal->mBaseVal;
|
||||
return val;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче