Bug 1476897 - part 3: Make TextEditor::InsertAsCitedQuotation() return NS_ERROR_NOT_IMPLEMENTED since nobody uses this method with TextEditor instances r=m_kato

MozReview-Commit-ID: 487sf6d2wrt

--HG--
extra : rebase_source : dfacb64768de3eab11b7e11478be4c297641f2a0
This commit is contained in:
Masayuki Nakano 2018-07-23 15:17:03 +09:00
Родитель edd6613c92
Коммит 69e0b4e72b
2 изменённых файлов: 11 добавлений и 7 удалений

Просмотреть файл

@ -1904,15 +1904,17 @@ HTMLEditor::InsertAsCitedQuotation(const nsAString& aQuotedText,
bool aInsertHTML,
nsINode** aNodeInserted)
{
// Don't let anyone insert html into a "plaintext" editor:
// Don't let anyone insert HTML when we're in plaintext mode.
if (IsPlaintextEditor()) {
NS_ASSERTION(!aInsertHTML, "InsertAsCitedQuotation: trying to insert html into plaintext editor");
NS_ASSERTION(!aInsertHTML,
"InsertAsCitedQuotation: trying to insert html into plaintext editor");
return InsertAsPlaintextQuotation(aQuotedText, true, aNodeInserted);
}
// get selection
RefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
if (NS_WARN_IF(!selection)) {
return NS_ERROR_FAILURE;
}
AutoPlaceholderBatch beginBatching(this);
AutoTopLevelEditSubActionNotifier maybeTopLevelEditSubAction(
@ -1933,9 +1935,11 @@ HTMLEditor::InsertAsCitedQuotation(const nsAString& aQuotedText,
return NS_OK; // rules canceled the operation
}
nsCOMPtr<Element> newNode =
RefPtr<Element> newNode =
DeleteSelectionAndCreateElement(*nsGkAtoms::blockquote);
NS_ENSURE_TRUE(newNode, NS_ERROR_NULL_POINTER);
if (NS_WARN_IF(!newNode)) {
return NS_ERROR_FAILURE;
}
// Try to set type=cite. Ignore it if this fails.
newNode->SetAttr(kNameSpaceID_None, nsGkAtoms::type,

Просмотреть файл

@ -1944,7 +1944,7 @@ TextEditor::InsertAsCitedQuotation(const nsAString& aQuotedText,
bool aInsertHTML,
nsINode** aNodeInserted)
{
return InsertAsQuotation(aQuotedText, aNodeInserted);
return NS_ERROR_NOT_IMPLEMENTED;
}
nsresult