Bug 471722 - Plaintext editor redo handling code looks for incorrect type of bogus node. r+sr=peterv
authorGraeme McCutcheon <graememcc_firefox@graeme-online.co.uk>
Fri, 06 Feb 2009 22:15:57 +0000
changeset 24729 6ebf4afe67d22879596af8a2e35f5a4df43eb331
parent 24728 7d5ec02ef5ff04b98696b6996c8cfea38373a987
child 24730 98fe21ddf417f997d6c17b2024f58526350ae791
push idunknown
push userunknown
push dateunknown
bugs471722
milestone1.9.2a1pre
Bug 471722 - Plaintext editor redo handling code looks for incorrect type of bogus node. r+sr=peterv
editor/libeditor/text/nsTextEditRules.cpp
--- a/editor/libeditor/text/nsTextEditRules.cpp
+++ b/editor/libeditor/text/nsTextEditRules.cpp
@@ -1035,25 +1035,25 @@ nsTextEditRules::DidRedo(nsISelection *a
       mBogusNode = nsnull;
     }
     else
     {
       nsIDOMElement *theRoot = mEditor->GetRoot();
       if (!theRoot) return NS_ERROR_FAILURE;
       
       nsCOMPtr<nsIDOMNodeList> nodeList;
-      res = theRoot->GetElementsByTagName(NS_LITERAL_STRING("div"),
+      res = theRoot->GetElementsByTagName(NS_LITERAL_STRING("br"),
                                           getter_AddRefs(nodeList));
       if (NS_FAILED(res)) return res;
       if (nodeList)
       {
         PRUint32 len;
         nodeList->GetLength(&len);
         
-        if (len != 1) return NS_OK;  // only in the case of one div could there be the bogus node
+        if (len != 1) return NS_OK;  // only in the case of one br could there be the bogus node
         nsCOMPtr<nsIDOMNode> node;
         nodeList->Item(0, getter_AddRefs(node));
         if (!node) return NS_ERROR_NULL_POINTER;
         if (mEditor->IsMozEditorBogusNode(node))
           mBogusNode = node;
       }
     }
   }