Bug 869091: Fix a couple of build warnings in Cocoa widgets. r=smichaud
authorJosh Aas <joshmoz@gmail.com>
Wed, 08 May 2013 00:06:18 -0500
changeset 131221 c94459e9a0d7100474f36e02e7f5759b2de26ded
parent 131220 13c45a7334fc2bb4ee68dc091c0e80cebe201dcc
child 131222 bb1d1ddc189a1e8bf6a69400244311626e6e791b
push id27734
push userjosh@mozilla.com
push dateWed, 08 May 2013 05:07:00 +0000
treeherdermozilla-inbound@c94459e9a0d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud
bugs869091
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 869091: Fix a couple of build warnings in Cocoa widgets. r=smichaud
widget/cocoa/nsChildView.mm
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -702,17 +702,17 @@ nsChildView::GetCGContextForTitlebarDraw
     mTitlebarSurf = new gfxQuartzSurface(titlebarSize, gfxASurface::ImageFormatARGB32);
   }
   return mTitlebarSurf->GetCGContext();
 }
 
 void
 nsChildView::WillPaint()
 {
-  [mView maybeDrawInTitlebar];
+  [(ChildView*)mView maybeDrawInTitlebar];
 }
 
 void
 nsChildView::CompositeTitlebar(const gfxSize& aSize, CGContextRef aContext)
 {
   NS_ASSERTION(mTitlebarSurf, "Must have titlebar surface");
   if (!mTitlebarSurf) {
     return;
@@ -2676,32 +2676,33 @@ NSEvent* gLastDragMouseDownEvent = nil;
   }
 }
 
 - (void)maybeDrawInTitlebar
 {
   if (!mGeckoChild) {
     return;
   }
-  ToolbarWindow* win = [self window];
+  NSWindow* win = [self window];
   if (!win || ![win isKindOfClass:[ToolbarWindow class]]) {
     return;
   }
-  if (![win drawsContentsIntoWindowFrame]) {
+  ToolbarWindow* toolbarWin = (ToolbarWindow*)win;
+  if (![toolbarWin drawsContentsIntoWindowFrame]) {
     return;
   }
 
   // Check the parts of the frame view occupied by the titlebar to see if all
   // or part of it is "dirty" (needs to be redrawn).  This is effectively the
   // top 22 pixels of the frame view, and is not the same thing as the
   // "unified toolbar".  Our ChildView ('self') is the same size as the frame
   // view and covers it.  Our ChildView has a flipped coordinate system, but
   // the frame view doesn't.
-  NSRect titlebarRect = [win titlebarRect];
-  NSView* frameView = [[win contentView] superview];
+  NSRect titlebarRect = [toolbarWin titlebarRect];
+  NSView* frameView = [[toolbarWin contentView] superview];
   NSRect dirtyRect = NSIntersectionRect([frameView _dirtyRect], titlebarRect);
   // Flip dirtyRect's coordinate system.
   dirtyRect.origin.y = [frameView bounds].size.height -
     dirtyRect.origin.y - dirtyRect.size.height;
   if (NSIsEmptyRect(dirtyRect)) {
     return;
   }