Bug 1217275 - Fix missing \n in IMMHandler::HandleDocumentFeed(), it was replaced to empty string accidentally. r=m_kato, a=sylvestre
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 23 Oct 2015 10:12:15 +0900
changeset 291288 322adf3cdef3
parent 291287 556adfdf68c3
child 291289 f25c880e125d
push id934
push userraliiev@mozilla.com
push date2015-10-26 12:58 +0000
treeherdermozilla-release@05704e35c1d0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato, sylvestre
bugs1217275
milestone42.0
Bug 1217275 - Fix missing \n in IMMHandler::HandleDocumentFeed(), it was replaced to empty string accidentally. r=m_kato, a=sylvestre
widget/windows/IMMHandler.cpp
--- a/widget/windows/IMMHandler.cpp
+++ b/widget/windows/IMMHandler.cpp
@@ -1741,17 +1741,17 @@ IMMHandler::HandleDocumentFeed(nsWindow*
   if (targetOffset > int32_t(str.Length())) {
     MOZ_LOG(gIMMLog, LogLevel::Error,
       ("IMM: HandleDocumentFeed, FAILED, due to the caret offset is invalid"));
     return false;
   }
 
   // Get the focused paragraph, we decide that it starts from the previous CRLF
   // (or start of the editor) to the next one (or the end of the editor).
-  int32_t paragraphStart = str.RFind("", false, targetOffset, -1) + 1;
+  int32_t paragraphStart = str.RFind("\n", false, targetOffset, -1) + 1;
   int32_t paragraphEnd =
     str.Find("\r", false, targetOffset + targetLength, -1);
   if (paragraphEnd < 0) {
     paragraphEnd = str.Length();
   }
   nsDependentSubstring paragraph(str, paragraphStart,
                                  paragraphEnd - paragraphStart);