summaryrefslogtreecommitdiff
path: root/editor/libeditor/HTMLEditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/libeditor/HTMLEditor.cpp')
-rw-r--r--editor/libeditor/HTMLEditor.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/editor/libeditor/HTMLEditor.cpp b/editor/libeditor/HTMLEditor.cpp
index 04a710cde..c2f0bdc6d 100644
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -3530,15 +3530,11 @@ HTMLEditor::SelectEntireDocument(Selection* aSelection)
// Protect the edit rules object from dying
nsCOMPtr<nsIEditRules> rules(mRules);
- // get editor root node
- nsCOMPtr<nsIDOMElement> rootElement = do_QueryInterface(GetRoot());
-
// is doc empty?
- bool bDocIsEmpty;
- nsresult rv = rules->DocumentIsEmpty(&bDocIsEmpty);
- NS_ENSURE_SUCCESS(rv, rv);
+ if (rules->DocumentIsEmpty()) {
+ // get editor root node
+ Element* rootElement = GetRoot();
- if (bDocIsEmpty) {
// if its empty dont select entire doc - that would select the bogus node
return aSelection->Collapse(rootElement, 0);
}