Commit cffc7123 authored by Martin Robinson's avatar Martin Robinson Committed by Commit Bot

Fix a few more lint errors in the platform accessibility code

This will make it easier to catch new ones.

Change-Id: I468c496b547d6042b6ca45b888a15ca4b9917dd3
Reviewed-on: https://chromium-review.googlesource.com/1157004
Commit-Queue: Martin Robinson <mrobinson@igalia.com>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580113}
parent c3a0fcf4
......@@ -441,7 +441,7 @@ STDMETHODIMP BrowserAccessibilityComWin::get_newText(IA2TextSegment* new_text) {
if (!old_win_attributes_)
return E_FAIL;
int start, old_len, new_len;
size_t start, old_len, new_len;
ComputeHypertextRemovedAndInserted(&start, &old_len, &new_len);
if (new_len == 0)
return E_FAIL;
......@@ -465,7 +465,7 @@ STDMETHODIMP BrowserAccessibilityComWin::get_oldText(IA2TextSegment* old_text) {
if (!old_win_attributes_)
return E_FAIL;
int start, old_len, new_len;
size_t start, old_len, new_len;
ComputeHypertextRemovedAndInserted(&start, &old_len, &new_len);
if (old_len == 0)
return E_FAIL;
......@@ -1790,7 +1790,7 @@ void BrowserAccessibilityComWin::UpdateStep3FireEvents(
// they are providing redundant information and will lead to duplicate
// announcements.
if (!did_fire_namechange) {
int start, old_len, new_len;
size_t start, old_len, new_len;
ComputeHypertextRemovedAndInserted(&start, &old_len, &new_len);
if (old_len > 0) {
// In-process screen readers may call IAccessibleText::get_oldText
......
......@@ -6,6 +6,7 @@
#define UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_BASE_H_
#include <string>
#include <vector>
#include "base/macros.h"
#include "ui/accessibility/ax_enums.mojom.h"
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_ACCESSIBILITY_AX_PLATFORM_NODE_MAC_H_
#define UI_ACCESSIBILITY_AX_PLATFORM_NODE_MAC_H_
#ifndef UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_MAC_H_
#define UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_MAC_H_
#import <Foundation/Foundation.h>
......@@ -69,4 +69,4 @@ AX_EXPORT
@end
#endif // UI_ACCESSIBILITY_AX_PLATFORM_NODE_MAC_H_
#endif // UI_ACCESSIBILITY_PLATFORM_AX_PLATFORM_NODE_MAC_H_
......@@ -7,6 +7,10 @@
#include <wrl/client.h>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "base/containers/hash_tables.h"
......@@ -638,7 +642,6 @@ STDMETHODIMP AXPlatformNodeWin::accNavigate(
IAccessible* result = nullptr;
switch (nav_dir) {
case NAVDIR_FIRSTCHILD:
if (delegate_->GetChildCount() > 0)
result = delegate_->ChildAtIndex(0);
......@@ -1764,7 +1767,7 @@ STDMETHODIMP AXPlatformNodeWin::GetSelection(SAFEARRAY** result) {
COM_OBJECT_VALIDATE_1_ARG(result);
int child_count = delegate_->GetChildCount();
*result = SafeArrayCreateVector(VT_UNKNOWN, 0, child_count);
for (long i = 0; i < child_count; ++i) {
for (LONG i = 0; i < child_count; ++i) {
auto* child = static_cast<AXPlatformNodeWin*>(
FromNativeViewAccessible(delegate_->ChildAtIndex(i)));
DCHECK(child);
......@@ -4863,7 +4866,7 @@ base::string16 AXPlatformNodeWin::ComputeUIAProperties() {
return result;
}
long AXPlatformNodeWin::ComputeUIAControlType() {
LONG AXPlatformNodeWin::ComputeUIAControlType() { // NOLINT(runtime/int)
// If this is a web area for a presentational iframe, give it a role of
// something other than document so that the fact that it's a separate doc
// is not exposed to AT.
......@@ -5701,7 +5704,7 @@ void AXPlatformNodeWin::HandleSpecialTextOffset(LONG* offset) {
TextBoundaryType AXPlatformNodeWin::IA2TextBoundaryToTextBoundary(
IA2TextBoundaryType ia2_boundary) {
switch(ia2_boundary) {
switch (ia2_boundary) {
case IA2_TEXT_BOUNDARY_CHAR:
return CHAR_BOUNDARY;
case IA2_TEXT_BOUNDARY_WORD:
......@@ -6035,9 +6038,9 @@ bool AXPlatformNodeWin::IsText(const base::string16& text,
return ch != kEmbeddedCharacter;
}
void AXPlatformNodeWin::ComputeHypertextRemovedAndInserted(int* start,
int* old_len,
int* new_len) {
void AXPlatformNodeWin::ComputeHypertextRemovedAndInserted(size_t* start,
size_t* old_len,
size_t* new_len) {
*start = 0;
*old_len = 0;
*new_len = 0;
......@@ -6091,9 +6094,9 @@ void AXPlatformNodeWin::ComputeHypertextRemovedAndInserted(int* start,
}
}
*start = (int)common_prefix;
*old_len = (int)(old_text.size() - common_prefix - common_suffix);
*new_len = (int)(new_text.size() - common_prefix - common_suffix);
*start = common_prefix;
*old_len = old_text.size() - common_prefix - common_suffix;
*new_len = new_text.size() - common_prefix - common_suffix;
}
int AXPlatformNodeWin::GetSelectionAnchor() {
......
......@@ -13,6 +13,8 @@
#include <uiautomation.h>
#include <wrl/client.h>
#include <map>
#include <string>
#include <vector>
#include "base/compiler_specific.h"
......@@ -851,7 +853,7 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2"))
base::string16 ComputeUIAProperties();
long ComputeUIAControlType();
LONG ComputeUIAControlType();
AXHypertext ComputeHypertext();
......@@ -914,9 +916,9 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2"))
int GetHypertextOffsetFromEndpoint(AXPlatformNodeWin* endpoint_object,
int endpoint_offset);
bool IsSameHypertextCharacter(size_t old_char_index, size_t new_char_index);
void ComputeHypertextRemovedAndInserted(int* start,
int* old_len,
int* new_len);
void ComputeHypertextRemovedAndInserted(size_t* start,
size_t* old_len,
size_t* new_len);
// If offset is a member of IA2TextSpecialOffsets this function updates the
// value of offset and returns, otherwise offset remains unchanged.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment