/* -*- 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"InsertTextTransaction.h"
#include"ErrorList.h" #include"mozilla/EditorBase.h"// mEditorBase #include"mozilla/Logging.h" #include"mozilla/SelectionState.h"// RangeUpdater #include"mozilla/ToString.h" #include"mozilla/dom/Selection.h"// Selection local var #include"mozilla/dom/Text.h"// mTextNode
#include"nsAString.h"// nsAString parameter #include"nsDebug.h"// for NS_ASSERTION, etc. #include"nsError.h"// for NS_OK, etc. #include"nsQueryObject.h"// for do_QueryObject
if (NS_WARN_IF(!aOtherTransaction) || NS_WARN_IF(!aDidMerge)) { return NS_ERROR_INVALID_ARG;
} // Set out param default value
*aDidMerge = false;
RefPtr<EditTransactionBase> otherTransactionBase =
aOtherTransaction->GetAsEditTransactionBase(); if (!otherTransactionBase) {
MOZ_LOG(
GetLogModule(), LogLevel::Debug,
("%p InsertTextTransaction::%s(aOtherTransaction=%p) returned false", this, __FUNCTION__, aOtherTransaction)); return NS_OK;
}
// If aTransaction is a InsertTextTransaction, and if the selection hasn't // changed, then absorb it.
InsertTextTransaction* otherInsertTextTransaction =
otherTransactionBase->GetAsInsertTextTransaction(); if (!otherInsertTextTransaction ||
!IsSequentialInsert(*otherInsertTextTransaction)) {
MOZ_LOG(
GetLogModule(), LogLevel::Debug,
("%p InsertTextTransaction::%s(aOtherTransaction=%p) returned false", this, __FUNCTION__, aOtherTransaction)); return NS_OK;
}
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.