Reviewed by Chris.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Feb 2005 18:29:40 +0000 (18:29 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Feb 2005 18:29:40 +0000 (18:29 +0000)
        - fixed <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced

        * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply):
        Use the insertNodeAfterAndUpdateNodesInserted and insertNodeBeforeAndUpdateNodesInserted
        functions to add the leading and trailing spaces for smart paste.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8694 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/htmlediting.cpp

index 90719657209123a3f89eea5d2705f0424ed64b3a..5af4ec6e4372d92a2a4462103a44fc45bcd73d6e 100644 (file)
@@ -1,3 +1,13 @@
+2005-02-25  Darin Adler  <darin@apple.com>
+
+        Reviewed by Chris.
+
+        - fixed <rdar://problem/4024786> REGRESSION (Mail): "Smart paste" plain-text word into Blot leaves insertion point misplaced
+
+        * khtml/editing/htmlediting.cpp: (khtml::ReplaceSelectionCommand::doApply):
+        Use the insertNodeAfterAndUpdateNodesInserted and insertNodeBeforeAndUpdateNodesInserted
+        functions to add the leading and trailing spaces for smart paste.
+
 2005-02-25  David Hyatt  <hyatt@apple.com>
 
        Back out fix for 3382926, since it breaks LTR text inside RTL contexts.
index 172d4a22de5d850630fb15568875d5c6832d2df2..8b33a0bdfefbeb597282e7a62b99724752eb9389 100644 (file)
@@ -4617,11 +4617,7 @@ void ReplaceSelectionCommand::doApply()
         }
         else {
             NodeImpl *node = document()->createEditingTextNode(nonBreakingSpaceString());
-            insertNodeAfter(node, m_lastNodeInserted);
-            if (!m_firstNodeInserted)
-                m_firstNodeInserted = node;
-            m_lastNodeInserted = node;
-            m_lastTopNodeInserted = node;
+            insertNodeAfterAndUpdateNodesInserted(node, m_lastNodeInserted);
             insertionPos = Position(node, 1);
         }
     }
@@ -4632,7 +4628,7 @@ void ReplaceSelectionCommand::doApply()
             insertTextIntoNode(text, 0, nonBreakingSpaceString());
         } else {
             NodeImpl *node = document()->createEditingTextNode(nonBreakingSpaceString());
-            insertNodeBefore(node, m_firstNodeInserted);
+            insertNodeBeforeAndUpdateNodesInserted(node, m_firstNodeInserted);
         }
     }