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 296552 a507b89d922ce1e3910c714cf99e1eb1283b83c0
parent 296551 57d711d049c1eba2c0eea5c79d3dea92a6c760b1
child 296553 fc5c56a6e3188af1c5d501af057424d34fd3ccc0
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato, sylvestre
bugs1217275
milestone43.0a2
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
@@ -1740,17 +1740,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);