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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc

Issue 4683002: Update internal state on undo to avoid a crash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address James' comments. Created 10 years, 1 month 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 | third_party/undoview/undo_manager.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
index c96a1888e70c1da36cb02ce8cdbe008d2fa9c7f7..b207ad0c3a4984f6b1467a781a5f222fafae8d55 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
@@ -1702,8 +1702,10 @@ void AutocompleteEditViewGtk::SavePrimarySelection(
void AutocompleteEditViewGtk::SetTextAndSelectedRange(const std::wstring& text,
const CharRange& range) {
- std::string utf8 = WideToUTF8(text);
- gtk_text_buffer_set_text(text_buffer_, utf8.data(), utf8.length());
+ if (text != GetText()) {
+ std::string utf8 = WideToUTF8(text);
+ gtk_text_buffer_set_text(text_buffer_, utf8.data(), utf8.length());
+ }
SetSelectedRange(range);
AdjustTextJustification();
}
« no previous file with comments | « no previous file | third_party/undoview/undo_manager.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698