fixing compilation problems with new nsCOMPtr. part of the carpool.

This commit is contained in:
danm%netscape.com 1999-02-17 06:18:11 +00:00
Родитель c347a8f5bd
Коммит aa7476884e
8 изменённых файлов: 26 добавлений и 26 удалений

Просмотреть файл

@ -348,7 +348,7 @@ nsresult DeleteRangeTxn::CreateTxnsToDeleteNodesBetween(nsIDOMNode *aCommonParen
result = temp->GetNextSibling(getter_AddRefs(child));
if ((NS_SUCCEEDED(result)) && child)
{
if (child==aLastChild)
if (child.get()==aLastChild)
{ // aFirstChild and aLastChild have the same parent, and we've reached aLastChild
needToProcessLastChild = PR_FALSE;
break;
@ -396,7 +396,7 @@ nsresult DeleteRangeTxn::CreateTxnsToDeleteNodesBetween(nsIDOMNode *aCommonParen
return NS_ERROR_NULL_POINTER;
}
}
if (parent==aCommonParent)
if (parent.get()==aCommonParent)
break;
child = parent;
nsCOMPtr<nsIDOMNode> temp=parent;
@ -412,7 +412,7 @@ nsresult DeleteRangeTxn::CreateTxnsToDeleteNodesBetween(nsIDOMNode *aCommonParen
result = child->GetParentNode(getter_AddRefs(parent));
while ((NS_SUCCEEDED(result)) && parent)
{
if (parent==aCommonParent)
if (parent.get()==aCommonParent)
break; // notice that when we go up the aLastChild parent chain, we don't touch aCommonParent
while ((NS_SUCCEEDED(result)) && child)
{ // this loop starts with the first sibling of an ancestor of aFirstChild

Просмотреть файл

@ -108,7 +108,7 @@ nsresult InsertTextTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
{
nsCOMPtr<nsIAtom> txnName;
otherTxn->GetName(getter_AddRefs(txnName));
if (txnName==gInsertTextTxnName)
if (txnName.get()==gInsertTextTxnName)
{ // yep, it's one of ours. By definition, it must contain only
// a single InsertTextTxn
nsCOMPtr<EditTxn> childTxn;

Просмотреть файл

@ -301,7 +301,7 @@ nsEditor::EnableUndo(PRBool aEnable)
nsresult nsEditor::CanUndo(PRBool &aIsEnabled, PRBool &aCanUndo)
{
aIsEnabled = ((PRBool)((nsITransactionManager *)0!=mTxnMgr));
aIsEnabled = ((PRBool)((nsITransactionManager *)0!=mTxnMgr.get()));
if (aIsEnabled)
{
PRInt32 numTxns=0;
@ -316,7 +316,7 @@ nsresult nsEditor::CanUndo(PRBool &aIsEnabled, PRBool &aCanUndo)
nsresult nsEditor::CanRedo(PRBool &aIsEnabled, PRBool &aCanRedo)
{
aIsEnabled = ((PRBool)((nsITransactionManager *)0!=mTxnMgr));
aIsEnabled = ((PRBool)((nsITransactionManager *)0!=mTxnMgr.get()));
if (aIsEnabled)
{
PRInt32 numTxns=0;
@ -553,7 +553,7 @@ nsEditor::Do(nsITransaction *aTxn)
nsresult result = NS_OK;
if (nsnull!=aTxn)
{
if ((nsITransactionManager *)nsnull!=mTxnMgr)
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
result = mTxnMgr->Do(aTxn);
}
@ -569,7 +569,7 @@ nsresult
nsEditor::Undo(PRUint32 aCount)
{
nsresult result = NS_OK;
if ((nsITransactionManager *)nsnull!=mTxnMgr)
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
PRUint32 i=0;
for ( ; i<aCount; i++)
@ -586,7 +586,7 @@ nsresult
nsEditor::Redo(PRUint32 aCount)
{
nsresult result = NS_OK;
if ((nsITransactionManager *)nsnull!=mTxnMgr)
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
PRUint32 i=0;
for ( ; i<aCount; i++)
@ -609,7 +609,7 @@ nsEditor::BeginTransaction()
mViewManager->DisableRefresh();
mUpdateCount++;
}
if ((nsITransactionManager *)nsnull!=mTxnMgr)
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
mTxnMgr->BeginBatch();
}
@ -626,7 +626,7 @@ nsEditor::EndTransaction()
if (0==mUpdateCount)
mViewManager->EnableRefresh();
}
if ((nsITransactionManager *)nsnull!=mTxnMgr)
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
mTxnMgr->EndBatch();
}

Просмотреть файл

@ -210,7 +210,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
if (PR_TRUE==ctrlKey)
{
aProcessed=PR_TRUE;
if ((nsITextEditor *)nsnull!=mEditor)
if ((nsITextEditor *)nsnull!=mEditor.get())
mEditor->Undo(1);
}
break;
@ -220,7 +220,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
if (PR_TRUE==ctrlKey)
{
aProcessed=PR_TRUE;
if ((nsITextEditor *)nsnull!=mEditor)
if ((nsITextEditor *)nsnull!=mEditor.get())
mEditor->Redo(1);
}
break;

Просмотреть файл

@ -348,7 +348,7 @@ nsresult DeleteRangeTxn::CreateTxnsToDeleteNodesBetween(nsIDOMNode *aCommonParen
result = temp->GetNextSibling(getter_AddRefs(child));
if ((NS_SUCCEEDED(result)) && child)
{
if (child==aLastChild)
if (child.get()==aLastChild)
{ // aFirstChild and aLastChild have the same parent, and we've reached aLastChild
needToProcessLastChild = PR_FALSE;
break;
@ -396,7 +396,7 @@ nsresult DeleteRangeTxn::CreateTxnsToDeleteNodesBetween(nsIDOMNode *aCommonParen
return NS_ERROR_NULL_POINTER;
}
}
if (parent==aCommonParent)
if (parent.get()==aCommonParent)
break;
child = parent;
nsCOMPtr<nsIDOMNode> temp=parent;
@ -412,7 +412,7 @@ nsresult DeleteRangeTxn::CreateTxnsToDeleteNodesBetween(nsIDOMNode *aCommonParen
result = child->GetParentNode(getter_AddRefs(parent));
while ((NS_SUCCEEDED(result)) && parent)
{
if (parent==aCommonParent)
if (parent.get()==aCommonParent)
break; // notice that when we go up the aLastChild parent chain, we don't touch aCommonParent
while ((NS_SUCCEEDED(result)) && child)
{ // this loop starts with the first sibling of an ancestor of aFirstChild

Просмотреть файл

@ -108,7 +108,7 @@ nsresult InsertTextTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
{
nsCOMPtr<nsIAtom> txnName;
otherTxn->GetName(getter_AddRefs(txnName));
if (txnName==gInsertTextTxnName)
if (txnName.get()==gInsertTextTxnName)
{ // yep, it's one of ours. By definition, it must contain only
// a single InsertTextTxn
nsCOMPtr<EditTxn> childTxn;

Просмотреть файл

@ -301,7 +301,7 @@ nsEditor::EnableUndo(PRBool aEnable)
nsresult nsEditor::CanUndo(PRBool &aIsEnabled, PRBool &aCanUndo)
{
aIsEnabled = ((PRBool)((nsITransactionManager *)0!=mTxnMgr));
aIsEnabled = ((PRBool)((nsITransactionManager *)0!=mTxnMgr.get()));
if (aIsEnabled)
{
PRInt32 numTxns=0;
@ -316,7 +316,7 @@ nsresult nsEditor::CanUndo(PRBool &aIsEnabled, PRBool &aCanUndo)
nsresult nsEditor::CanRedo(PRBool &aIsEnabled, PRBool &aCanRedo)
{
aIsEnabled = ((PRBool)((nsITransactionManager *)0!=mTxnMgr));
aIsEnabled = ((PRBool)((nsITransactionManager *)0!=mTxnMgr.get()));
if (aIsEnabled)
{
PRInt32 numTxns=0;
@ -553,7 +553,7 @@ nsEditor::Do(nsITransaction *aTxn)
nsresult result = NS_OK;
if (nsnull!=aTxn)
{
if ((nsITransactionManager *)nsnull!=mTxnMgr)
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
result = mTxnMgr->Do(aTxn);
}
@ -569,7 +569,7 @@ nsresult
nsEditor::Undo(PRUint32 aCount)
{
nsresult result = NS_OK;
if ((nsITransactionManager *)nsnull!=mTxnMgr)
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
PRUint32 i=0;
for ( ; i<aCount; i++)
@ -586,7 +586,7 @@ nsresult
nsEditor::Redo(PRUint32 aCount)
{
nsresult result = NS_OK;
if ((nsITransactionManager *)nsnull!=mTxnMgr)
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
PRUint32 i=0;
for ( ; i<aCount; i++)
@ -609,7 +609,7 @@ nsEditor::BeginTransaction()
mViewManager->DisableRefresh();
mUpdateCount++;
}
if ((nsITransactionManager *)nsnull!=mTxnMgr)
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
mTxnMgr->BeginBatch();
}
@ -626,7 +626,7 @@ nsEditor::EndTransaction()
if (0==mUpdateCount)
mViewManager->EnableRefresh();
}
if ((nsITransactionManager *)nsnull!=mTxnMgr)
if ((nsITransactionManager *)nsnull!=mTxnMgr.get())
{
mTxnMgr->EndBatch();
}

Просмотреть файл

@ -210,7 +210,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
if (PR_TRUE==ctrlKey)
{
aProcessed=PR_TRUE;
if ((nsITextEditor *)nsnull!=mEditor)
if ((nsITextEditor *)nsnull!=mEditor.get())
mEditor->Undo(1);
}
break;
@ -220,7 +220,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr
if (PR_TRUE==ctrlKey)
{
aProcessed=PR_TRUE;
if ((nsITextEditor *)nsnull!=mEditor)
if ((nsITextEditor *)nsnull!=mEditor.get())
mEditor->Redo(1);
}
break;