Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1452)

Unified Diff: chrome/renderer/spellchecker/spellcheck_provider.cc

Issue 2054723002: Spellchecking should not be cancelled if editing is done in between Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/spellchecker/spellcheck_provider.cc
diff --git a/chrome/renderer/spellchecker/spellcheck_provider.cc b/chrome/renderer/spellchecker/spellcheck_provider.cc
index 576460e8dbe025b12abf2170c26ccb7e76a7883e..6702acad803db78b474424544eec3a17e17c7c00 100644
--- a/chrome/renderer/spellchecker/spellcheck_provider.cc
+++ b/chrome/renderer/spellchecker/spellcheck_provider.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/metrics/histogram.h"
+#include "base/strings/utf_string_conversions.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/spellcheck_marker.h"
#include "chrome/common/spellcheck_messages.h"
@@ -315,8 +316,9 @@ bool SpellCheckProvider::SatisfyRequestFromCache(
return true;
}
int code = 0;
- int length = static_cast<int>(text_length);
- U16_PREV(text.data(), 0, length, code);
+ base::string16 requested_text = text + base::UTF8ToUTF16(" ");
+ int length = static_cast<int>(requested_text.length());
+ U16_PREV(requested_text.data(), 0, length, code);
UErrorCode error = U_ZERO_ERROR;
if (uscript_getScript(code, &error) != USCRIPT_COMMON) {
completion->didCancelCheckingText();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698