Reviewed by Ken Kocienda.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Jan 2005 21:42:55 +0000 (21:42 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Jan 2005 21:42:55 +0000 (21:42 +0000)
        <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply):
        Tune check for need for insertParagraphSeparator when hasInterchangeNewline.

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

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

index c690d563b7cf9cee97206862eda692575c38620c..23b391644e701fbc1da5fe612a089195c1e8fe2a 100644 (file)
@@ -1,3 +1,13 @@
+2005-01-09  David Harrison  <harrison@apple.com>
+
+        Reviewed by Ken Kocienda.
+
+        <rdar://problem/3786362> REGRESSION (Mail): pasted text loses one newline
+        
+        * khtml/editing/htmlediting.cpp:
+        (khtml::ReplaceSelectionCommand::doApply):
+        Tune check for need for insertParagraphSeparator when hasInterchangeNewline.
+
 2005-01-09  Darin Adler  <darin@apple.com>
 
         Reviewed by Harrison.
index c7d1858c868701bc47427892f48286bdba672da0..498a2466ef6573deca74f48e003cbc2b59cc45c3 100644 (file)
@@ -3638,7 +3638,8 @@ void ReplaceSelectionCommand::doApply()
 
     // Handle trailing newline
     if (m_fragment.hasInterchangeNewline()) {
-        if (startBlock == endBlock && !isProbablyBlock(lastNodeInserted)) {
+        if ((startBlock == endBlock) && (VisiblePosition(lastNodeInserted, lastNodeInserted->caretMaxOffset()).next().isNull())) {
+        
             setEndingSelection(insertionPos);
             insertParagraphSeparator();
             endPos = endingSelection().end().downstream();