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

Unified Diff: ui/base/ime/win/imm32_manager.cc

Issue 2126433002: Use container::back() and container::pop_back() in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pre-increment Created 4 years, 5 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 | ui/base/win/open_file_name_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/win/imm32_manager.cc
diff --git a/ui/base/ime/win/imm32_manager.cc b/ui/base/ime/win/imm32_manager.cc
index 20bf93741e5e2474c1657cdaf5078aaafe56fbf1..bd50e933942e35e6680f788286d74b7df19bdbf0 100644
--- a/ui/base/ime/win/imm32_manager.cc
+++ b/ui/base/ime/win/imm32_manager.cc
@@ -283,8 +283,9 @@ void IMM32Manager::CompleteComposition(HWND window_handle, HIMC imm_context) {
}
}
-void IMM32Manager::GetCompositionInfo(HIMC imm_context, LPARAM lparam,
- CompositionText* composition) {
+void IMM32Manager::GetCompositionInfo(HIMC imm_context,
+ LPARAM lparam,
+ CompositionText* composition) {
// We only care about GCS_COMPATTR, GCS_COMPCLAUSE and GCS_CURSORPOS, and
// convert them into underlines and selection range respectively.
composition->underlines.clear();
@@ -319,28 +320,29 @@ void IMM32Manager::GetCompositionInfo(HIMC imm_context, LPARAM lparam,
}
// Set default underlines in case there is no clause information.
- if (!composition->underlines.size()) {
- CompositionUnderline underline;
- underline.color = SK_ColorBLACK;
- underline.background_color = SK_ColorTRANSPARENT;
- if (target_start > 0) {
- underline.start_offset = 0U;
- underline.end_offset = static_cast<uint32_t>(target_start);
- underline.thick = false;
- composition->underlines.push_back(underline);
- }
- if (target_end > target_start) {
- underline.start_offset = static_cast<uint32_t>(target_start);
- underline.end_offset = static_cast<uint32_t>(target_end);
- underline.thick = true;
- composition->underlines.push_back(underline);
- }
- if (target_end < length) {
- underline.start_offset = static_cast<uint32_t>(target_end);
- underline.end_offset = static_cast<uint32_t>(length);
- underline.thick = false;
- composition->underlines.push_back(underline);
- }
+ if (!composition->underlines.empty())
+ return;
+
+ CompositionUnderline underline;
+ underline.color = SK_ColorBLACK;
+ underline.background_color = SK_ColorTRANSPARENT;
+ if (target_start > 0) {
+ underline.start_offset = 0U;
+ underline.end_offset = static_cast<uint32_t>(target_start);
+ underline.thick = false;
+ composition->underlines.push_back(underline);
+ }
+ if (target_end > target_start) {
+ underline.start_offset = static_cast<uint32_t>(target_start);
+ underline.end_offset = static_cast<uint32_t>(target_end);
+ underline.thick = true;
+ composition->underlines.push_back(underline);
+ }
+ if (target_end < length) {
+ underline.start_offset = static_cast<uint32_t>(target_end);
+ underline.end_offset = static_cast<uint32_t>(length);
+ underline.thick = false;
+ composition->underlines.push_back(underline);
}
}
« no previous file with comments | « no previous file | ui/base/win/open_file_name_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698