mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-19 04:13:07 +00:00
8284690: [macos] VoiceOver : Getting java.lang.IllegalArgumentException: Invalid location on Editable JComboBox
Reviewed-by: serb
This commit is contained in:
parent
e32377e456
commit
ebfa27b9f0
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -288,7 +288,9 @@ class CAccessibleText {
|
||||
final AccessibleEditableText aet = ac.getAccessibleEditableText();
|
||||
if (aet == null) return null;
|
||||
|
||||
return aet.getTextRange(location, location + length);
|
||||
int currentLength = aet.getCharCount();
|
||||
return aet.getTextRange(Math.min(currentLength, location),
|
||||
Math.min(currentLength, location + length));
|
||||
}
|
||||
}, c);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user