Changed transactions not to have owning pointers to the Editor.

git-svn-id: svn://10.0.0.236/trunk@33042 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sfraser%netscape.com 1999-05-28 00:13:02 +00:00
parent ecc686ddd7
commit a6a9b7ff1b
24 changed files with 26 additions and 28 deletions

View File

@ -37,7 +37,7 @@ NS_IMETHODIMP ChangeAttributeTxn::Init(nsIEditor *aEditor,
{
if (nsnull!=aEditor && nsnull!=aElement)
{
mEditor = do_QueryInterface(aEditor);
mEditor = aEditor;
mElement = do_QueryInterface(aElement);
mAttribute = aAttribute;
mValue = aValue;

View File

@ -36,6 +36,7 @@
class ChangeAttributeTxn : public EditTxn
{
public:
virtual ~ChangeAttributeTxn();
/** Initialize the transaction.
@ -73,7 +74,7 @@ public:
protected:
/** the editor that created this transaction */
nsCOMPtr<nsIEditor> mEditor;
nsIEditor* mEditor;
/** the element to operate upon */
nsCOMPtr<nsIDOMElement> mElement;

View File

@ -43,7 +43,7 @@ NS_IMETHODIMP CreateElementTxn::Init(nsIEditor *aEditor,
NS_ASSERTION(aEditor&&aParent, "null args");
if (aEditor && aParent)
{
mEditor = do_QueryInterface(aEditor);
mEditor = aEditor;
mTag = aTag;
mParent = do_QueryInterface(aParent);
mOffsetInParent = aOffsetInParent;

View File

@ -76,7 +76,7 @@ public:
protected:
/** the document into which the new node will be inserted */
nsCOMPtr<nsIEditor> mEditor;
nsIEditor* mEditor;
/** the tag (mapping to object type) for the new element */
nsString mTag;

View File

@ -34,7 +34,7 @@
class DeleteElementTxn : public EditTxn
{
public:
/** initialize the transaction.
* @param aElement the node to delete
*/

View File

@ -51,7 +51,7 @@ NS_IMETHODIMP DeleteRangeTxn::Init(nsIEditor *aEditor, nsIDOMRange *aRange)
{
if (aEditor && aRange)
{
mEditor = do_QueryInterface(aEditor);
mEditor = aEditor;
mRange = do_QueryInterface(aRange);
nsresult result = aRange->GetStartParent(getter_AddRefs(mStartParent));

View File

@ -81,7 +81,7 @@ protected:
protected:
/** p1 in the range */
nsCOMPtr<nsIDOMRange> mRange;
nsCOMPtr<nsIDOMRange> mRange; // is this really an owning ptr?
/** p1 in the range */
nsCOMPtr<nsIDOMNode> mStartParent;
@ -99,7 +99,7 @@ protected:
PRInt32 mEndOffset;
/** the editor for this transaction */
nsCOMPtr<nsIEditor> mEditor;
nsIEditor* mEditor;
friend class TransactionFactory;

View File

@ -41,7 +41,7 @@ NS_IMETHODIMP DeleteTextTxn::Init(nsIEditor *aEditor,
PRUint32 aNumCharsToDelete)
{
NS_ASSERTION(aEditor&&aElement, "bad arg");
mEditor = do_QueryInterface(aEditor);
mEditor = aEditor;
mElement = do_QueryInterface(aElement);
mOffset = aOffset;
mNumCharsToDelete = aNumCharsToDelete;

View File

@ -68,7 +68,7 @@ public:
protected:
/** the provider of basic editing operations */
nsCOMPtr<nsIEditor> mEditor;
nsIEditor* mEditor;
/** the text element to operate upon */
nsCOMPtr<nsIDOMCharacterData> mElement;

View File

@ -40,8 +40,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
static const nsIID& GetIID() { static nsIID iid = EDIT_AGGREGATE_TXN_IID; return iid; }
EditAggregateTxn();
virtual ~EditAggregateTxn();

View File

@ -44,7 +44,7 @@ NS_IMETHODIMP InsertElementTxn::Init(nsIDOMNode *aNode,
mNode = do_QueryInterface(aNode);
mParent = do_QueryInterface(aParent);
mOffset = aOffset;
mEditor = do_QueryInterface(aEditor);
mEditor = aEditor;
return NS_OK;
}

View File

@ -74,7 +74,7 @@ protected:
nsCOMPtr<nsIDOMNode> mParent;
/** the editor for this transaction */
nsCOMPtr<nsIEditor> mEditor;
nsIEditor* mEditor;
/** the index in mParent for the new node */
PRInt32 mOffset;

View File

@ -37,7 +37,7 @@ NS_IMETHODIMP ChangeAttributeTxn::Init(nsIEditor *aEditor,
{
if (nsnull!=aEditor && nsnull!=aElement)
{
mEditor = do_QueryInterface(aEditor);
mEditor = aEditor;
mElement = do_QueryInterface(aElement);
mAttribute = aAttribute;
mValue = aValue;

View File

@ -36,6 +36,7 @@
class ChangeAttributeTxn : public EditTxn
{
public:
virtual ~ChangeAttributeTxn();
/** Initialize the transaction.
@ -73,7 +74,7 @@ public:
protected:
/** the editor that created this transaction */
nsCOMPtr<nsIEditor> mEditor;
nsIEditor* mEditor;
/** the element to operate upon */
nsCOMPtr<nsIDOMElement> mElement;

View File

@ -43,7 +43,7 @@ NS_IMETHODIMP CreateElementTxn::Init(nsIEditor *aEditor,
NS_ASSERTION(aEditor&&aParent, "null args");
if (aEditor && aParent)
{
mEditor = do_QueryInterface(aEditor);
mEditor = aEditor;
mTag = aTag;
mParent = do_QueryInterface(aParent);
mOffsetInParent = aOffsetInParent;

View File

@ -76,7 +76,7 @@ public:
protected:
/** the document into which the new node will be inserted */
nsCOMPtr<nsIEditor> mEditor;
nsIEditor* mEditor;
/** the tag (mapping to object type) for the new element */
nsString mTag;

View File

@ -34,7 +34,7 @@
class DeleteElementTxn : public EditTxn
{
public:
/** initialize the transaction.
* @param aElement the node to delete
*/

View File

@ -51,7 +51,7 @@ NS_IMETHODIMP DeleteRangeTxn::Init(nsIEditor *aEditor, nsIDOMRange *aRange)
{
if (aEditor && aRange)
{
mEditor = do_QueryInterface(aEditor);
mEditor = aEditor;
mRange = do_QueryInterface(aRange);
nsresult result = aRange->GetStartParent(getter_AddRefs(mStartParent));

View File

@ -81,7 +81,7 @@ protected:
protected:
/** p1 in the range */
nsCOMPtr<nsIDOMRange> mRange;
nsCOMPtr<nsIDOMRange> mRange; // is this really an owning ptr?
/** p1 in the range */
nsCOMPtr<nsIDOMNode> mStartParent;
@ -99,7 +99,7 @@ protected:
PRInt32 mEndOffset;
/** the editor for this transaction */
nsCOMPtr<nsIEditor> mEditor;
nsIEditor* mEditor;
friend class TransactionFactory;

View File

@ -41,7 +41,7 @@ NS_IMETHODIMP DeleteTextTxn::Init(nsIEditor *aEditor,
PRUint32 aNumCharsToDelete)
{
NS_ASSERTION(aEditor&&aElement, "bad arg");
mEditor = do_QueryInterface(aEditor);
mEditor = aEditor;
mElement = do_QueryInterface(aElement);
mOffset = aOffset;
mNumCharsToDelete = aNumCharsToDelete;

View File

@ -68,7 +68,7 @@ public:
protected:
/** the provider of basic editing operations */
nsCOMPtr<nsIEditor> mEditor;
nsIEditor* mEditor;
/** the text element to operate upon */
nsCOMPtr<nsIDOMCharacterData> mElement;

View File

@ -40,8 +40,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
static const nsIID& GetIID() { static nsIID iid = EDIT_AGGREGATE_TXN_IID; return iid; }
EditAggregateTxn();
virtual ~EditAggregateTxn();

View File

@ -44,7 +44,7 @@ NS_IMETHODIMP InsertElementTxn::Init(nsIDOMNode *aNode,
mNode = do_QueryInterface(aNode);
mParent = do_QueryInterface(aParent);
mOffset = aOffset;
mEditor = do_QueryInterface(aEditor);
mEditor = aEditor;
return NS_OK;
}

View File

@ -74,7 +74,7 @@ protected:
nsCOMPtr<nsIDOMNode> mParent;
/** the editor for this transaction */
nsCOMPtr<nsIEditor> mEditor;
nsIEditor* mEditor;
/** the index in mParent for the new node */
PRInt32 mOffset;