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

Unified Diff: win8/metro_driver/ime/text_store.cc

Issue 382673002: Fixes for re-enabling more MSVC level 4 warnings: misc edition #2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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 | « tools/json_to_struct/json_to_struct.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/metro_driver/ime/text_store.cc
diff --git a/win8/metro_driver/ime/text_store.cc b/win8/metro_driver/ime/text_store.cc
index e406e1b6115b10d8b9265962650406dd91dcfc96..0c0389bfb3c8f340f9903bf38b28c90f7edcacb4 100644
--- a/win8/metro_driver/ime/text_store.cc
+++ b/win8/metro_driver/ime/text_store.cc
@@ -765,7 +765,7 @@ bool TextStore::GetCompositionStatus(
while (true) {
base::win::ScopedComPtr<ITfRange> range;
if (ranges->Next(1, range.Receive(), NULL) != S_OK)
- break;
+ return true;
base::win::ScopedVariant value;
base::win::ScopedComPtr<IEnumTfPropertyValue> enum_prop_value;
if (FAILED(track_property->GetValue(read_only_edit_cookie, range,
@@ -777,16 +777,16 @@ bool TextStore::GetCompositionStatus(
TF_PROPERTYVAL property_value;
bool is_composition = false;
- bool has_display_attribute = false;
- TF_DISPLAYATTRIBUTE display_attribute;
+ metro_viewer::UnderlineInfo underline;
while (enum_prop_value->Next(1, &property_value, NULL) == S_OK) {
if (IsEqualGUID(property_value.guidId, GUID_PROP_COMPOSING)) {
is_composition = (property_value.varValue.lVal == TRUE);
} else if (IsEqualGUID(property_value.guidId, GUID_PROP_ATTRIBUTE)) {
TfGuidAtom guid_atom =
static_cast<TfGuidAtom>(property_value.varValue.lVal);
+ TF_DISPLAYATTRIBUTE display_attribute;
if (GetDisplayAttribute(guid_atom, &display_attribute))
- has_display_attribute = true;
+ underline.thick = !!display_attribute.fBoldLine;
}
VariantClear(&property_value.varValue);
}
@@ -795,18 +795,14 @@ bool TextStore::GetCompositionStatus(
range_acp.QueryFrom(range);
LONG start_pos, length;
range_acp->GetExtent(&start_pos, &length);
- if (!is_composition) {
- if (*committed_size < static_cast<size_t>(start_pos + length))
- *committed_size = start_pos + length;
- } else {
- metro_viewer::UnderlineInfo underline;
+ if (is_composition) {
underline.start_offset = start_pos;
underline.end_offset = start_pos + length;
- underline.thick = !!display_attribute.fBoldLine;
undelines->push_back(underline);
+ } else if (*committed_size < static_cast<size_t>(start_pos + length)) {
+ *committed_size = start_pos + length;
}
}
- return true;
}
bool TextStore::CancelComposition() {
« no previous file with comments | « tools/json_to_struct/json_to_struct.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698