Bug 1335997 - Part 2. Don't use virtual method for NotifyDocumentListeners and ScrollSelectionIntoView. r=masayuki
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 02 Feb 2017 13:56:57 +0900
changeset 469862 d6fd02e91afb14f51ee238032533ddb7c3e468e9
parent 469861 abb60930736316e14cae5c46d5e61c96a21a2427
child 469863 205c3c6c123fe277268770e3bdf082f89ec47ec5
push id43881
push userbmo:gps@mozilla.com
push dateThu, 02 Feb 2017 23:49:03 +0000
reviewersmasayuki
bugs1335997
milestone54.0a1
Bug 1335997 - Part 2. Don't use virtual method for NotifyDocumentListeners and ScrollSelectionIntoView. r=masayuki Both methods don't override by TextEditor and HTMLEditor. It is unnecessary to use as virtual method. MozReview-Commit-ID: 6FNO78RauML
editor/libeditor/EditorBase.cpp
editor/libeditor/EditorBase.h
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -2290,17 +2290,17 @@ EditorBase::CloneAttributes(Element* aDe
       // The element is not inserted in the document yet, we don't want to put
       // a transaction on the UndoStack
       SetAttributeOrEquivalent(aDest, attr->NodeInfo()->NameAtom(), value,
                                true);
     }
   }
 }
 
-NS_IMETHODIMP
+nsresult
 EditorBase::ScrollSelectionIntoView(bool aScrollToAnchor)
 {
   nsCOMPtr<nsISelectionController> selCon;
   if (NS_SUCCEEDED(GetSelectionController(getter_AddRefs(selCon))) && selCon) {
     int16_t region = nsISelectionController::SELECTION_FOCUS_REGION;
 
     if (aScrollToAnchor) {
       region = nsISelectionController::SELECTION_ANCHOR_REGION;
@@ -2572,17 +2572,17 @@ EditorBase::GetFirstEditableNode(nsINode
   nsIContent* node = GetLeftmostChild(aRoot);
   if (node && !IsEditable(node)) {
     node = GetNextNode(node, /* aEditableNode = */ true);
   }
 
   return (node != aRoot) ? node : nullptr;
 }
 
-NS_IMETHODIMP
+nsresult
 EditorBase::NotifyDocumentListeners(
               TDocumentListenerNotification aNotificationType)
 {
   if (!mDocStateListeners.Length()) {
     // Maybe there just aren't any.
     return NS_OK;
   }
 
--- a/editor/libeditor/EditorBase.h
+++ b/editor/libeditor/EditorBase.h
@@ -397,18 +397,18 @@ protected:
     eDocumentCreated,
     eDocumentToBeDestroyed,
     eDocumentStateChanged
   };
 
   /**
    * Tell the doc state listeners that the doc state has changed.
    */
-  NS_IMETHOD NotifyDocumentListeners(
-               TDocumentListenerNotification aNotificationType);
+  nsresult NotifyDocumentListeners(
+             TDocumentListenerNotification aNotificationType);
 
   /**
    * Make the given selection span the entire document.
    */
   virtual nsresult SelectEntireDocument(Selection* aSelection);
 
   /**
    * Helper method for scrolling the selection into view after
@@ -416,17 +416,17 @@ protected:
    * want to scroll to the point where the selection was started.
    * If false, it attempts to scroll the end of the selection into view.
    *
    * Editor methods *should* call this method instead of the versions
    * in the various selection interfaces, since this version makes sure
    * that the editor's sync/async settings for reflowing, painting, and
    * scrolling match.
    */
-  NS_IMETHOD ScrollSelectionIntoView(bool aScrollToAnchor);
+  nsresult ScrollSelectionIntoView(bool aScrollToAnchor);
 
   virtual bool IsBlockNode(nsINode* aNode);
 
   /**
    * Helper for GetPriorNode() and GetNextNode().
    */
   nsIContent* FindNextLeafNode(nsINode* aCurrentNode,
                                bool aGoForward,