summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/TextEditor.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 07:43:03 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 07:43:03 -0400
commit6d76ab9b6c19d0829c343e1bc3cd7865221d64ba (patch)
treef664dfac761bd71fdccf73d4d3d76abb87b2adef /editor/libeditor/TextEditor.cpp
parent9e5e58c0f6e1c65674cc688816f387532661d6f1 (diff)
downloadUXP-6d76ab9b6c19d0829c343e1bc3cd7865221d64ba.tar
UXP-6d76ab9b6c19d0829c343e1bc3cd7865221d64ba.tar.gz
UXP-6d76ab9b6c19d0829c343e1bc3cd7865221d64ba.tar.lz
UXP-6d76ab9b6c19d0829c343e1bc3cd7865221d64ba.tar.xz
UXP-6d76ab9b6c19d0829c343e1bc3cd7865221d64ba.zip
Bug 1360154 - nsIPlaintextEditor might have to have hasText property for UpdateOverlayTextVisibility
* DocumentIsBody should return bool, not nsresult * Add fast path to check whether valus is emtpy Tag #1375
Diffstat (limited to 'editor/libeditor/TextEditor.cpp')
-rw-r--r--editor/libeditor/TextEditor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/libeditor/TextEditor.cpp b/editor/libeditor/TextEditor.cpp
index 9d07c198b..c3cfa4a72 100644
--- a/editor/libeditor/TextEditor.cpp
+++ b/editor/libeditor/TextEditor.cpp
@@ -913,7 +913,8 @@ TextEditor::GetDocumentIsEmpty(bool* aDocumentIsEmpty)
// Protect the edit rules object from dying
nsCOMPtr<nsIEditRules> rules(mRules);
- return rules->DocumentIsEmpty(aDocumentIsEmpty);
+ *aDocumentIsEmpty = rules->DocumentIsEmpty();
+ return NS_OK;
}
NS_IMETHODIMP
@@ -1580,8 +1581,7 @@ TextEditor::SelectEntireDocument(Selection* aSelection)
nsCOMPtr<nsIEditRules> rules(mRules);
// is doc empty?
- bool bDocIsEmpty;
- if (NS_SUCCEEDED(rules->DocumentIsEmpty(&bDocIsEmpty)) && bDocIsEmpty) {
+ if (rules->DocumentIsEmpty()) {
// get root node
nsCOMPtr<nsIDOMElement> rootElement = do_QueryInterface(GetRoot());
NS_ENSURE_TRUE(rootElement, NS_ERROR_FAILURE);