From f4291c82db9f02aadbedd3ee7a3f4643e97c585e Mon Sep 17 00:00:00 2001 From: "dbaron%fas.harvard.edu" Date: Sun, 4 Feb 2001 19:39:56 +0000 Subject: [PATCH] Convert correct usage of |nsCOMPtr::operator&| to use |address_of| since the operator& will soon become private. b=59414 r=disttsc@bart.nl git-svn-id: svn://10.0.0.236/trunk@86185 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/base/nsHTMLEditRules.cpp | 8 +++++--- mozilla/editor/base/nsPlaintextEditor.cpp | 12 ++++++------ mozilla/editor/libeditor/html/nsHTMLEditRules.cpp | 8 +++++--- mozilla/editor/libeditor/text/nsPlaintextEditor.cpp | 12 ++++++------ 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/mozilla/editor/base/nsHTMLEditRules.cpp b/mozilla/editor/base/nsHTMLEditRules.cpp index 6480dd0c68e..52159b44dda 100644 --- a/mozilla/editor/base/nsHTMLEditRules.cpp +++ b/mozilla/editor/base/nsHTMLEditRules.cpp @@ -822,10 +822,12 @@ nsHTMLEditRules::WillInsert(nsISelection *aSelection, PRBool *aCancel) nsCOMPtr selNode, priorNode; PRInt32 selOffset; // get the (collapsed) selection location - res = mHTMLEditor->GetStartNodeAndOffset(aSelection, &selNode, &selOffset); + res = mHTMLEditor->GetStartNodeAndOffset(aSelection, address_of(selNode), + &selOffset); if (NS_FAILED(res)) return res; // get prior node - res = mHTMLEditor->GetPriorHTMLNode(selNode, selOffset, &priorNode); + res = mHTMLEditor->GetPriorHTMLNode(selNode, selOffset, + address_of(priorNode)); if (NS_SUCCEEDED(res) && priorNode && nsHTMLEditUtils::IsMozBR(priorNode)) { nsCOMPtr block1, block2; @@ -838,7 +840,7 @@ nsHTMLEditRules::WillInsert(nsISelection *aSelection, PRBool *aCancel) // if we are here then the selection is right after a mozBR // that is in the same block as the selection. We need to move // the selection start to be before the mozBR. - res = nsEditor::GetNodeLocation(priorNode, &selNode, &selOffset); + res = nsEditor::GetNodeLocation(priorNode, address_of(selNode), &selOffset); if (NS_FAILED(res)) return res; res = aSelection->Collapse(selNode,selOffset); if (NS_FAILED(res)) return res; diff --git a/mozilla/editor/base/nsPlaintextEditor.cpp b/mozilla/editor/base/nsPlaintextEditor.cpp index 6c4d2867e85..762ed7275f5 100644 --- a/mozilla/editor/base/nsPlaintextEditor.cpp +++ b/mozilla/editor/base/nsPlaintextEditor.cpp @@ -597,7 +597,7 @@ NS_IMETHODIMP nsPlaintextEditor::CreateBRImpl(nsCOMPtr *aInOutParent PRInt32 offset; PRUint32 len; nodeAsText->GetLength(&len); - GetNodeLocation(node, &tmp, &offset); + GetNodeLocation(node, address_of(tmp), &offset); if (!tmp) return NS_ERROR_FAILURE; if (!theOffset) { @@ -613,7 +613,7 @@ NS_IMETHODIMP nsPlaintextEditor::CreateBRImpl(nsCOMPtr *aInOutParent // split the text node res = SplitNode(node, theOffset, getter_AddRefs(tmp)); if (NS_FAILED(res)) return res; - res = GetNodeLocation(node, &tmp, &offset); + res = GetNodeLocation(node, address_of(tmp), &offset); if (NS_FAILED(res)) return res; } // create br @@ -638,7 +638,7 @@ NS_IMETHODIMP nsPlaintextEditor::CreateBRImpl(nsCOMPtr *aInOutParent res = GetSelection(getter_AddRefs(selection)); if (NS_FAILED(res)) return res; nsCOMPtr selPriv(do_QueryInterface(selection)); - res = GetNodeLocation(*outBRNode, &parent, &offset); + res = GetNodeLocation(*outBRNode, address_of(parent), &offset); if (NS_FAILED(res)) return res; if (aSelect == eNext) { @@ -661,7 +661,7 @@ NS_IMETHODIMP nsPlaintextEditor::CreateBR(nsIDOMNode *aNode, PRInt32 aOffset, ns { nsCOMPtr parent = aNode; PRInt32 offset = aOffset; - return CreateBRImpl(&parent, &offset, outBRNode, aSelect); + return CreateBRImpl(address_of(parent), &offset, outBRNode, aSelect); } NS_IMETHODIMP nsPlaintextEditor::InsertBR(nsCOMPtr *outBRNode) @@ -687,14 +687,14 @@ NS_IMETHODIMP nsPlaintextEditor::InsertBR(nsCOMPtr *outBRNode) } nsCOMPtr selNode; PRInt32 selOffset; - res = GetStartNodeAndOffset(selection, &selNode, &selOffset); + res = GetStartNodeAndOffset(selection, address_of(selNode), &selOffset); if (NS_FAILED(res)) return res; res = CreateBR(selNode, selOffset, outBRNode); if (NS_FAILED(res)) return res; // position selection after br - res = GetNodeLocation(*outBRNode, &selNode, &selOffset); + res = GetNodeLocation(*outBRNode, address_of(selNode), &selOffset); if (NS_FAILED(res)) return res; selPriv->SetInterlinePosition(PR_TRUE); res = selection->Collapse(selNode, selOffset+1); diff --git a/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp b/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp index 6480dd0c68e..52159b44dda 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp @@ -822,10 +822,12 @@ nsHTMLEditRules::WillInsert(nsISelection *aSelection, PRBool *aCancel) nsCOMPtr selNode, priorNode; PRInt32 selOffset; // get the (collapsed) selection location - res = mHTMLEditor->GetStartNodeAndOffset(aSelection, &selNode, &selOffset); + res = mHTMLEditor->GetStartNodeAndOffset(aSelection, address_of(selNode), + &selOffset); if (NS_FAILED(res)) return res; // get prior node - res = mHTMLEditor->GetPriorHTMLNode(selNode, selOffset, &priorNode); + res = mHTMLEditor->GetPriorHTMLNode(selNode, selOffset, + address_of(priorNode)); if (NS_SUCCEEDED(res) && priorNode && nsHTMLEditUtils::IsMozBR(priorNode)) { nsCOMPtr block1, block2; @@ -838,7 +840,7 @@ nsHTMLEditRules::WillInsert(nsISelection *aSelection, PRBool *aCancel) // if we are here then the selection is right after a mozBR // that is in the same block as the selection. We need to move // the selection start to be before the mozBR. - res = nsEditor::GetNodeLocation(priorNode, &selNode, &selOffset); + res = nsEditor::GetNodeLocation(priorNode, address_of(selNode), &selOffset); if (NS_FAILED(res)) return res; res = aSelection->Collapse(selNode,selOffset); if (NS_FAILED(res)) return res; diff --git a/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp b/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp index 6c4d2867e85..762ed7275f5 100644 --- a/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp +++ b/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp @@ -597,7 +597,7 @@ NS_IMETHODIMP nsPlaintextEditor::CreateBRImpl(nsCOMPtr *aInOutParent PRInt32 offset; PRUint32 len; nodeAsText->GetLength(&len); - GetNodeLocation(node, &tmp, &offset); + GetNodeLocation(node, address_of(tmp), &offset); if (!tmp) return NS_ERROR_FAILURE; if (!theOffset) { @@ -613,7 +613,7 @@ NS_IMETHODIMP nsPlaintextEditor::CreateBRImpl(nsCOMPtr *aInOutParent // split the text node res = SplitNode(node, theOffset, getter_AddRefs(tmp)); if (NS_FAILED(res)) return res; - res = GetNodeLocation(node, &tmp, &offset); + res = GetNodeLocation(node, address_of(tmp), &offset); if (NS_FAILED(res)) return res; } // create br @@ -638,7 +638,7 @@ NS_IMETHODIMP nsPlaintextEditor::CreateBRImpl(nsCOMPtr *aInOutParent res = GetSelection(getter_AddRefs(selection)); if (NS_FAILED(res)) return res; nsCOMPtr selPriv(do_QueryInterface(selection)); - res = GetNodeLocation(*outBRNode, &parent, &offset); + res = GetNodeLocation(*outBRNode, address_of(parent), &offset); if (NS_FAILED(res)) return res; if (aSelect == eNext) { @@ -661,7 +661,7 @@ NS_IMETHODIMP nsPlaintextEditor::CreateBR(nsIDOMNode *aNode, PRInt32 aOffset, ns { nsCOMPtr parent = aNode; PRInt32 offset = aOffset; - return CreateBRImpl(&parent, &offset, outBRNode, aSelect); + return CreateBRImpl(address_of(parent), &offset, outBRNode, aSelect); } NS_IMETHODIMP nsPlaintextEditor::InsertBR(nsCOMPtr *outBRNode) @@ -687,14 +687,14 @@ NS_IMETHODIMP nsPlaintextEditor::InsertBR(nsCOMPtr *outBRNode) } nsCOMPtr selNode; PRInt32 selOffset; - res = GetStartNodeAndOffset(selection, &selNode, &selOffset); + res = GetStartNodeAndOffset(selection, address_of(selNode), &selOffset); if (NS_FAILED(res)) return res; res = CreateBR(selNode, selOffset, outBRNode); if (NS_FAILED(res)) return res; // position selection after br - res = GetNodeLocation(*outBRNode, &selNode, &selOffset); + res = GetNodeLocation(*outBRNode, address_of(selNode), &selOffset); if (NS_FAILED(res)) return res; selPriv->SetInterlinePosition(PR_TRUE); res = selection->Collapse(selNode, selOffset+1);