Title: [148854] trunk/Source/WebCore
Revision
148854
Author
[email protected]
Date
2013-04-21 22:54:11 -0700 (Sun, 21 Apr 2013)

Log Message

Fix some minor bad use of strings in WebCore
https://bugs.webkit.org/show_bug.cgi?id=114907

Reviewed by Darin Adler.

* editing/Editor.cpp:
(WebCore::Editor::selectedText): This was implicitly getting the emptyString()
for the argument "".
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::takeResults): ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (148853 => 148854)


--- trunk/Source/WebCore/ChangeLog	2013-04-22 05:32:29 UTC (rev 148853)
+++ trunk/Source/WebCore/ChangeLog	2013-04-22 05:54:11 UTC (rev 148854)
@@ -1,3 +1,16 @@
+2013-04-21  Benjamin Poulain  <[email protected]>
+
+        Fix some minor bad use of strings in WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=114907
+
+        Reviewed by Darin Adler.
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::selectedText): This was implicitly getting the emptyString()
+        for the argument "".
+        * editing/markup.cpp:
+        (WebCore::StyledMarkupAccumulator::takeResults): ditto.
+
 2013-04-21  Dirk Schulze  <[email protected]>
 
         [Part 4] Parse the custom() function in -webkit-filter: parse the matN() functions

Modified: trunk/Source/WebCore/editing/Editor.cpp (148853 => 148854)


--- trunk/Source/WebCore/editing/Editor.cpp	2013-04-22 05:32:29 UTC (rev 148853)
+++ trunk/Source/WebCore/editing/Editor.cpp	2013-04-22 05:54:11 UTC (rev 148854)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2011, 2013 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
  *
  * Redistribution and use in source and binary forms, with or without
@@ -2647,7 +2647,7 @@
 String Editor::selectedText(TextIteratorBehavior behavior) const
 {
     // We remove '\0' characters because they are not visibly rendered to the user.
-    return plainText(m_frame->selection()->toNormalizedRange().get(), behavior).replace(0, "");
+    return plainText(m_frame->selection()->toNormalizedRange().get(), behavior).replaceWithLiteral('\0', "");
 }
 
 IntRect Editor::firstRectForRange(Range* range) const

Modified: trunk/Source/WebCore/editing/markup.cpp (148853 => 148854)


--- trunk/Source/WebCore/editing/markup.cpp	2013-04-22 05:32:29 UTC (rev 148853)
+++ trunk/Source/WebCore/editing/markup.cpp	2013-04-22 05:54:11 UTC (rev 148854)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
  * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved.
  * Copyright (C) 2011 Igalia S.L.
  * Copyright (C) 2011 Motorola Mobility. All rights reserved.
@@ -218,7 +218,7 @@
     concatenateMarkup(result);
 
     // We remove '\0' characters because they are not visibly rendered to the user.
-    return result.toString().replace(0, "");
+    return result.toString().replaceWithLiteral('\0', "");
 }
 
 void StyledMarkupAccumulator::appendText(StringBuilder& out, Text* text)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to