/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include"mozilla/ComposerCommandsUpdater.h"
#include"mozilla/mozalloc.h"// for operator new #include"mozilla/TransactionManager.h"// for TransactionManager #include"mozilla/dom/Selection.h" #include"nsCommandManager.h"// for nsCommandManager #include"nsComponentManagerUtils.h"// for do_CreateInstance #include"nsDebug.h"// for NS_ENSURE_TRUE, etc #include"nsDocShell.h"// for nsIDocShell #include"nsError.h"// for NS_OK, NS_ERROR_FAILURE, etc #include"nsID.h"// for NS_GET_IID, etc #include"nsIInterfaceRequestorUtils.h"// for do_GetInterface #include"nsLiteralString.h"// for NS_LITERAL_STRING #include"nsPIDOMWindow.h"// for nsPIDOMWindow
void ComposerCommandsUpdater::DidDoTransaction(
TransactionManager& aTransactionManager) { // only need to update if the status of the Undo menu item changes. if (aTransactionManager.NumberOfUndoItems() == 1) { if (mFirstDoOfFirstUndo) {
UpdateCommandGroup(CommandGroup::Undo);
}
mFirstDoOfFirstUndo = false;
}
}
void ComposerCommandsUpdater::DidUndoTransaction(
TransactionManager& aTransactionManager) { if (!aTransactionManager.NumberOfUndoItems()) {
mFirstDoOfFirstUndo = true; // reset the state for the next do
}
UpdateCommandGroup(CommandGroup::Undo);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.