@@ -12,7 +12,10 @@ use accesskit_consumer::{
12
12
use std:: sync:: { Arc , RwLock , Weak } ;
13
13
use windows:: {
14
14
core:: * ,
15
- Win32 :: { Foundation :: * , System :: Com :: * , UI :: Accessibility :: * } ,
15
+ Win32 :: {
16
+ System :: { Com :: * , Variant :: * } ,
17
+ UI :: Accessibility :: * ,
18
+ } ,
16
19
} ;
17
20
18
21
use crate :: { context:: Context , node:: PlatformNode , util:: * } ;
@@ -328,8 +331,8 @@ impl ITextRangeProvider_Impl for PlatformRange_Impl {
328
331
Ok ( self . this . clone ( ) . into ( ) )
329
332
}
330
333
331
- fn Compare ( & self , other : Option < & ITextRangeProvider > ) -> Result < BOOL > {
332
- let other = unsafe { required_param ( other) ?. as_impl ( ) } ;
334
+ fn Compare ( & self , other : Ref < ITextRangeProvider > ) -> Result < BOOL > {
335
+ let other = unsafe { required_param ( & other) ?. as_impl ( ) } ;
333
336
Ok ( ( self . context . ptr_eq ( & other. context )
334
337
&& * self . state . read ( ) . unwrap ( ) == * other. state . read ( ) . unwrap ( ) )
335
338
. into ( ) )
@@ -338,10 +341,10 @@ impl ITextRangeProvider_Impl for PlatformRange_Impl {
338
341
fn CompareEndpoints (
339
342
& self ,
340
343
endpoint : TextPatternRangeEndpoint ,
341
- other : Option < & ITextRangeProvider > ,
344
+ other : Ref < ITextRangeProvider > ,
342
345
other_endpoint : TextPatternRangeEndpoint ,
343
346
) -> Result < i32 > {
344
- let other = unsafe { required_param ( other) ?. as_impl ( ) } ;
347
+ let other = unsafe { required_param ( & other) ?. as_impl ( ) } ;
345
348
if std:: ptr:: eq ( other as * const _ , & self . this as * const _ ) {
346
349
// Comparing endpoints within the same range can be done
347
350
// safely without upgrading the range. This allows ATs
@@ -531,10 +534,10 @@ impl ITextRangeProvider_Impl for PlatformRange_Impl {
531
534
fn MoveEndpointByRange (
532
535
& self ,
533
536
endpoint : TextPatternRangeEndpoint ,
534
- other : Option < & ITextRangeProvider > ,
537
+ other : Ref < ITextRangeProvider > ,
535
538
other_endpoint : TextPatternRangeEndpoint ,
536
539
) -> Result < ( ) > {
537
- let other = unsafe { required_param ( other) ?. as_impl ( ) } ;
540
+ let other = unsafe { required_param ( & other) ?. as_impl ( ) } ;
538
541
self . require_same_context ( other) ?;
539
542
// We have to obtain the tree state and ranges manually to avoid
540
543
// lifetime issues, and work with the two locks in a specific order
0 commit comments