Bug 1448780 - Get rid of nsIEditor.numberOfUndoItems and nsIEditor.numberOfRedoItems r=m_kato
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 26 Mar 2018 18:11:06 +0900
changeset 410017 fb567fcd8ea9544f2b55e266df03964a34886d9c
parent 410016 d2d3e20741a771523fa9ea4d5ef37249890deabc
child 410018 e7a33821496d8010aba44c6754ba168e41e835ae
push id33716
push userbtara@mozilla.com
push dateTue, 27 Mar 2018 09:11:40 +0000
treeherdermozilla-central@6580b15bcd33 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato
bugs1448780
milestone61.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 1448780 - Get rid of nsIEditor.numberOfUndoItems and nsIEditor.numberOfRedoItems r=m_kato nsIEditor.numberOfUndoItems and nsIEditor.numberOfRedoItems are shortcut property for nsITransactionManager.numberOfUndoItems and nsITransactionManager.numberOfRedoItems of the editor. However, anybody uses nsITransactionManager directly. So, we can get rid of them. MozReview-Commit-ID: 70J0bsxDNCC
editor/libeditor/EditorBase.cpp
editor/nsIEditor.idl
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -823,32 +823,16 @@ EditorBase::EnableUndo(bool aEnable)
   }
   DebugOnly<bool> disabledUndoRedo = DisableUndoRedo();
   NS_WARNING_ASSERTION(disabledUndoRedo,
     "Failed to disable undo/redo transactions");
   return NS_OK;
 }
 
 NS_IMETHODIMP
-EditorBase::GetNumberOfUndoItems(int32_t* aNumItems)
-{
-  *aNumItems = static_cast<int32_t>(NumberOfUndoItems());
-  MOZ_ASSERT(*aNumItems >= 0);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-EditorBase::GetNumberOfRedoItems(int32_t* aNumItems)
-{
-  *aNumItems = static_cast<int32_t>(NumberOfRedoItems());
-  MOZ_ASSERT(*aNumItems >= 0);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 EditorBase::GetTransactionManager(nsITransactionManager** aTransactionManager)
 {
   if (NS_WARN_IF(!aTransactionManager)) {
     return NS_ERROR_INVALID_ARG;
   }
   if (NS_WARN_IF(!mTransactionManager)) {
     return NS_ERROR_FAILURE;
   }
--- a/editor/nsIEditor.idl
+++ b/editor/nsIEditor.idl
@@ -164,26 +164,16 @@ interface nsIEditor  : nsISupports
     *                 if PR_FALSE the undo system is turned off if it
     *                 was previously on
     * @return         if aEnable is PR_TRUE, returns NS_OK if
     *                 the undo system could be initialized properly
     *                 if aEnable is PR_FALSE, returns NS_OK.
     */
   void enableUndo(in boolean enable);
 
-  /**
-   * The number of items on the undo stack.
-   */
-  readonly attribute long numberOfUndoItems;
-
-  /**
-   * The number of items on the redo stack.
-   */
-  readonly attribute long numberOfRedoItems;
-
   /** undo reverses the effects of the last Do operation,
     * if Undo is enabled in the editor.
     * It is provided here so clients need no knowledge of whether
     * the editor has a transaction manager or not.
     * If a transaction manager is present, it is told to undo,
     * and the result of that undo is returned.
     * Otherwise, the Undo request is ignored and an
     * error NS_ERROR_NOT_AVAILABLE is returned.