From eeed6749e0efa10319e645f57cfde53b85bf4f40 Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Sun, 20 Jul 2014 12:55:00 -0400 Subject: [PATCH] Bug 1041311 - Fix Qt compilation. r=romaxa --- image/decoders/icon/qt/nsIconChannel.h | 5 +++-- toolkit/components/remote/nsQtRemoteService.cpp | 4 ++++ toolkit/components/remote/nsQtRemoteService.h | 3 ++- widget/qt/nsBidiKeyboard.h | 2 ++ widget/qt/nsClipboard.h | 4 ++-- widget/qt/nsDeviceContextSpecQt.cpp | 4 ++++ widget/qt/nsDeviceContextSpecQt.h | 7 ++++++- widget/qt/nsPrintDialogQt.h | 4 +++- widget/qt/nsPrintSettingsQt.h | 5 +++-- widget/qt/nsScreenManagerQt.cpp | 15 +++++++++++++++ widget/qt/nsScreenManagerQt.h | 3 +-- widget/qt/nsScreenQt.cpp | 7 +++++++ widget/qt/nsScreenQt.h | 1 + widget/qt/nsWindow.h | 3 ++- 14 files changed, 55 insertions(+), 12 deletions(-) diff --git a/image/decoders/icon/qt/nsIconChannel.h b/image/decoders/icon/qt/nsIconChannel.h index 73f58fd7d9cc..1de6853e6e80 100644 --- a/image/decoders/icon/qt/nsIconChannel.h +++ b/image/decoders/icon/qt/nsIconChannel.h @@ -25,8 +25,7 @@ class nsIconChannel MOZ_FINAL : public nsIChannel { NS_FORWARD_NSIREQUEST(mRealChannel->) NS_FORWARD_NSICHANNEL(mRealChannel->) - nsIconChannel() {} - ~nsIconChannel() {} + nsIconChannel() {}; /** * Called by nsIconProtocolHandler after it creates this channel. @@ -35,6 +34,8 @@ class nsIconChannel MOZ_FINAL : public nsIChannel { */ nsresult Init(nsIURI* aURI); private: + ~nsIconChannel() {}; + /** * The channel to the temp icon file (e.g. to /tmp/2qy9wjqw.html). * Will always be non-null after a successful Init. diff --git a/toolkit/components/remote/nsQtRemoteService.cpp b/toolkit/components/remote/nsQtRemoteService.cpp index ecf4fc3dc172..06f0786d512f 100644 --- a/toolkit/components/remote/nsQtRemoteService.cpp +++ b/toolkit/components/remote/nsQtRemoteService.cpp @@ -63,6 +63,10 @@ mServerWindow(0) { } +nsQtRemoteService::~nsQtRemoteService() +{ +} + NS_IMETHODIMP nsQtRemoteService::Startup(const char* aAppName, const char* aProfileName) { diff --git a/toolkit/components/remote/nsQtRemoteService.h b/toolkit/components/remote/nsQtRemoteService.h index 59163e381792..c2a208e3881a 100644 --- a/toolkit/components/remote/nsQtRemoteService.h +++ b/toolkit/components/remote/nsQtRemoteService.h @@ -21,9 +21,10 @@ public: NS_DECL_NSIREMOTESERVICE nsQtRemoteService(); - virtual ~nsQtRemoteService() { }; private: + virtual ~nsQtRemoteService(); + virtual void SetDesktopStartupIDOrTimestamp(const nsACString& aDesktopStartupID, uint32_t aTimestamp); diff --git a/widget/qt/nsBidiKeyboard.h b/widget/qt/nsBidiKeyboard.h index bedf4e9d66b8..c22bf4ab8c10 100644 --- a/widget/qt/nsBidiKeyboard.h +++ b/widget/qt/nsBidiKeyboard.h @@ -16,6 +16,8 @@ public: NS_DECL_NSIBIDIKEYBOARD nsBidiKeyboard(); + +protected: virtual ~nsBidiKeyboard(); }; diff --git a/widget/qt/nsClipboard.h b/widget/qt/nsClipboard.h index 8ba60be30379..d348c4b551af 100644 --- a/widget/qt/nsClipboard.h +++ b/widget/qt/nsClipboard.h @@ -17,7 +17,6 @@ class nsClipboard : public nsIClipboard { public: nsClipboard(); - virtual ~nsClipboard(); //nsISupports NS_DECL_ISUPPORTS @@ -26,6 +25,8 @@ public: NS_DECL_NSICLIPBOARD protected: + virtual ~nsClipboard(); + NS_IMETHOD SetNativeClipboardData(nsITransferable *aTransferable, QClipboard::Mode cbMode); NS_IMETHOD GetNativeClipboardData(nsITransferable *aTransferable, @@ -35,7 +36,6 @@ protected: nsCOMPtr mGlobalOwner; nsCOMPtr mSelectionTransferable; nsCOMPtr mGlobalTransferable; - nsRefPtr mPrivacyHandler; }; #endif // nsClipboard_h__ diff --git a/widget/qt/nsDeviceContextSpecQt.cpp b/widget/qt/nsDeviceContextSpecQt.cpp index 98dabaf47874..12c93db11677 100644 --- a/widget/qt/nsDeviceContextSpecQt.cpp +++ b/widget/qt/nsDeviceContextSpecQt.cpp @@ -214,6 +214,10 @@ nsPrinterEnumeratorQt::nsPrinterEnumeratorQt() { } +nsPrinterEnumeratorQt::~nsPrinterEnumeratorQt() +{ +} + NS_IMPL_ISUPPORTS(nsPrinterEnumeratorQt, nsIPrinterEnumerator) NS_IMETHODIMP nsPrinterEnumeratorQt::GetPrinterNameList( diff --git a/widget/qt/nsDeviceContextSpecQt.h b/widget/qt/nsDeviceContextSpecQt.h index cd51b68c5df3..9ec1f567e16b 100644 --- a/widget/qt/nsDeviceContextSpecQt.h +++ b/widget/qt/nsDeviceContextSpecQt.h @@ -19,7 +19,6 @@ class nsDeviceContextSpecQt : public nsIDeviceContextSpec { public: nsDeviceContextSpecQt(); - virtual ~nsDeviceContextSpecQt(); NS_DECL_ISUPPORTS @@ -39,6 +38,8 @@ public: NS_IMETHOD GetPath (const char** aPath); protected: + virtual ~nsDeviceContextSpecQt(); + nsCOMPtr mPrintSettings; bool mToPrinter : 1; /* If true, print to printer */ bool mIsPPreview : 1; /* If true, is print preview */ @@ -54,6 +55,10 @@ public: nsPrinterEnumeratorQt(); NS_DECL_ISUPPORTS NS_DECL_NSIPRINTERENUMERATOR + +protected: + virtual ~nsPrinterEnumeratorQt(); + }; #endif /* !nsDeviceContextSpecQt_h___ */ diff --git a/widget/qt/nsPrintDialogQt.h b/widget/qt/nsPrintDialogQt.h index 2c437accddd7..fb356a5af9b0 100644 --- a/widget/qt/nsPrintDialogQt.h +++ b/widget/qt/nsPrintDialogQt.h @@ -15,7 +15,6 @@ class nsPrintDialogServiceQt : public nsIPrintDialogService { public: nsPrintDialogServiceQt(); - virtual ~nsPrintDialogServiceQt(); NS_DECL_ISUPPORTS @@ -25,6 +24,9 @@ public: nsIWebBrowserPrint* aWebBrowserPrint); NS_IMETHODIMP ShowPageSetup(nsIDOMWindow* aParent, nsIPrintSettings* aSettings); + +protected: + virtual ~nsPrintDialogServiceQt(); }; #endif diff --git a/widget/qt/nsPrintSettingsQt.h b/widget/qt/nsPrintSettingsQt.h index fa74ac5c3d6d..f9eb0f672009 100644 --- a/widget/qt/nsPrintSettingsQt.h +++ b/widget/qt/nsPrintSettingsQt.h @@ -17,10 +17,9 @@ class nsPrintSettingsQt : public nsPrintSettings { public: NS_DECL_ISUPPORTS_INHERITED - NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSQT_IID) + NS_DECLARE_STATIC_IID_ACCESSOR(NS_PRINTSETTINGSQT_IID) nsPrintSettingsQt(); - virtual ~nsPrintSettingsQt(); NS_IMETHOD GetPrintRange(int16_t* aPrintRange); NS_IMETHOD SetPrintRange(int16_t aPrintRange); @@ -71,6 +70,8 @@ public: NS_IMETHOD GetEffectivePageSize(double* aWidth, double* aHeight); protected: + virtual ~nsPrintSettingsQt(); + nsPrintSettingsQt(const nsPrintSettingsQt& src); nsPrintSettingsQt& operator=(const nsPrintSettingsQt& rhs); diff --git a/widget/qt/nsScreenManagerQt.cpp b/widget/qt/nsScreenManagerQt.cpp index da4ebcef9803..732008028123 100644 --- a/widget/qt/nsScreenManagerQt.cpp +++ b/widget/qt/nsScreenManagerQt.cpp @@ -69,6 +69,21 @@ nsScreenManagerQt::ScreenForRect(int32_t inLeft, int32_t inTop, return NS_OK; } +NS_IMETHODIMP +nsScreenManagerQt::ScreenForId(uint32_t aId, nsIScreen** aOutScreen) +{ + if (!mInitialized) { + init(); + } + + if (aId < nScreens) { + NS_IF_ADDREF(*aOutScreen = screens[aId]); + return NS_OK; + } + + return NS_ERROR_FAILURE; +} + // // GetPrimaryScreen // diff --git a/widget/qt/nsScreenManagerQt.h b/widget/qt/nsScreenManagerQt.h index e7a43e643ee9..0f5bb5f2a7ee 100644 --- a/widget/qt/nsScreenManagerQt.h +++ b/widget/qt/nsScreenManagerQt.h @@ -17,13 +17,12 @@ class nsScreenManagerQt : public nsIScreenManager { public: nsScreenManagerQt ( ); - virtual ~nsScreenManagerQt(); NS_DECL_ISUPPORTS NS_DECL_NSISCREENMANAGER private: - + virtual ~nsScreenManagerQt(); void init (); nsCOMPtr *screens; diff --git a/widget/qt/nsScreenQt.cpp b/widget/qt/nsScreenQt.cpp index f2c2b78cdc07..095238f24ad2 100644 --- a/widget/qt/nsScreenQt.cpp +++ b/widget/qt/nsScreenQt.cpp @@ -23,6 +23,13 @@ nsScreenQt::~nsScreenQt() { } +NS_IMETHODIMP +nsScreenQt::GetId(uint32_t* aId) +{ + *aId = mScreen; + return NS_OK; +} + NS_IMETHODIMP nsScreenQt::GetRect(int32_t *outLeft,int32_t *outTop, int32_t *outWidth,int32_t *outHeight) diff --git a/widget/qt/nsScreenQt.h b/widget/qt/nsScreenQt.h index c27a148925ce..ad3a0ef9af3b 100644 --- a/widget/qt/nsScreenQt.h +++ b/widget/qt/nsScreenQt.h @@ -16,6 +16,7 @@ public: nsScreenQt (int aScreen); virtual ~nsScreenQt(); + NS_IMETHOD GetId(uint32_t* aId); NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth); diff --git a/widget/qt/nsWindow.h b/widget/qt/nsWindow.h index 286caf0b6440..1977d6c4eb92 100644 --- a/widget/qt/nsWindow.h +++ b/widget/qt/nsWindow.h @@ -85,7 +85,6 @@ class nsWindow : public nsBaseWidget, { public: nsWindow(); - virtual ~nsWindow(); NS_DECL_ISUPPORTS_INHERITED @@ -172,6 +171,8 @@ public: virtual nsEventStatus tabletEvent(QTabletEvent* event); protected: + virtual ~nsWindow(); + nsWindow* mParent; bool mVisible; InputContext mInputContext;