Bug 876530 - Fix implicit conversions to already_AddRefed in Qt widget. r=romaxa

This commit is contained in:
Tatiana Meshkova 2013-05-27 16:29:36 -07:00
parent acd28260cc
commit afcb6b5390
2 changed files with 5 additions and 7 deletions

View File

@ -33,14 +33,13 @@ public:
static already_AddRefed<nsIdleServiceQt> GetInstance()
{
nsIdleServiceQt* idleService =
static_cast<nsIdleServiceQt*>(nsIdleService::GetInstance().get());
nsRefPtr<nsIdleServiceQt> idleService =
nsIdleService::GetInstance().downcast<nsIdleServiceQt>();
if (!idleService) {
idleService = new nsIdleServiceQt();
NS_ADDREF(idleService);
}
return idleService;
return idleService.forget();
}
private:

View File

@ -1011,14 +1011,13 @@ nsWindow::GetAttention(int32_t aCycleCount)
static already_AddRefed<gfxASurface>
GetSurfaceForQWidget(QWidget* aDrawable)
{
gfxASurface* result =
nsRefPtr<gfxASurface> result =
new gfxXlibSurface(gfxQtPlatform::GetXDisplay(aDrawable),
aDrawable->winId(),
DefaultVisualOfScreen(gfxQtPlatform::GetXScreen(aDrawable)),
gfxIntSize(aDrawable->size().width(),
aDrawable->size().height()));
NS_IF_ADDREF(result);
return result;
return result.forget();
}
#endif