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
--- 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.