mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-31 19:10:36 +00:00
Bug 554253 - Convert nsCOMPtr<nsPresContext> to nsRefPtr<nsPresContext>. r=roc
--HG-- extra : rebase_source : d828daca07188864d055f3d1a72f5217632eb358
This commit is contained in:
parent
f90168fb7f
commit
fd9001c409
@ -3998,7 +3998,7 @@ nsDocument::DispatchContentLoadedEvents()
|
||||
|
||||
nsIPresShell *shell = parent->GetPrimaryShell();
|
||||
if (shell) {
|
||||
nsCOMPtr<nsPresContext> context = shell->GetPresContext();
|
||||
nsRefPtr<nsPresContext> context = shell->GetPresContext();
|
||||
|
||||
if (context) {
|
||||
nsEventDispatcher::Dispatch(parent, context, innerEvent, event,
|
||||
@ -6198,7 +6198,7 @@ nsDocument::DispatchEvent(nsIDOMEvent* aEvent, PRBool *_retval)
|
||||
{
|
||||
// Obtain a presentation context
|
||||
nsIPresShell *shell = GetPrimaryShell();
|
||||
nsCOMPtr<nsPresContext> context;
|
||||
nsRefPtr<nsPresContext> context;
|
||||
if (shell) {
|
||||
context = shell->GetPresContext();
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ nsScriptElement::ScriptAvailable(nsresult aResult,
|
||||
nsCOMPtr<nsIContent> cont =
|
||||
do_QueryInterface((nsIScriptElement*) this);
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext =
|
||||
nsRefPtr<nsPresContext> presContext =
|
||||
nsContentUtils::GetContextForContent(cont);
|
||||
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
@ -91,7 +91,7 @@ nsScriptElement::ScriptEvaluated(nsresult aResult,
|
||||
nsCOMPtr<nsIContent> cont =
|
||||
do_QueryInterface((nsIScriptElement*) this);
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext =
|
||||
nsRefPtr<nsPresContext> presContext =
|
||||
nsContentUtils::GetContextForContent(cont);
|
||||
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
@ -3333,7 +3333,7 @@ nsCanvasRenderingContext2D::DrawWindow(nsIDOMWindow* aWindow, float aX, float aY
|
||||
if (!(flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DO_NOT_FLUSH))
|
||||
FlushLayoutForTree(aWindow);
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(aWindow);
|
||||
if (win) {
|
||||
nsIDocShell* docshell = win->GetDocShell();
|
||||
|
@ -231,7 +231,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMEvent)
|
||||
break;
|
||||
}
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mPresContext)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mPresContext.get(), nsPresContext)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTmpRealOriginalTarget)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mExplicitOriginalTarget)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
@ -209,7 +209,7 @@ protected:
|
||||
nsresult ReportWrongPropertyAccessWarning(const char* aPropertyName);
|
||||
|
||||
nsEvent* mEvent;
|
||||
nsCOMPtr<nsPresContext> mPresContext;
|
||||
nsRefPtr<nsPresContext> mPresContext;
|
||||
nsCOMPtr<nsIDOMEventTarget> mTmpRealOriginalTarget;
|
||||
nsCOMPtr<nsIDOMEventTarget> mExplicitOriginalTarget;
|
||||
nsString mCachedType;
|
||||
|
@ -507,7 +507,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
|
||||
|
||||
// If we have a PresContext, make sure it doesn't die before
|
||||
// event dispatching is finished.
|
||||
nsCOMPtr<nsPresContext> kungFuDeathGrip(aPresContext);
|
||||
nsRefPtr<nsPresContext> kungFuDeathGrip(aPresContext);
|
||||
ChainItemPool pool;
|
||||
NS_ENSURE_TRUE(pool.GetPool(), NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
|
@ -1314,7 +1314,7 @@ nsEventListenerManager::DispatchEvent(nsIDOMEvent* aEvent, PRBool *_retval)
|
||||
|
||||
// Obtain a presentation shell
|
||||
nsIPresShell *shell = document->GetPrimaryShell();
|
||||
nsCOMPtr<nsPresContext> context;
|
||||
nsRefPtr<nsPresContext> context;
|
||||
if (shell) {
|
||||
context = shell->GetPresContext();
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ PrintDocTree(nsIDocShellTreeItem* aParentItem, int aLevel)
|
||||
aParentItem->GetItemType(&type);
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
parentAsDocShell->GetPresShell(getter_AddRefs(presShell));
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
parentAsDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
nsCOMPtr<nsIContentViewer> cv;
|
||||
parentAsDocShell->GetContentViewer(getter_AddRefs(cv));
|
||||
@ -3469,9 +3469,9 @@ nsEventStateManager::NotifyMouseOut(nsGUIEvent* aEvent, nsIContent* aMovingInto)
|
||||
nsCOMPtr<nsIDocShell> docshell;
|
||||
subdocFrame->GetDocShell(getter_AddRefs(docshell));
|
||||
if (docshell) {
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
docshell->GetPresContext(getter_AddRefs(presContext));
|
||||
|
||||
|
||||
if (presContext) {
|
||||
nsEventStateManager* kidESM =
|
||||
static_cast<nsEventStateManager*>(presContext->EventStateManager());
|
||||
|
@ -217,7 +217,7 @@ nsHTMLButtonElement::Click()
|
||||
if (doc) {
|
||||
nsIPresShell *shell = doc->GetPrimaryShell();
|
||||
if (shell) {
|
||||
nsCOMPtr<nsPresContext> context = shell->GetPresContext();
|
||||
nsRefPtr<nsPresContext> context = shell->GetPresContext();
|
||||
if (context) {
|
||||
// Click() is never called from native code, but it may be
|
||||
// called from chrome JS. Mark this event trusted if Click()
|
||||
|
@ -392,7 +392,7 @@ nsHTMLFormElement::Submit()
|
||||
{
|
||||
// Send the submit event
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsPresContext> presContext = GetPresContext();
|
||||
nsRefPtr<nsPresContext> presContext = GetPresContext();
|
||||
if (mPendingSubmission) {
|
||||
// aha, we have a pending submission that was not flushed
|
||||
// (this happens when form.submit() is called twice)
|
||||
|
@ -1397,7 +1397,7 @@ nsHTMLInputElement::FireOnChange()
|
||||
//
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
nsEvent event(PR_TRUE, NS_FORM_CHANGE);
|
||||
nsCOMPtr<nsPresContext> presContext = GetPresContext();
|
||||
nsRefPtr<nsPresContext> presContext = GetPresContext();
|
||||
nsEventDispatcher::Dispatch(static_cast<nsIContent*>(this), presContext,
|
||||
&event, nsnull, &status);
|
||||
}
|
||||
@ -1455,7 +1455,7 @@ nsHTMLInputElement::Select()
|
||||
|
||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext = GetPresContext();
|
||||
nsRefPtr<nsPresContext> presContext = GetPresContext();
|
||||
if (state == eInactiveWindow) {
|
||||
if (fm)
|
||||
fm->SetFocus(this, nsIFocusManager::FLAG_NOSCROLL);
|
||||
@ -1536,9 +1536,9 @@ nsHTMLInputElement::Click()
|
||||
if (!doc) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell = doc->GetPrimaryShell();
|
||||
nsCOMPtr<nsPresContext> context = nsnull;
|
||||
nsRefPtr<nsPresContext> context = nsnull;
|
||||
if (shell) {
|
||||
context = shell->GetPresContext();
|
||||
}
|
||||
@ -1876,7 +1876,7 @@ nsHTMLInputElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
|
||||
fm->GetLastFocusMethod(document->GetWindow(), &lastFocusMethod);
|
||||
if (lastFocusMethod &
|
||||
(nsIFocusManager::FLAG_BYKEY | nsIFocusManager::FLAG_BYMOVEFOCUS)) {
|
||||
nsCOMPtr<nsPresContext> presContext = GetPresContext();
|
||||
nsRefPtr<nsPresContext> presContext = GetPresContext();
|
||||
if (DispatchSelectEvent(presContext)) {
|
||||
SelectAll(presContext);
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ nsHTMLTextAreaElement::Select()
|
||||
|
||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext = GetPresContext();
|
||||
nsRefPtr<nsPresContext> presContext = GetPresContext();
|
||||
if (state == eInactiveWindow) {
|
||||
if (fm)
|
||||
fm->SetFocus(this, nsIFocusManager::FLAG_NOSCROLL);
|
||||
|
@ -2058,7 +2058,7 @@ nsXULElement::Click()
|
||||
nsCOMPtr<nsIPresShell> shell = doc->GetPrimaryShell();
|
||||
if (shell) {
|
||||
// strong ref to PresContext so events don't destroy it
|
||||
nsCOMPtr<nsPresContext> context = shell->GetPresContext();
|
||||
nsRefPtr<nsPresContext> context = shell->GetPresContext();
|
||||
|
||||
PRBool isCallerChrome = nsContentUtils::IsCallerChrome();
|
||||
|
||||
|
@ -437,7 +437,7 @@ nsXULCommandDispatcher::UpdateCommands(const nsAString& aEventName)
|
||||
if (shell) {
|
||||
|
||||
// Retrieve the context in which our DOM event will fire.
|
||||
nsCOMPtr<nsPresContext> context = shell->GetPresContext();
|
||||
nsRefPtr<nsPresContext> context = shell->GetPresContext();
|
||||
|
||||
// Handle the DOM event
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
@ -948,7 +948,7 @@ nsXULDocument::ExecuteOnBroadcastHandlerFor(nsIContent* aBroadcaster,
|
||||
nsCOMPtr<nsIPresShell> shell = GetPrimaryShell();
|
||||
if (shell) {
|
||||
|
||||
nsCOMPtr<nsPresContext> aPresContext = shell->GetPresContext();
|
||||
nsRefPtr<nsPresContext> aPresContext = shell->GetPresContext();
|
||||
|
||||
// Handle the DOM event
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
@ -1606,7 +1606,7 @@ nsDocShell::GetPresShell(nsIPresShell ** aPresShell)
|
||||
NS_ENSURE_ARG_POINTER(aPresShell);
|
||||
*aPresShell = nsnull;
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
(void) GetPresContext(getter_AddRefs(presContext));
|
||||
|
||||
if (presContext) {
|
||||
@ -1624,7 +1624,7 @@ nsDocShell::GetEldestPresShell(nsIPresShell** aPresShell)
|
||||
NS_ENSURE_ARG_POINTER(aPresShell);
|
||||
*aPresShell = nsnull;
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
(void) GetEldestPresContext(getter_AddRefs(presContext));
|
||||
|
||||
if (presContext) {
|
||||
@ -2814,7 +2814,7 @@ PrintDocTree(nsIDocShellTreeItem * aParentNode, int aLevel)
|
||||
aParentNode->GetItemType(&type);
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
parentAsDocShell->GetPresShell(getter_AddRefs(presShell));
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
parentAsDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
nsIDocument *doc = presShell->GetDocument();
|
||||
|
||||
|
@ -108,7 +108,7 @@ nsDOMWindowUtils::GetPresContext()
|
||||
nsIDocShell *docShell = mWindow->GetDocShell();
|
||||
if (!docShell)
|
||||
return nsnull;
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
docShell->GetPresContext(getter_AddRefs(presContext));
|
||||
return presContext;
|
||||
}
|
||||
|
@ -1671,7 +1671,7 @@ public:
|
||||
|
||||
nsCOMPtr<nsISupports> mTarget;
|
||||
PRUint32 mType;
|
||||
nsCOMPtr<nsPresContext> mContext;
|
||||
nsRefPtr<nsPresContext> mContext;
|
||||
PRBool mWindowRaised;
|
||||
};
|
||||
|
||||
|
@ -3202,8 +3202,8 @@ nsGlobalWindow::DevToCSSIntPixels(PRInt32 px)
|
||||
{
|
||||
if (!mDocShell)
|
||||
return px; // assume 1:1
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
mDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
if (!presContext)
|
||||
return px;
|
||||
@ -3216,8 +3216,8 @@ nsGlobalWindow::CSSToDevIntPixels(PRInt32 px)
|
||||
{
|
||||
if (!mDocShell)
|
||||
return px; // assume 1:1
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
mDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
if (!presContext)
|
||||
return px;
|
||||
@ -3230,12 +3230,12 @@ nsGlobalWindow::DevToCSSIntPixels(nsIntSize px)
|
||||
{
|
||||
if (!mDocShell)
|
||||
return px; // assume 1:1
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
mDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
if (!presContext)
|
||||
return px;
|
||||
|
||||
|
||||
return nsIntSize(
|
||||
presContext->DevPixelsToIntCSSPixels(px.width),
|
||||
presContext->DevPixelsToIntCSSPixels(px.height));
|
||||
@ -3246,12 +3246,12 @@ nsGlobalWindow::CSSToDevIntPixels(nsIntSize px)
|
||||
{
|
||||
if (!mDocShell)
|
||||
return px; // assume 1:1
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
mDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
if (!presContext)
|
||||
return px;
|
||||
|
||||
|
||||
return nsIntSize(
|
||||
presContext->CSSPixelsToDevPixels(px.width),
|
||||
presContext->CSSPixelsToDevPixels(px.height));
|
||||
@ -3268,7 +3268,7 @@ nsGlobalWindow::GetInnerWidth(PRInt32* aInnerWidth)
|
||||
EnsureSizeUpToDate();
|
||||
|
||||
nsCOMPtr<nsIBaseWindow> docShellWin(do_QueryInterface(mDocShell));
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
mDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
|
||||
if (docShellWin && presContext) {
|
||||
@ -3331,7 +3331,7 @@ nsGlobalWindow::GetInnerHeight(PRInt32* aInnerHeight)
|
||||
EnsureSizeUpToDate();
|
||||
|
||||
nsCOMPtr<nsIBaseWindow> docShellWin(do_QueryInterface(mDocShell));
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
mDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
|
||||
if (docShellWin && presContext) {
|
||||
@ -6579,7 +6579,7 @@ nsGlobalWindow::DispatchEvent(nsIDOMEvent* aEvent, PRBool* _retval)
|
||||
|
||||
// Obtain a presentation shell
|
||||
nsIPresShell *shell = mDoc->GetPrimaryShell();
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
if (shell) {
|
||||
// Retrieve the context
|
||||
presContext = shell->GetPresContext();
|
||||
@ -7089,7 +7089,7 @@ nsGlobalWindow::DispatchSyncPopState()
|
||||
|
||||
// Obtain a presentation shell for use in creating a popstate event.
|
||||
nsIPresShell *shell = mDoc->GetPrimaryShell();
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
if (shell) {
|
||||
presContext = shell->GetPresContext();
|
||||
}
|
||||
@ -9344,7 +9344,7 @@ nsGlobalChromeWindow::SetCursor(const nsAString& aCursor)
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
if (mDocShell) {
|
||||
mDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ NS_HandleScriptError(nsIScriptGlobalObject *aScriptGlobal,
|
||||
nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(aScriptGlobal));
|
||||
nsIDocShell *docShell = win ? win->GetDocShell() : nsnull;
|
||||
if (docShell) {
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
docShell->GetPresContext(getter_AddRefs(presContext));
|
||||
|
||||
static PRInt32 errorDepth; // Recursion prevention
|
||||
@ -439,7 +439,7 @@ public:
|
||||
!sHandlingScriptError) {
|
||||
sHandlingScriptError = PR_TRUE; // Recursion prevention
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
docShell->GetPresContext(getter_AddRefs(presContext));
|
||||
|
||||
if (presContext) {
|
||||
|
@ -114,7 +114,7 @@ nsSetDocumentOptionsCommand::DoCommandParams(const char *aCommandName,
|
||||
nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
|
||||
if (!editor) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
nsresult rv = GetPresContextFromEditor(editor, getter_AddRefs(presContext));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (!presContext) return NS_ERROR_FAILURE;
|
||||
@ -165,7 +165,7 @@ nsSetDocumentOptionsCommand::GetCommandStateParams(const char *aCommandName,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// get pres context
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
rv = GetPresContextFromEditor(editor, getter_AddRefs(presContext));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (!presContext) return NS_ERROR_FAILURE;
|
||||
|
@ -428,7 +428,7 @@ nsDocShellTreeOwner::SizeShellTo(nsIDocShellTreeItem* aShellItem,
|
||||
Set the preferred size on the aShellItem.
|
||||
*/
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
mWebBrowser->mDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE);
|
||||
|
||||
|
@ -428,7 +428,7 @@ protected:
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
nsCOMPtr<nsIWidget> mWindow; // may be null
|
||||
nsCOMPtr<nsIViewManager> mViewManager;
|
||||
nsCOMPtr<nsPresContext> mPresContext;
|
||||
nsRefPtr<nsPresContext> mPresContext;
|
||||
nsCOMPtr<nsIPresShell> mPresShell;
|
||||
|
||||
nsCOMPtr<nsISelectionListener> mSelectionListener;
|
||||
@ -1315,7 +1315,7 @@ AttachContainerRecurse(nsIDocShell* aShell)
|
||||
if (doc) {
|
||||
doc->SetContainer(aShell);
|
||||
}
|
||||
nsCOMPtr<nsPresContext> pc;
|
||||
nsRefPtr<nsPresContext> pc;
|
||||
docViewer->GetPresContext(getter_AddRefs(pc));
|
||||
if (pc) {
|
||||
pc->SetContainer(aShell);
|
||||
@ -1443,7 +1443,7 @@ DetachContainerRecurse(nsIDocShell *aShell)
|
||||
if (doc) {
|
||||
doc->SetContainer(nsnull);
|
||||
}
|
||||
nsCOMPtr<nsPresContext> pc;
|
||||
nsRefPtr<nsPresContext> pc;
|
||||
docViewer->GetPresContext(getter_AddRefs(pc));
|
||||
if (pc) {
|
||||
pc->SetContainer(nsnull);
|
||||
@ -3181,7 +3181,7 @@ NS_IMETHODIMP DocumentViewerImpl::SizeToContent()
|
||||
nsresult rv = presShell->ResizeReflow(prefWidth, NS_UNCONSTRAINEDSIZE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
GetPresContext(getter_AddRefs(presContext));
|
||||
NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE);
|
||||
|
||||
|
@ -320,7 +320,7 @@ nsPresContext::~nsPresContext()
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsPresContext)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsPresContext)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIObserver)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIObserver)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
|
@ -7908,7 +7908,7 @@ PresShell::VerifyIncrementalReflow()
|
||||
}
|
||||
|
||||
// Create a presentation context to view the new frame tree
|
||||
nsCOMPtr<nsPresContext> cx =
|
||||
nsRefPtr<nsPresContext> cx =
|
||||
new nsRootPresContext(mDocument, mPresContext->IsPaginated() ?
|
||||
nsPresContext::eContext_PrintPreview :
|
||||
nsPresContext::eContext_Galley);
|
||||
|
@ -4690,7 +4690,7 @@ nsTypedSelection::RemoveAllRanges()
|
||||
{
|
||||
if (!mFrameSelection)
|
||||
return NS_OK;//nothing to do
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
GetPresContext(getter_AddRefs(presContext));
|
||||
|
||||
|
||||
@ -4741,7 +4741,7 @@ nsTypedSelection::AddRange(nsIRange* aRange)
|
||||
if (mType == nsISelectionController::SELECTION_NORMAL)
|
||||
SetInterlinePosition(PR_TRUE);
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
GetPresContext(getter_AddRefs(presContext));
|
||||
selectFrames(presContext, aRange, PR_TRUE);
|
||||
|
||||
@ -4798,7 +4798,7 @@ nsTypedSelection::RemoveRange(nsIRange* aRange)
|
||||
}
|
||||
|
||||
// clear the selected bit from the removed range's frames
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
GetPresContext(getter_AddRefs(presContext));
|
||||
selectFrames(presContext, aRange, PR_FALSE);
|
||||
|
||||
@ -4855,7 +4855,7 @@ nsTypedSelection::Collapse(nsINode* aParentNode, PRInt32 aOffset)
|
||||
return NS_ERROR_FAILURE;
|
||||
nsresult result;
|
||||
// Delete all of the current ranges
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
GetPresContext(getter_AddRefs(presContext));
|
||||
Clear(presContext);
|
||||
|
||||
@ -5022,7 +5022,7 @@ nsTypedSelection::CopyRangeToAnchorFocus(nsIRange *aRange)
|
||||
void
|
||||
nsTypedSelection::ReplaceAnchorFocusRange(nsIRange *aRange)
|
||||
{
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
GetPresContext(getter_AddRefs(presContext));
|
||||
if (presContext) {
|
||||
selectFrames(presContext, mAnchorFocusRange, PR_FALSE);
|
||||
@ -5124,7 +5124,7 @@ nsTypedSelection::Extend(nsINode* aParentNode, PRInt32 aOffset)
|
||||
if (result2 == 0) //not selecting anywhere
|
||||
return NS_OK;
|
||||
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
GetPresContext(getter_AddRefs(presContext));
|
||||
if ((result1 == 0 && result3 < 0) || (result1 <= 0 && result2 < 0)){//a1,2 a,1,2
|
||||
//select from 1 to 2 unless they are collapsed
|
||||
@ -5693,7 +5693,7 @@ nsTypedSelection::SelectionLanguageChange(PRBool aLangRTL)
|
||||
|
||||
PRInt32 frameStart, frameEnd;
|
||||
focusFrame->GetOffsets(frameStart, frameEnd);
|
||||
nsCOMPtr<nsPresContext> context;
|
||||
nsRefPtr<nsPresContext> context;
|
||||
PRUint8 levelBefore, levelAfter;
|
||||
result = GetPresContext(getter_AddRefs(context));
|
||||
if (NS_FAILED(result) || !context)
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
nsCOMPtr<nsIDocShell> mDocShell;
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
|
||||
nsCOMPtr<nsPresContext> mPresContext;
|
||||
nsRefPtr<nsPresContext> mPresContext;
|
||||
nsCOMPtr<nsIPresShell> mPresShell;
|
||||
nsCOMPtr<nsIViewManager> mViewManager;
|
||||
nsCOMPtr<nsIWidget> mWindow;
|
||||
|
@ -554,7 +554,7 @@ void
|
||||
nsStyleContext::Destroy()
|
||||
{
|
||||
// Get the pres context from our rule node.
|
||||
nsCOMPtr<nsPresContext> presContext = mRuleNode->GetPresContext();
|
||||
nsRefPtr<nsPresContext> presContext = mRuleNode->GetPresContext();
|
||||
|
||||
// Call our destructor.
|
||||
this->~nsStyleContext();
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include "nsRect.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsAlgorithm.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
#undef DEBUG_TABLE_CELLMAP
|
||||
|
||||
@ -610,7 +611,7 @@ protected:
|
||||
PRBool mIsBC;
|
||||
|
||||
// Prescontext to deallocate and allocate celldata
|
||||
nsCOMPtr<nsPresContext> mPresContext;
|
||||
nsRefPtr<nsPresContext> mPresContext;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
PRUint16 GetReflowDepth() { return mReflowDepth; }
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsPresContext> mPresContext;
|
||||
nsRefPtr<nsPresContext> mPresContext;
|
||||
nsIRenderingContext *mRenderingContext;
|
||||
PRUint32 mLayoutFlags;
|
||||
PRUint16 mReflowDepth;
|
||||
|
@ -117,7 +117,7 @@ nsImageBoxFrameEvent::Run()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPresContext> pres_context = pres_shell->GetPresContext();
|
||||
nsRefPtr<nsPresContext> pres_context = pres_shell->GetPresContext();
|
||||
if (!pres_context) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ public:
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIContent> mMenu;
|
||||
nsCOMPtr<nsPresContext> mPresContext;
|
||||
nsRefPtr<nsPresContext> mPresContext;
|
||||
PRBool mIsActivate;
|
||||
};
|
||||
|
||||
|
@ -736,7 +736,7 @@ PRBool nsWebShellWindow::ExecuteCloseHandler()
|
||||
nsCOMPtr<nsIDocumentViewer> docViewer(do_QueryInterface(contentViewer));
|
||||
|
||||
if (docViewer) {
|
||||
nsCOMPtr<nsPresContext> presContext;
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
docViewer->GetPresContext(getter_AddRefs(presContext));
|
||||
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
Loading…
x
Reference in New Issue
Block a user