From 4016f12d866e93cc5f7c7ff86fe6594cde473271 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Mon, 29 Jan 2007 20:41:15 +0100 Subject: [PATCH] Indentation stuff --- lib/src/GeckoContentHandler.cpp | 64 +++++++++++++++++---------------- lib/src/GeckoDownload.cpp | 57 +++++++++++++++-------------- lib/src/sugar-browser.cpp | 26 +++++++------- 3 files changed, 75 insertions(+), 72 deletions(-) diff --git a/lib/src/GeckoContentHandler.cpp b/lib/src/GeckoContentHandler.cpp index 3eb70fdf..c3785cfc 100644 --- a/lib/src/GeckoContentHandler.cpp +++ b/lib/src/GeckoContentHandler.cpp @@ -6,15 +6,12 @@ class GeckoContentHandler : public nsIHelperAppLauncherDialog { - public: - NS_DECL_ISUPPORTS - NS_DECL_NSIHELPERAPPLAUNCHERDIALOG - - GeckoContentHandler(); - virtual ~GeckoContentHandler(); - - private: +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIHELPERAPPLAUNCHERDIALOG + GeckoContentHandler(); + virtual ~GeckoContentHandler(); }; GeckoContentHandler::GeckoContentHandler() @@ -75,42 +72,47 @@ GeckoContentHandlerFactory::GeckoContentHandlerFactory() { GeckoContentHandlerFactory::~GeckoContentHandlerFactory() { } -NS_IMETHODIMP GeckoContentHandlerFactory::CreateInstance(nsISupports *aOuter, const nsIID & aIID, void **aResult) +NS_IMETHODIMP +GeckoContentHandlerFactory::CreateInstance(nsISupports *aOuter, + const nsIID & aIID, + void **aResult) { - NS_ENSURE_ARG_POINTER(aResult); + NS_ENSURE_ARG_POINTER(aResult); - *aResult = NULL; - GeckoContentHandler *inst = new GeckoContentHandler; - if (!inst) - return NS_ERROR_OUT_OF_MEMORY; + *aResult = NULL; + GeckoContentHandler *inst = new GeckoContentHandler; + if (!inst) + return NS_ERROR_OUT_OF_MEMORY; - nsresult rv = inst->QueryInterface(aIID, aResult); - if (rv != NS_OK) { - // We didn't get the right interface, so clean up - delete inst; - } + nsresult rv = inst->QueryInterface(aIID, aResult); + if (rv != NS_OK) { + // We didn't get the right interface, so clean up + delete inst; + } - return rv; + return rv; } -NS_IMETHODIMP GeckoContentHandlerFactory::LockFactory(PRBool lock) +NS_IMETHODIMP +GeckoContentHandlerFactory::LockFactory(PRBool lock) { - return NS_OK; + return NS_OK; } //***************************************************************************** -nsresult NS_NewGeckoContentHandlerFactory(nsIFactory** aFactory) +nsresult +NS_NewGeckoContentHandlerFactory(nsIFactory** aFactory) { - NS_ENSURE_ARG_POINTER(aFactory); - *aFactory = nsnull; + NS_ENSURE_ARG_POINTER(aFactory); + *aFactory = nsnull; - GeckoContentHandlerFactory *result = new GeckoContentHandlerFactory; - if (!result) - return NS_ERROR_OUT_OF_MEMORY; + GeckoContentHandlerFactory *result = new GeckoContentHandlerFactory; + if (!result) + return NS_ERROR_OUT_OF_MEMORY; - NS_ADDREF(result); - *aFactory = result; + NS_ADDREF(result); + *aFactory = result; - return NS_OK; + return NS_OK; } diff --git a/lib/src/GeckoDownload.cpp b/lib/src/GeckoDownload.cpp index c1b8aef0..479c1c5a 100644 --- a/lib/src/GeckoDownload.cpp +++ b/lib/src/GeckoDownload.cpp @@ -153,11 +153,11 @@ GeckoDownload::OnSecurityChange (nsIWebProgress *aWebProgress, class GeckoDownloadFactory : public nsIFactory { public: - NS_DECL_ISUPPORTS - NS_DECL_NSIFACTORY + NS_DECL_ISUPPORTS + NS_DECL_NSIFACTORY - GeckoDownloadFactory(); - virtual ~GeckoDownloadFactory(); + GeckoDownloadFactory(); + virtual ~GeckoDownloadFactory(); }; //***************************************************************************** @@ -170,42 +170,45 @@ GeckoDownloadFactory::GeckoDownloadFactory() { GeckoDownloadFactory::~GeckoDownloadFactory() { } -NS_IMETHODIMP GeckoDownloadFactory::CreateInstance(nsISupports *aOuter, const nsIID & aIID, void **aResult) +NS_IMETHODIMP +GeckoDownloadFactory::CreateInstance(nsISupports *aOuter, const nsIID & aIID, void **aResult) { - NS_ENSURE_ARG_POINTER(aResult); + NS_ENSURE_ARG_POINTER(aResult); - *aResult = NULL; - GeckoDownload *inst = new GeckoDownload; - if (!inst) - return NS_ERROR_OUT_OF_MEMORY; + *aResult = NULL; + GeckoDownload *inst = new GeckoDownload; + if (!inst) + return NS_ERROR_OUT_OF_MEMORY; - nsresult rv = inst->QueryInterface(aIID, aResult); - if (rv != NS_OK) { - // We didn't get the right interface, so clean up - delete inst; - } + nsresult rv = inst->QueryInterface(aIID, aResult); + if (rv != NS_OK) { + // We didn't get the right interface, so clean up + delete inst; + } - return rv; + return rv; } -NS_IMETHODIMP GeckoDownloadFactory::LockFactory(PRBool lock) +NS_IMETHODIMP +GeckoDownloadFactory::LockFactory(PRBool lock) { - return NS_OK; + return NS_OK; } //***************************************************************************** -nsresult NS_NewGeckoDownloadFactory(nsIFactory** aFactory) +nsresult +NS_NewGeckoDownloadFactory(nsIFactory** aFactory) { - NS_ENSURE_ARG_POINTER(aFactory); - *aFactory = nsnull; + NS_ENSURE_ARG_POINTER(aFactory); + *aFactory = nsnull; - GeckoDownloadFactory *result = new GeckoDownloadFactory; - if (!result) - return NS_ERROR_OUT_OF_MEMORY; + GeckoDownloadFactory *result = new GeckoDownloadFactory; + if (!result) + return NS_ERROR_OUT_OF_MEMORY; - NS_ADDREF(result); - *aFactory = result; + NS_ADDREF(result); + *aFactory = result; - return NS_OK; + return NS_OK; } diff --git a/lib/src/sugar-browser.cpp b/lib/src/sugar-browser.cpp index 5cc1ba9e..b4ac8586 100644 --- a/lib/src/sugar-browser.cpp +++ b/lib/src/sugar-browser.cpp @@ -116,23 +116,23 @@ sugar_browser_startup(const char *profile_path, const char *profile_name) NS_GetComponentRegistrar(getter_AddRefs(componentRegistrar)); NS_ENSURE_TRUE (componentRegistrar, FALSE); - nsCOMPtr contentHandlerFactory; - rv = NS_NewGeckoContentHandlerFactory(getter_AddRefs(contentHandlerFactory)); - rv = componentRegistrar->RegisterFactory(sSugarComponents[0].mCID, - sSugarComponents[0].mDescription, - sSugarComponents[0].mContractID, - contentHandlerFactory); + nsCOMPtr contentHandlerFactory; + rv = NS_NewGeckoContentHandlerFactory(getter_AddRefs(contentHandlerFactory)); + rv = componentRegistrar->RegisterFactory(sSugarComponents[0].mCID, + sSugarComponents[0].mDescription, + sSugarComponents[0].mContractID, + contentHandlerFactory); if (NS_FAILED(rv)) { g_warning ("Failed to register factory for %s\n", sSugarComponents[0].mDescription); return FALSE; } - nsCOMPtr downloadFactory; - rv = NS_NewGeckoDownloadFactory(getter_AddRefs(downloadFactory)); - rv = componentRegistrar->RegisterFactory(sSugarComponents[1].mCID, - sSugarComponents[1].mDescription, - sSugarComponents[1].mContractID, - downloadFactory); + nsCOMPtr downloadFactory; + rv = NS_NewGeckoDownloadFactory(getter_AddRefs(downloadFactory)); + rv = componentRegistrar->RegisterFactory(sSugarComponents[1].mCID, + sSugarComponents[1].mDescription, + sSugarComponents[1].mContractID, + downloadFactory); if (NS_FAILED(rv)) { g_warning ("Failed to register factory for %s\n", sSugarComponents[1].mDescription); return FALSE; @@ -372,7 +372,6 @@ sugar_browser_scroll_pixels(SugarBrowser *browser, int dx, int dy) { -#ifndef HAVE_GECKO_1_9 nsCOMPtr webBrowser; gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED(browser), getter_AddRefs(webBrowser)); @@ -390,7 +389,6 @@ sugar_browser_scroll_pixels(SugarBrowser *browser, NS_ENSURE_TRUE (DOMWindow, ); DOMWindow->ScrollBy (dx, dy); -#endif } void