mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 17:22:04 +00:00
Bug 855412 - Change the signature of NS_NewSVGRect to not use the outparam. r=Ms2ger
This commit is contained in:
parent
8e4e3ebabe
commit
1b1855494c
@ -38,21 +38,19 @@ NS_INTERFACE_MAP_END
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Exported creation functions:
|
||||
|
||||
nsresult
|
||||
NS_NewSVGRect(mozilla::dom::SVGRect** result, float x, float y,
|
||||
float width, float height)
|
||||
already_AddRefed<mozilla::dom::SVGRect>
|
||||
NS_NewSVGRect(float x, float y, float width, float height)
|
||||
{
|
||||
*result = new mozilla::dom::SVGRect(x, y, width, height);
|
||||
if (!*result) return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(*result);
|
||||
return NS_OK;
|
||||
nsRefPtr<mozilla::dom::SVGRect> rect =
|
||||
new mozilla::dom::SVGRect(x, y, width, height);
|
||||
|
||||
return rect.forget();
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewSVGRect(mozilla::dom::SVGRect** result, const gfxRect& rect)
|
||||
already_AddRefed<mozilla::dom::SVGRect>
|
||||
NS_NewSVGRect(const gfxRect& rect)
|
||||
{
|
||||
return NS_NewSVGRect(result,
|
||||
rect.X(), rect.Y(),
|
||||
return NS_NewSVGRect(rect.X(), rect.Y(),
|
||||
rect.Width(), rect.Height());
|
||||
}
|
||||
|
||||
|
@ -76,12 +76,10 @@ protected:
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
nsresult
|
||||
NS_NewSVGRect(mozilla::dom::SVGRect** result,
|
||||
float x=0.0f, float y=0.0f,
|
||||
float width=0.0f, float height=0.0f);
|
||||
already_AddRefed<mozilla::dom::SVGRect>
|
||||
NS_NewSVGRect(float x=0.0f, float y=0.0f, float width=0.0f, float height=0.0f);
|
||||
|
||||
nsresult
|
||||
NS_NewSVGRect(mozilla::dom::SVGRect** result, const gfxRect& rect);
|
||||
already_AddRefed<mozilla::dom::SVGRect>
|
||||
NS_NewSVGRect(const gfxRect& rect);
|
||||
|
||||
#endif //mozilla_dom_SVGRect_h
|
||||
|
@ -411,9 +411,7 @@ SVGSVGElement::CreateSVGMatrix()
|
||||
already_AddRefed<SVGIRect>
|
||||
SVGSVGElement::CreateSVGRect()
|
||||
{
|
||||
nsRefPtr<SVGRect> rect;
|
||||
NS_NewSVGRect(getter_AddRefs(rect));
|
||||
return rect.forget();
|
||||
return NS_NewSVGRect();
|
||||
}
|
||||
|
||||
already_AddRefed<SVGTransform>
|
||||
|
@ -173,9 +173,7 @@ SVGTransformableElement::GetBBox(ErrorResult& rv)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsRefPtr<SVGRect> rect;
|
||||
rv = NS_NewSVGRect(getter_AddRefs(rect), nsSVGUtils::GetBBox(frame));
|
||||
return rect.forget();
|
||||
return NS_NewSVGRect(nsSVGUtils::GetBBox(frame));
|
||||
}
|
||||
|
||||
already_AddRefed<SVGMatrix>
|
||||
|
@ -1285,9 +1285,7 @@ nsSVGGlyphFrame::GetExtentOfChar(uint32_t charnum, dom::SVGIRect **_retval)
|
||||
metrics.mAscent + metrics.mDescent));
|
||||
tmpCtx->IdentityMatrix();
|
||||
|
||||
nsRefPtr<dom::SVGRect> rect;
|
||||
nsresult rv = NS_NewSVGRect(getter_AddRefs(rect), tmpCtx->GetUserPathExtent());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsRefPtr<dom::SVGRect> rect = NS_NewSVGRect(tmpCtx->GetUserPathExtent());
|
||||
|
||||
rect.forget(_retval);
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user