summaryrefslogtreecommitdiffstats
path: root/win8
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-18 01:40:47 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-18 01:40:47 +0000
commit481c3e82e2dcbcb676501f18bc8f58900071b935 (patch)
treeb41b70589f0b082edffa7322b1c06af23c4b32bc /win8
parentcf85b9ad701b8363e3d1d54d54390dcdf4a45291 (diff)
downloadchromium_src-481c3e82e2dcbcb676501f18bc8f58900071b935.zip
chromium_src-481c3e82e2dcbcb676501f18bc8f58900071b935.tar.gz
chromium_src-481c3e82e2dcbcb676501f18bc8f58900071b935.tar.bz2
Fixes for re-enabling more MSVC level 4 warnings: misc edition #2
This contains fixes for the following sorts of issues: * Assignment inside conditional * Taking the address of a temporary * Octal escape sequence terminated by decimal number * Signedness mismatch * Possibly-uninitialized local variable This also contains a small number of cleanups to nearby code (e.g. no else after return). BUG=81439 TEST=none Review URL: https://codereview.chromium.org/382673002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283967 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8')
-rw-r--r--win8/metro_driver/ime/text_store.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/win8/metro_driver/ime/text_store.cc b/win8/metro_driver/ime/text_store.cc
index e406e1b..0c0389b 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() {