зеркало из https://github.com/mozilla/gecko-dev.git
r=rpotts, sr=mscott. cleaning up leakage, removing un-needed Init() method and ditching PR_FREE usage. 78912
This commit is contained in:
Родитель
d15ecc02ad
Коммит
225aa6fa96
|
@ -114,7 +114,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMsgWindow,Init)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMsgServiceProviderService, Init);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSubscribeDataSource, Init);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSubscribableServer, Init);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMsgPrintEngine, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgPrintEngine)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFolderCompactState)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsOfflineStoreCompactState)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgThreadedDBView);
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
#include "nsIPresContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIContentViewerFile.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsIMsgMessageService.h"
|
||||
#include "nsMsgUtils.h"
|
||||
#include "nsIWebProgress.h"
|
||||
|
@ -44,7 +42,6 @@
|
|||
|
||||
// Interfaces Needed
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDocShellTreeNode.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
|
@ -54,15 +51,11 @@
|
|||
// nsMsgPrintEngine implementation
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static NS_DEFINE_CID(kMsgMailSessionCID, NS_MSGMAILSESSION_CID);
|
||||
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
||||
|
||||
nsMsgPrintEngine::nsMsgPrintEngine()
|
||||
{
|
||||
mCurrentlyPrintingURI = -1;
|
||||
mContentViewer = nsnull;
|
||||
mViewerFile = nsnull;
|
||||
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
|
@ -72,21 +65,12 @@ nsMsgPrintEngine::~nsMsgPrintEngine()
|
|||
}
|
||||
|
||||
// Implement AddRef and Release
|
||||
NS_IMPL_ADDREF(nsMsgPrintEngine)
|
||||
NS_IMPL_RELEASE(nsMsgPrintEngine)
|
||||
|
||||
NS_IMPL_QUERY_INTERFACE4(nsMsgPrintEngine,
|
||||
NS_IMPL_ISUPPORTS4(nsMsgPrintEngine,
|
||||
nsIMsgPrintEngine,
|
||||
nsIWebProgressListener,
|
||||
nsISupportsWeakReference,
|
||||
nsIPrintListener);
|
||||
|
||||
nsresult nsMsgPrintEngine::Init()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// nsIWebProgressListener implementation
|
||||
NS_IMETHODIMP
|
||||
nsMsgPrintEngine::OnStateChange(nsIWebProgress* aWebProgress,
|
||||
|
@ -102,7 +86,7 @@ nsMsgPrintEngine::OnStateChange(nsIWebProgress* aWebProgress,
|
|||
// Tell the user we are loading...
|
||||
PRUnichar *msg = GetString(NS_ConvertASCIItoUCS2("LoadingMessageToPrint").GetUnicode());
|
||||
SetStatusMessage( msg );
|
||||
PR_FREEIF(msg);
|
||||
if (msg) nsCRT::free(msg);
|
||||
}
|
||||
|
||||
if (progressStateFlags & nsIWebProgressListener::STATE_STOP) {
|
||||
|
@ -112,7 +96,7 @@ nsMsgPrintEngine::OnStateChange(nsIWebProgress* aWebProgress,
|
|||
// Tell the user the message is loaded...
|
||||
PRUnichar *msg = GetString(NS_ConvertASCIItoUCS2("MessageLoaded").GetUnicode());
|
||||
SetStatusMessage( msg );
|
||||
PR_FREEIF(msg);
|
||||
if (msg) nsCRT::free(msg);
|
||||
|
||||
NS_ASSERTION(mDocShell,"can't print, there is no docshell");
|
||||
if ( (!mDocShell) || (!aRequest) )
|
||||
|
@ -159,7 +143,7 @@ nsMsgPrintEngine::OnStateChange(nsIWebProgress* aWebProgress,
|
|||
// Tell the user we started printing...
|
||||
msg = GetString(NS_LITERAL_STRING("PrintingMessage").get());
|
||||
SetStatusMessage( msg );
|
||||
PR_FREEIF(msg);
|
||||
if (msg) nsCRT::free(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -287,7 +271,7 @@ nsMsgPrintEngine::StartNextPrintOperation()
|
|||
// Tell the user we are done...
|
||||
PRUnichar *msg = GetString(NS_ConvertASCIItoUCS2("PrintingComplete").GetUnicode());
|
||||
SetStatusMessage( msg );
|
||||
PR_FREEIF(msg);
|
||||
if (msg) nsCRT::free(msg);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -336,7 +320,7 @@ nsMsgPrintEngine::FireThatLoadOperation(nsString *uri)
|
|||
rv = webNav->LoadURI(uri->GetUnicode(), nsIWebNavigation::LOAD_FLAGS_NONE);
|
||||
}
|
||||
|
||||
PR_FREEIF(tString);
|
||||
if (tString) nsCRT::free(tString);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -398,13 +382,10 @@ nsMsgPrintEngine::OnEndPrinting(PRUint32 aStatus)
|
|||
nsresult
|
||||
nsMsgPrintEngine::SetStatusMessage(PRUnichar *aMsgString)
|
||||
{
|
||||
PRUnichar *progressMsg;
|
||||
|
||||
if ( (!mFeedback) || (!aMsgString) )
|
||||
return NS_OK;
|
||||
|
||||
progressMsg = nsCRT::strdup(aMsgString);
|
||||
mFeedback->ShowStatusString(progressMsg);
|
||||
mFeedback->ShowStatusString(aMsgString);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,8 +51,6 @@ public:
|
|||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Init();
|
||||
|
||||
// nsIMsgPrintEngine interface
|
||||
NS_DECL_NSIMSGPRINTENGINE
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче