Reviewed by John
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2004 23:17:57 +0000 (23:17 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Dec 2004 23:17:57 +0000 (23:17 +0000)
        Fix for this bug:

        <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on
        leading and trailing whitespace positions was reversed! I must have introduced this error recently
        when changing around this code.

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

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

index 54d9d2d30c4def269ef4c730d0fcc9acf6752aa5..f3625ecb30d300d1280bee18ed2bde4cea23fea2 100644 (file)
@@ -1,3 +1,16 @@
+2004-12-13  Ken Kocienda  <kocienda@apple.com>
+
+        Reviewed by John
+
+        Fix for this bug:
+        
+        <rdar://problem/3917956> REGRESSION (Mail): pasting can leave insertion point inside pasted text
+
+        * khtml/editing/htmlediting.cpp:
+        (khtml::ReplaceSelectionCommand::doApply): Fix coding mistake. Calculations of bool flag based on 
+        leading and trailing whitespace positions was reversed! I must have introduced this error recently
+        when changing around this code.
+
 2004-12-13  David Hyatt  <hyatt@apple.com>
 
        Fix for 3915787, macobserver doesn't paint.  floatRect() needed to be const in the base class.  Also hit-testing
         * khtml/rendering/render_object.h:
         (khtml::RenderObject::floatRect):
 
-2004-12-13  Ken Kocienda  <kocienda@apple.com>
-
-        Reviewed by John
-
 2004-12-13  Ken Kocienda  <kocienda@apple.com>
 
         Reviewed by John
index 2c6c1f0f777d1e2ee382daf09ede555cccf052c6..605231ed05d81f8b00bf97f0cfb68e2cb8c1bd83 100644 (file)
@@ -3317,14 +3317,14 @@ void ReplaceSelectionCommand::doApply()
     bool addLeadingSpace = false;
     bool addTrailingSpace = false;
     if (m_smartReplace) {
-        addLeadingSpace = startPos.leadingWhitespacePosition().isNull();
+        addLeadingSpace = startPos.leadingWhitespacePosition().isNotNull();
         if (addLeadingSpace) {
             QChar previousChar = VisiblePosition(startPos).previous().character();
             if (!previousChar.isNull()) {
                 addLeadingSpace = !part->isCharacterSmartReplaceExempt(previousChar, true);
             }
         }
-        addTrailingSpace = endPos.trailingWhitespacePosition().isNull();
+        addTrailingSpace = endPos.trailingWhitespacePosition().isNotNull();
         if (addTrailingSpace) {
             QChar thisChar = VisiblePosition(endPos).character();
             if (!thisChar.isNull()) {