Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit db05d76

Browse files
author
Raj Seshasankaran
authored
Merge pull request #2814 from rajsesh-msft/1711.1_release
1711.1 release
2 parents c5fb684 + 50d5773 commit db05d76

File tree

98 files changed

+9236
-387
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+9236
-387
lines changed

Frameworks/Foundation/NSArray.mm

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,7 @@ - (id)objectAtIndexedSubscript:(NSUInteger)index {
192192
@Status Interoperable
193193
*/
194194
- (NSUInteger)indexOfObject:(id)obj {
195-
int count = [self count];
196-
197-
for (int i = 0; i < count; i++) {
198-
id value = [self objectAtIndex:i];
199-
200-
if ([obj isEqual:value]) {
201-
return i;
202-
}
203-
}
204-
205-
return NSNotFound;
195+
return [self indexOfObject:obj inRange:NSRange{ 0, self.count }];
206196
}
207197

208198
/**

Frameworks/Foundation/NSCFArray.mm

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "Starboard.h"
1818
#include "CFHelpers.h"
1919
#include "CFFoundationInternal.h"
20+
#include "ForFoundationOnly.h"
2021
#include <CoreFoundation/CFArray.h>
2122
#include "NSCFArray.h"
2223
#include "BridgeHelpers.h"
@@ -84,7 +85,9 @@ - (NSUInteger)count {
8485
- (id)objectAtIndex:(NSUInteger)index {
8586
if (index >= CFArrayGetCount((CFArrayRef)self)) {
8687
[NSException raise:@"Array out of bounds"
87-
format:@"objectAtIndex: index > count (%lu > %lu), throwing exception\n", (unsigned long)index, (unsigned long)CFArrayGetCount((CFArrayRef)self)];
88+
format:@"objectAtIndex: index > count (%lu > %lu), throwing exception\n",
89+
(unsigned long)index,
90+
(unsigned long)CFArrayGetCount((CFArrayRef)self)];
8891
return nil;
8992
}
9093
return (id)CFArrayGetValueAtIndex((CFArrayRef)self, index);
@@ -111,7 +114,7 @@ - (void)replaceObjectAtIndex:(NSUInteger)index withObject:(NSObject*)obj {
111114
CFRange range;
112115
range.location = index;
113116
range.length = 1;
114-
CFArrayReplaceValues(static_cast<CFMutableArrayRef>(self), range, (const void**)(&obj), 1);
117+
_CFArrayReplaceValues(static_cast<CFMutableArrayRef>(self), range, (const void**)(&obj), 1);
115118
}
116119

117120
- (void)insertObject:(NSObject*)objAddr atIndex:(NSUInteger)index {
@@ -120,6 +123,11 @@ - (void)insertObject:(NSObject*)objAddr atIndex:(NSUInteger)index {
120123
CFArrayInsertValueAtIndex(static_cast<CFMutableArrayRef>(self), index, reinterpret_cast<const void*>(objAddr));
121124
}
122125

126+
- (void)exchangeObjectAtIndex:(NSUInteger)atIndex withObjectAtIndex:(NSUInteger)withIndex {
127+
BRIDGED_THROW_IF_IMMUTABLE(_CFArrayIsMutable, CFArrayRef);
128+
CFArrayExchangeValuesAtIndices(static_cast<CFMutableArrayRef>(self), atIndex, withIndex);
129+
}
130+
123131
- (void)removeAllObjects {
124132
BRIDGED_THROW_IF_IMMUTABLE(_CFArrayIsMutable, CFArrayRef);
125133
CFArrayRemoveAllValues((CFMutableArrayRef)self);

Frameworks/Foundation/NSCFCollectionSupport.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,16 @@ CFHashCode _NSCFCallbackHash(const void* value);
3838
} \
3939
} while (false)
4040

41+
#define NS_COLLECTION_VALIDATE_RANGE(range, count) \
42+
do { \
43+
if (range.location + range.length > (count)) { \
44+
[NSException raise:NSInvalidArgumentException \
45+
format:@"*** %s: Range {%lu, %lu} out of bounds; legal range is {0, %lu}", \
46+
__PRETTY_FUNCTION__, \
47+
(unsigned long)range.location, \
48+
(unsigned long)range.length, \
49+
(unsigned long)(count)]; \
50+
} \
51+
} while (false)
52+
4153
#endif // __OBJC__

Frameworks/Foundation/NSMutableArray.mm

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#import "CFHelpers.h"
2323
#import "NSRaise.h"
2424
#import "NSCFArray.h"
25+
#import "NSCFCollectionSupport.h"
2526
#import "BridgeHelpers.h"
2627

2728
#include <algorithm>
@@ -154,49 +155,53 @@ - (void)exchangeObjectAtIndex:(NSUInteger)atIndex withObjectAtIndex:(NSUInteger)
154155
[obj2 release];
155156
}
156157

157-
/**
158-
@Status Interoperable
159-
*/
160-
- (void)removeObject:(NSObject*)objAddr {
161-
if (objAddr == nil) {
162-
TraceVerbose(TAG, L"objAddr = nil!");
163-
}
158+
using _NSObjectComparator = bool (*)(id, id);
164159

165-
int idx = [self indexOfObject:objAddr];
166-
if (idx != NSNotFound) {
167-
[self removeObjectAtIndex:idx];
160+
- (void)_removeObject:(NSObject*)object inRange:(NSRange)range withComparator:(_NSObjectComparator)comparator {
161+
NS_COLLECTION_VALIDATE_RANGE(range, self.count);
162+
for (NSUInteger i = range.location + range.length; i > range.location; --i) {
163+
id cur = [self objectAtIndex:i - 1];
164+
if (comparator(object, cur)) {
165+
[self removeObjectAtIndex:i - 1];
166+
}
168167
}
169168
}
170169

171170
/**
172171
@Status Interoperable
173172
*/
174-
- (void)removeObject:(NSObject*)objAddr inRange:(NSRange)range {
175-
for (int i = range.location + range.length - 1; i >= (int)range.location; i--) {
176-
id curObj = [self objectAtIndex:i];
173+
- (void)removeObject:(NSObject*)object {
174+
[self removeObject:object inRange:NSRange{ 0, self.count }];
175+
}
176+
/**
177+
@Status Interoperable
178+
*/
179+
- (void)removeObject:(NSObject*)object inRange:(NSRange)range {
180+
[self _removeObject:object inRange:range withComparator:[](id left, id right) -> bool { return [right isEqual:left]; }];
181+
}
177182

178-
if ([curObj isEqual:objAddr]) {
179-
[self removeObject:curObj];
180-
}
181-
}
183+
/**
184+
@Status Interoperable
185+
*/
186+
- (void)removeObjectIdenticalTo:(NSObject*)object {
187+
[self removeObjectIdenticalTo:object inRange:NSRange{ 0, self.count }];
182188
}
183189

184190
/**
185191
@Status Interoperable
186192
*/
187-
- (void)removeObjectsInRange:(NSRange)range {
188-
for (int i = range.location + range.length - 1; i >= (int)range.location; i--) {
189-
[self removeObjectAtIndex:i];
190-
}
193+
- (void)removeObjectIdenticalTo:(id)object inRange:(NSRange)range {
194+
[self _removeObject:object inRange:range withComparator:[](id left, id right) -> bool { return right == left; }];
191195
}
192196

193197
/**
194198
@Status Interoperable
195199
*/
196-
- (void)removeObjectIdenticalTo:(NSObject*)objAddr {
197-
int idx = [self indexOfObjectIdenticalTo:objAddr];
198-
if (idx != NSNotFound) {
199-
[self removeObjectAtIndex:idx];
200+
- (void)removeObjectsInRange:(NSRange)range {
201+
NS_COLLECTION_VALIDATE_RANGE(range, self.count);
202+
203+
for (NSUInteger i = range.location + range.length; i > range.location; --i) {
204+
[self removeObjectAtIndex:i - 1];
200205
}
201206
}
202207

@@ -212,10 +217,10 @@ - (void)removeObjectAtIndex:(NSUInteger)index {
212217
@Status Interoperable
213218
*/
214219
- (void)removeObjectsAtIndexes:(NSIndexSet*)indexSet {
215-
[indexSet enumerateIndexesWithOptions:NSEnumerationReverse
216-
usingBlock:^(NSUInteger index, BOOL* stop) {
217-
[self removeObjectAtIndex:index];
218-
}];
220+
[indexSet enumerateRangesWithOptions:NSEnumerationReverse
221+
usingBlock:^(NSRange range, BOOL* stop) {
222+
[self removeObjectsInRange:range];
223+
}];
219224
}
220225

221226
/**
@@ -492,14 +497,6 @@ - (void)filterUsingPredicate:(NSPredicate*)predicate {
492497
}
493498
}
494499

495-
/**
496-
@Status Stub
497-
@Notes
498-
*/
499-
- (void)removeObjectIdenticalTo:(id)anObject inRange:(NSRange)aRange {
500-
UNIMPLEMENTED();
501-
}
502-
503500
/**
504501
@Status Stub
505502
@Notes

Frameworks/UIKit.Xaml/TextField.xaml.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ unsigned int TextField::c_borderCornerRadius = 8;
3737
Platform::Boolean TextField::s_dependencyPropertiesRegistered = false;
3838

3939
template <typename T>
40-
T TextField::FindTemplateChild(FrameworkElement^ source, Platform::String^ name) {
40+
static T FindTemplateChild(FrameworkElement^ source, Platform::String^ name) {
4141
T target = nullptr;
4242
if (source) {
4343
unsigned int count = VisualTreeHelper::GetChildrenCount(source);

deps/3rdparty/cassowary-0.60/cassowary-0.60-Windows.vcxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
44
<ProjectConfiguration Include="Debug|ARM">
55
<Configuration>Debug</Configuration>
@@ -32,29 +32,29 @@
3232
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
3333
<ConfigurationType>StaticLibrary</ConfigurationType>
3434
<UseDebugLibraries>true</UseDebugLibraries>
35-
<PlatformToolset>v140</PlatformToolset>
35+
<PlatformToolset>v141</PlatformToolset>
3636
<CharacterSet>Unicode</CharacterSet>
3737
<TargetName>cassowary-0.60-Debug</TargetName>
3838
</PropertyGroup>
3939
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
4040
<ConfigurationType>StaticLibrary</ConfigurationType>
4141
<UseDebugLibraries>true</UseDebugLibraries>
42-
<PlatformToolset>v140</PlatformToolset>
42+
<PlatformToolset>v141</PlatformToolset>
4343
<CharacterSet>Unicode</CharacterSet>
4444
<TargetName>cassowary-0.60-Debug</TargetName>
4545
</PropertyGroup>
4646
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
4747
<ConfigurationType>StaticLibrary</ConfigurationType>
4848
<UseDebugLibraries>false</UseDebugLibraries>
49-
<PlatformToolset>v140</PlatformToolset>
49+
<PlatformToolset>v141</PlatformToolset>
5050
<WholeProgramOptimization>true</WholeProgramOptimization>
5151
<CharacterSet>Unicode</CharacterSet>
5252
<TargetName>cassowary-0.60</TargetName>
5353
</PropertyGroup>
5454
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
5555
<ConfigurationType>StaticLibrary</ConfigurationType>
5656
<UseDebugLibraries>false</UseDebugLibraries>
57-
<PlatformToolset>v140</PlatformToolset>
57+
<PlatformToolset>v141</PlatformToolset>
5858
<WholeProgramOptimization>true</WholeProgramOptimization>
5959
<CharacterSet>Unicode</CharacterSet>
6060
<TargetName>cassowary-0.60</TargetName>
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)