Bug 709523 - Part c: Remove EditAggregateTxn::{GetCount,GetTxnAt,SetName}; r=ehsan a=edmorley
authorMs2ger <ms2ger@gmail.com>
Sun, 11 Dec 2011 21:00:27 +0100
changeset 84058 9c4cd94a11d7348adb08f87af304e20204ac864e
parent 84057 b9e76ec6ac89b22e674734c6aa8e2e1f0860cde4
child 84059 6b33453c5a4f20d81d46a1b15cf28fbe6ffb6c23
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, edmorley
bugs709523
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 709523 - Part c: Remove EditAggregateTxn::{GetCount,GetTxnAt,SetName}; r=ehsan a=edmorley
editor/libeditor/base/EditAggregateTxn.cpp
editor/libeditor/base/EditAggregateTxn.h
--- a/editor/libeditor/base/EditAggregateTxn.cpp
+++ b/editor/libeditor/base/EditAggregateTxn.cpp
@@ -143,53 +143,16 @@ NS_IMETHODIMP EditAggregateTxn::AppendCh
   if (!slot) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   *slot = aTxn;
   return NS_OK;
 }
 
-NS_IMETHODIMP EditAggregateTxn::GetCount(PRUint32 *aCount)
-{
-  if (!aCount) {
-    return NS_ERROR_NULL_POINTER;
-  }
-  *aCount = mChildren.Length();
-  return NS_OK;
-}
-
-NS_IMETHODIMP EditAggregateTxn::GetTxnAt(PRInt32 aIndex, EditTxn **aTxn)
-{
-  // preconditions
-  NS_PRECONDITION(aTxn, "null out param");
-
-  if (!aTxn) {
-    return NS_ERROR_NULL_POINTER;
-  }
-  *aTxn = nsnull; // initialize out param as soon as we know it's a valid pointer
-  // get the transaction at aIndex
-  PRUint32 txnCount = mChildren.Length();
-  if (0>aIndex || ((PRInt32)txnCount)<=aIndex) {
-    return NS_ERROR_UNEXPECTED;
-  }
-  // ugh, this is all wrong - what a mess we have with editor transaction interfaces
-  *aTxn = mChildren[aIndex];
-  NS_ENSURE_TRUE(*aTxn, NS_ERROR_UNEXPECTED);
-  NS_ADDREF(*aTxn);
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP EditAggregateTxn::SetName(nsIAtom *aName)
-{
-  mName = do_QueryInterface(aName);
-  return NS_OK;
-}
-
 NS_IMETHODIMP EditAggregateTxn::GetName(nsIAtom **aName)
 {
   if (aName && mName)
   {
     *aName = mName;
     NS_ADDREF(*aName);
     return NS_OK;
   }
--- a/editor/libeditor/base/EditAggregateTxn.h
+++ b/editor/libeditor/base/EditAggregateTxn.h
@@ -59,29 +59,16 @@ public:
   NS_DECL_EDITTXN
 
   NS_IMETHOD RedoTransaction();
   NS_IMETHOD Merge(nsITransaction *aTransaction, bool *aDidMerge);
 
   /** append a transaction to this aggregate */
   NS_IMETHOD AppendChild(EditTxn *aTxn);
 
-  /** get the number of nested txns.  
-    * This is the number of top-level txns, it does not do recursive decent.
-    */
-  NS_IMETHOD GetCount(PRUint32 *aCount);
-
-  /** get the txn at index aIndex.
-    * returns NS_ERROR_UNEXPECTED if there is no txn at aIndex.
-    */
-  NS_IMETHOD GetTxnAt(PRInt32 aIndex, EditTxn **aTxn);
-
-  /** set the name assigned to this txn */
-  NS_IMETHOD SetName(nsIAtom *aName);
-
   /** get the name assigned to this txn */
   NS_IMETHOD GetName(nsIAtom **aName);
 
 protected:
 
   nsTArray< nsRefPtr<EditTxn> > mChildren;
   nsCOMPtr<nsIAtom> mName;
 };