diff --git a/gfx/idl/gfxIImageFrame.idl b/gfx/idl/gfxIImageFrame.idl index 027f6c80a7c0..e3893a7f5af4 100644 --- a/gfx/idl/gfxIImageFrame.idl +++ b/gfx/idl/gfxIImageFrame.idl @@ -31,6 +31,7 @@ %} interface gfxIImageFrame; +native nsRectRef(nsRect &); /** * gfxIImageFrame interface @@ -92,8 +93,9 @@ interface gfxIImageFrame : nsISupports /** * The rectangle this frame ocupies. + * @param rect this is really an out parameter. */ - [noscript] readonly attribute nsRect rect; + [noscript] void getRect(in nsRectRef rect); /** * The image data format the image was created with. diff --git a/gfx/idl/gfxtypes.idl b/gfx/idl/gfxtypes.idl index 7e5d05f88b2e..2b5d9dec9ed6 100644 --- a/gfx/idl/gfxtypes.idl +++ b/gfx/idl/gfxtypes.idl @@ -33,5 +33,4 @@ typedef PRInt32 nscoord; [ptr] native nsRect(nsRect); -[ref] native nsRectRef(nsRect); diff --git a/gfx/public/gfxIImageFrame.idl b/gfx/public/gfxIImageFrame.idl index 027f6c80a7c0..e3893a7f5af4 100644 --- a/gfx/public/gfxIImageFrame.idl +++ b/gfx/public/gfxIImageFrame.idl @@ -31,6 +31,7 @@ %} interface gfxIImageFrame; +native nsRectRef(nsRect &); /** * gfxIImageFrame interface @@ -92,8 +93,9 @@ interface gfxIImageFrame : nsISupports /** * The rectangle this frame ocupies. + * @param rect this is really an out parameter. */ - [noscript] readonly attribute nsRect rect; + [noscript] void getRect(in nsRectRef rect); /** * The image data format the image was created with. diff --git a/gfx/public/gfxtypes.idl b/gfx/public/gfxtypes.idl index 7e5d05f88b2e..2b5d9dec9ed6 100644 --- a/gfx/public/gfxtypes.idl +++ b/gfx/public/gfxtypes.idl @@ -33,5 +33,4 @@ typedef PRInt32 nscoord; [ptr] native nsRect(nsRect); -[ref] native nsRectRef(nsRect); diff --git a/gfx/src/shared/gfxImageFrame.cpp b/gfx/src/shared/gfxImageFrame.cpp index b6759c49b6e0..599cb1f9ffaa 100644 --- a/gfx/src/shared/gfxImageFrame.cpp +++ b/gfx/src/shared/gfxImageFrame.cpp @@ -152,14 +152,14 @@ NS_IMETHODIMP gfxImageFrame::GetHeight(nscoord *aHeight) return NS_OK; } -/* readonly attribute nsRect rect; */ -NS_IMETHODIMP gfxImageFrame::GetRect(nsRect **aRect) +/* void getRect(in nsRectRef rect); */ +NS_IMETHODIMP gfxImageFrame::GetRect(nsRect &aRect) { if (!mInitalized) return NS_ERROR_NOT_INITIALIZED; - nsRect rect(mOffset.x, mOffset.y, mSize.width, mSize.height); - *aRect = ▭ + aRect.SetRect(mOffset.x, mOffset.y, mSize.width, mSize.height); + return NS_OK; } diff --git a/gfx2/public/gfxIImageFrame.idl b/gfx2/public/gfxIImageFrame.idl index 027f6c80a7c0..e3893a7f5af4 100644 --- a/gfx2/public/gfxIImageFrame.idl +++ b/gfx2/public/gfxIImageFrame.idl @@ -31,6 +31,7 @@ %} interface gfxIImageFrame; +native nsRectRef(nsRect &); /** * gfxIImageFrame interface @@ -92,8 +93,9 @@ interface gfxIImageFrame : nsISupports /** * The rectangle this frame ocupies. + * @param rect this is really an out parameter. */ - [noscript] readonly attribute nsRect rect; + [noscript] void getRect(in nsRectRef rect); /** * The image data format the image was created with. diff --git a/gfx2/public/gfxtypes.idl b/gfx2/public/gfxtypes.idl index 7e5d05f88b2e..2b5d9dec9ed6 100644 --- a/gfx2/public/gfxtypes.idl +++ b/gfx2/public/gfxtypes.idl @@ -33,5 +33,4 @@ typedef PRInt32 nscoord; [ptr] native nsRect(nsRect); -[ref] native nsRectRef(nsRect); diff --git a/gfx2/src/gfxImageFrame.cpp b/gfx2/src/gfxImageFrame.cpp index b6759c49b6e0..599cb1f9ffaa 100644 --- a/gfx2/src/gfxImageFrame.cpp +++ b/gfx2/src/gfxImageFrame.cpp @@ -152,14 +152,14 @@ NS_IMETHODIMP gfxImageFrame::GetHeight(nscoord *aHeight) return NS_OK; } -/* readonly attribute nsRect rect; */ -NS_IMETHODIMP gfxImageFrame::GetRect(nsRect **aRect) +/* void getRect(in nsRectRef rect); */ +NS_IMETHODIMP gfxImageFrame::GetRect(nsRect &aRect) { if (!mInitalized) return NS_ERROR_NOT_INITIALIZED; - nsRect rect(mOffset.x, mOffset.y, mSize.width, mSize.height); - *aRect = ▭ + aRect.SetRect(mOffset.x, mOffset.y, mSize.width, mSize.height); + return NS_OK; }