diff --git a/mozilla/camino/CHBrowserView.mm b/mozilla/camino/CHBrowserView.mm index 7d5bc993729..7a752484fcc 100644 --- a/mozilla/camino/CHBrowserView.mm +++ b/mozilla/camino/CHBrowserView.mm @@ -359,20 +359,14 @@ nsCocoaBrowserListener::ExitModalEventLoop(nsresult aStatus) // Implementation of nsIEmbeddingSiteWindow /* void setDimensions (in unsigned long flags, in long x, in long y, in long cx, in long cy); */ NS_IMETHODIMP -nsCocoaBrowserListener::SetDimensions(PRUint32 flags, - PRInt32 x, - PRInt32 y, - PRInt32 cx, - PRInt32 cy) +nsCocoaBrowserListener::SetDimensions(PRUint32 flags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy) { - if (!mView) { + if (!mView) return NS_ERROR_FAILURE; - } NSWindow* window = [mView window]; - if (!window) { + if (!window) return NS_ERROR_FAILURE; - } if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) { NSPoint origin; @@ -399,40 +393,35 @@ nsCocoaBrowserListener::SetDimensions(PRUint32 flags, /* void getDimensions (in unsigned long flags, out long x, out long y, out long cx, out long cy); */ NS_IMETHODIMP -nsCocoaBrowserListener::GetDimensions(PRUint32 flags, - PRInt32 *x, - PRInt32 *y, - PRInt32 *cx, - PRInt32 *cy) +nsCocoaBrowserListener::GetDimensions(PRUint32 flags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy) { - NS_ENSURE_ARG_POINTER(x); - NS_ENSURE_ARG_POINTER(y); - NS_ENSURE_ARG_POINTER(cx); - NS_ENSURE_ARG_POINTER(cy); - - if (!mView) { + if (!mView) return NS_ERROR_FAILURE; - } NSWindow* window = [mView window]; - if (!window) { + if (!window) return NS_ERROR_FAILURE; - } NSRect frame = [window frame]; if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) { - *x = (PRInt32)frame.origin.x; - *y = (PRInt32)frame.origin.y; + if ( x ) + *x = (PRInt32)frame.origin.x; + if ( y ) + *y = (PRInt32)frame.origin.y; } if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER) { - *cx = (PRInt32)frame.size.width; - *cy = (PRInt32)frame.size.height; + if ( cx ) + *cx = (PRInt32)frame.size.width; + if ( cy ) + *cy = (PRInt32)frame.size.height; } else if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER) { NSView* contentView = [window contentView]; NSRect contentFrame = [contentView frame]; - *cx = (PRInt32)contentFrame.size.width; - *cy = (PRInt32)contentFrame.size.height; + if ( cx ) + *cx = (PRInt32)contentFrame.size.width; + if ( cy ) + *cy = (PRInt32)contentFrame.size.height; } return NS_OK; diff --git a/mozilla/camino/src/embedding/CHBrowserView.mm b/mozilla/camino/src/embedding/CHBrowserView.mm index 7d5bc993729..7a752484fcc 100644 --- a/mozilla/camino/src/embedding/CHBrowserView.mm +++ b/mozilla/camino/src/embedding/CHBrowserView.mm @@ -359,20 +359,14 @@ nsCocoaBrowserListener::ExitModalEventLoop(nsresult aStatus) // Implementation of nsIEmbeddingSiteWindow /* void setDimensions (in unsigned long flags, in long x, in long y, in long cx, in long cy); */ NS_IMETHODIMP -nsCocoaBrowserListener::SetDimensions(PRUint32 flags, - PRInt32 x, - PRInt32 y, - PRInt32 cx, - PRInt32 cy) +nsCocoaBrowserListener::SetDimensions(PRUint32 flags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy) { - if (!mView) { + if (!mView) return NS_ERROR_FAILURE; - } NSWindow* window = [mView window]; - if (!window) { + if (!window) return NS_ERROR_FAILURE; - } if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) { NSPoint origin; @@ -399,40 +393,35 @@ nsCocoaBrowserListener::SetDimensions(PRUint32 flags, /* void getDimensions (in unsigned long flags, out long x, out long y, out long cx, out long cy); */ NS_IMETHODIMP -nsCocoaBrowserListener::GetDimensions(PRUint32 flags, - PRInt32 *x, - PRInt32 *y, - PRInt32 *cx, - PRInt32 *cy) +nsCocoaBrowserListener::GetDimensions(PRUint32 flags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy) { - NS_ENSURE_ARG_POINTER(x); - NS_ENSURE_ARG_POINTER(y); - NS_ENSURE_ARG_POINTER(cx); - NS_ENSURE_ARG_POINTER(cy); - - if (!mView) { + if (!mView) return NS_ERROR_FAILURE; - } NSWindow* window = [mView window]; - if (!window) { + if (!window) return NS_ERROR_FAILURE; - } NSRect frame = [window frame]; if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) { - *x = (PRInt32)frame.origin.x; - *y = (PRInt32)frame.origin.y; + if ( x ) + *x = (PRInt32)frame.origin.x; + if ( y ) + *y = (PRInt32)frame.origin.y; } if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER) { - *cx = (PRInt32)frame.size.width; - *cy = (PRInt32)frame.size.height; + if ( cx ) + *cx = (PRInt32)frame.size.width; + if ( cy ) + *cy = (PRInt32)frame.size.height; } else if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER) { NSView* contentView = [window contentView]; NSRect contentFrame = [contentView frame]; - *cx = (PRInt32)contentFrame.size.width; - *cy = (PRInt32)contentFrame.size.height; + if ( cx ) + *cx = (PRInt32)contentFrame.size.width; + if ( cy ) + *cy = (PRInt32)contentFrame.size.height; } return NS_OK; diff --git a/mozilla/chimera/CHBrowserView.mm b/mozilla/chimera/CHBrowserView.mm index 7d5bc993729..7a752484fcc 100644 --- a/mozilla/chimera/CHBrowserView.mm +++ b/mozilla/chimera/CHBrowserView.mm @@ -359,20 +359,14 @@ nsCocoaBrowserListener::ExitModalEventLoop(nsresult aStatus) // Implementation of nsIEmbeddingSiteWindow /* void setDimensions (in unsigned long flags, in long x, in long y, in long cx, in long cy); */ NS_IMETHODIMP -nsCocoaBrowserListener::SetDimensions(PRUint32 flags, - PRInt32 x, - PRInt32 y, - PRInt32 cx, - PRInt32 cy) +nsCocoaBrowserListener::SetDimensions(PRUint32 flags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy) { - if (!mView) { + if (!mView) return NS_ERROR_FAILURE; - } NSWindow* window = [mView window]; - if (!window) { + if (!window) return NS_ERROR_FAILURE; - } if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) { NSPoint origin; @@ -399,40 +393,35 @@ nsCocoaBrowserListener::SetDimensions(PRUint32 flags, /* void getDimensions (in unsigned long flags, out long x, out long y, out long cx, out long cy); */ NS_IMETHODIMP -nsCocoaBrowserListener::GetDimensions(PRUint32 flags, - PRInt32 *x, - PRInt32 *y, - PRInt32 *cx, - PRInt32 *cy) +nsCocoaBrowserListener::GetDimensions(PRUint32 flags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy) { - NS_ENSURE_ARG_POINTER(x); - NS_ENSURE_ARG_POINTER(y); - NS_ENSURE_ARG_POINTER(cx); - NS_ENSURE_ARG_POINTER(cy); - - if (!mView) { + if (!mView) return NS_ERROR_FAILURE; - } NSWindow* window = [mView window]; - if (!window) { + if (!window) return NS_ERROR_FAILURE; - } NSRect frame = [window frame]; if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) { - *x = (PRInt32)frame.origin.x; - *y = (PRInt32)frame.origin.y; + if ( x ) + *x = (PRInt32)frame.origin.x; + if ( y ) + *y = (PRInt32)frame.origin.y; } if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER) { - *cx = (PRInt32)frame.size.width; - *cy = (PRInt32)frame.size.height; + if ( cx ) + *cx = (PRInt32)frame.size.width; + if ( cy ) + *cy = (PRInt32)frame.size.height; } else if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER) { NSView* contentView = [window contentView]; NSRect contentFrame = [contentView frame]; - *cx = (PRInt32)contentFrame.size.width; - *cy = (PRInt32)contentFrame.size.height; + if ( cx ) + *cx = (PRInt32)contentFrame.size.width; + if ( cy ) + *cy = (PRInt32)contentFrame.size.height; } return NS_OK; diff --git a/mozilla/chimera/src/embedding/CHBrowserView.mm b/mozilla/chimera/src/embedding/CHBrowserView.mm index 7d5bc993729..7a752484fcc 100644 --- a/mozilla/chimera/src/embedding/CHBrowserView.mm +++ b/mozilla/chimera/src/embedding/CHBrowserView.mm @@ -359,20 +359,14 @@ nsCocoaBrowserListener::ExitModalEventLoop(nsresult aStatus) // Implementation of nsIEmbeddingSiteWindow /* void setDimensions (in unsigned long flags, in long x, in long y, in long cx, in long cy); */ NS_IMETHODIMP -nsCocoaBrowserListener::SetDimensions(PRUint32 flags, - PRInt32 x, - PRInt32 y, - PRInt32 cx, - PRInt32 cy) +nsCocoaBrowserListener::SetDimensions(PRUint32 flags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy) { - if (!mView) { + if (!mView) return NS_ERROR_FAILURE; - } NSWindow* window = [mView window]; - if (!window) { + if (!window) return NS_ERROR_FAILURE; - } if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) { NSPoint origin; @@ -399,40 +393,35 @@ nsCocoaBrowserListener::SetDimensions(PRUint32 flags, /* void getDimensions (in unsigned long flags, out long x, out long y, out long cx, out long cy); */ NS_IMETHODIMP -nsCocoaBrowserListener::GetDimensions(PRUint32 flags, - PRInt32 *x, - PRInt32 *y, - PRInt32 *cx, - PRInt32 *cy) +nsCocoaBrowserListener::GetDimensions(PRUint32 flags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy) { - NS_ENSURE_ARG_POINTER(x); - NS_ENSURE_ARG_POINTER(y); - NS_ENSURE_ARG_POINTER(cx); - NS_ENSURE_ARG_POINTER(cy); - - if (!mView) { + if (!mView) return NS_ERROR_FAILURE; - } NSWindow* window = [mView window]; - if (!window) { + if (!window) return NS_ERROR_FAILURE; - } NSRect frame = [window frame]; if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION) { - *x = (PRInt32)frame.origin.x; - *y = (PRInt32)frame.origin.y; + if ( x ) + *x = (PRInt32)frame.origin.x; + if ( y ) + *y = (PRInt32)frame.origin.y; } if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER) { - *cx = (PRInt32)frame.size.width; - *cy = (PRInt32)frame.size.height; + if ( cx ) + *cx = (PRInt32)frame.size.width; + if ( cy ) + *cy = (PRInt32)frame.size.height; } else if (flags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER) { NSView* contentView = [window contentView]; NSRect contentFrame = [contentView frame]; - *cx = (PRInt32)contentFrame.size.width; - *cy = (PRInt32)contentFrame.size.height; + if ( cx ) + *cx = (PRInt32)contentFrame.size.width; + if ( cy ) + *cy = (PRInt32)contentFrame.size.height; } return NS_OK;