Bug 1463985 - part 13: Rename EditSubAction::setText to EditSubAction::eSetText r?m_kato
MozReview-Commit-ID: A4DF3fX9IV6
--- a/editor/libeditor/EditAction.h
+++ b/editor/libeditor/EditAction.h
@@ -57,17 +57,18 @@ enum class EditSubAction : int32_t
// eRemoveTextProperty indicates to remove a style from text.
eRemoveTextProperty,
// eComputeTextToOutput indicates to compute the editor value as plain text
// or something requested format.
eComputeTextToOutput,
- setText,
+ // eSetText indicates to set editor value to new value.
+ eSetText,
// HTML editor only actions
insertBreak = 3000,
makeList,
indent,
outdent,
align,
makeBasicBlock,
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -2909,17 +2909,17 @@ EditorBase::NotifyDocumentListeners(
nsresult
EditorBase::SetTextImpl(Selection& aSelection, const nsAString& aString,
Text& aCharData)
{
const uint32_t length = aCharData.Length();
AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
- *this, EditSubAction::setText,
+ *this, EditSubAction::eSetText,
nsIEditor::eNext);
// Let listeners know what's up
if (!mActionListeners.IsEmpty() && length) {
AutoActionListenerArray listeners(mActionListeners);
for (auto& listener : listeners) {
listener->WillDeleteText(&aCharData, 0, length);
}
--- a/editor/libeditor/TextEditRules.cpp
+++ b/editor/libeditor/TextEditRules.cpp
@@ -215,17 +215,17 @@ TextEditRules::BeforeEdit(EditSubAction
AutoLockRulesSniffing lockIt(this);
mDidExplicitlySetInterline = false;
if (!mActionNesting) {
// let rules remember the top level action
mTopLevelEditSubAction = aEditSubAction;
}
mActionNesting++;
- if (aEditSubAction == EditSubAction::setText) {
+ if (aEditSubAction == EditSubAction::eSetText) {
// setText replaces all text, so mCachedSelectionNode might be invalid on
// AfterEdit.
// Since this will be used as start position of spellchecker, we should
// use root instead.
mCachedSelectionNode = mTextEditor->GetRoot();
mCachedSelectionOffset = 0;
} else {
Selection* selection = mTextEditor->GetSelection();
@@ -331,17 +331,17 @@ TextEditRules::WillDoAction(Selection* a
UndefineCaretBidiLevel();
return WillInsertBreak(aCancel, aHandled, aInfo.maxLength);
case EditSubAction::eInsertText:
case EditSubAction::eInsertTextComingFromIME:
UndefineCaretBidiLevel();
return WillInsertText(aInfo.mEditSubAction, aCancel, aHandled,
aInfo.inString, aInfo.outString,
aInfo.maxLength);
- case EditSubAction::setText:
+ case EditSubAction::eSetText:
UndefineCaretBidiLevel();
return WillSetText(aCancel, aHandled, aInfo.inString,
aInfo.maxLength);
case EditSubAction::eDeleteSelectedContent:
return WillDeleteSelection(aInfo.collapsedAction, aCancel, aHandled);
case EditSubAction::eUndo:
return WillUndo(aCancel, aHandled);
case EditSubAction::eRedo:
--- a/editor/libeditor/TextEditor.cpp
+++ b/editor/libeditor/TextEditor.cpp
@@ -1100,25 +1100,25 @@ TextEditor::SetText(const nsAString& aSt
}
// Protect the edit rules object from dying
RefPtr<TextEditRules> rules(mRules);
// delete placeholder txns merge.
AutoPlaceholderBatch batch(this, nullptr);
AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
- *this, EditSubAction::setText,
+ *this, EditSubAction::eSetText,
nsIEditor::eNext);
// pre-process
RefPtr<Selection> selection = GetSelection();
if (NS_WARN_IF(!selection)) {
return NS_ERROR_NULL_POINTER;
}
- EditSubActionInfo subActionInfo(EditSubAction::setText);
+ EditSubActionInfo subActionInfo(EditSubAction::eSetText);
subActionInfo.inString = &aString;
subActionInfo.maxLength = mMaxTextLength;
bool cancel;
bool handled;
nsresult rv =
rules->WillDoAction(selection, subActionInfo, &cancel, &handled);
if (NS_WARN_IF(NS_FAILED(rv))) {