Skip to content

Commit f589b1a

Browse files
committed
There is no list separator settings on mac, use wired-in characters.
1 parent 591f086 commit f589b1a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Sources/MacOSAppSupport/MAS_MacOSAppUtils.mm

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
@autoreleasepool {
1313
@try {
1414
NSString* decSeparator = (NSString*) [[NSLocale currentLocale] objectForKey:NSLocaleDecimalSeparator];
15-
std::wstring ds = NE::StringToWString ([decSeparator cStringUsingEncoding:NSUTF8StringEncoding]).c_str ();
16-
result.SetDecimalSeparator (ds.c_str ()[0]);
17-
18-
NSString* listSeparator = (NSString*) [[NSLocale currentLocale] objectForKey:NSLocaleGroupingSeparator];
19-
std::wstring ls = NE::StringToWString ([listSeparator cStringUsingEncoding:NSUTF8StringEncoding]).c_str ();
20-
result.SetListSeparator (ls.c_str ()[0]);
15+
std::wstring decimalSeparatorStr = NE::StringToWString ([decSeparator cStringUsingEncoding:NSUTF8StringEncoding]);
16+
wchar_t decimalSeparatorChar = decimalSeparatorStr[0];
17+
result.SetDecimalSeparator (decimalSeparatorChar);
18+
19+
wchar_t listSeparatorChar = L',';
20+
if (listSeparatorChar == decimalSeparatorChar) {
21+
listSeparatorChar = L';';
22+
}
23+
result.SetListSeparator (listSeparatorChar);
2124
} @catch (NSException*) {
2225

2326
}

Sources/MacOSAppSupport/MAS_NSViewContext.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@
252252
}
253253
return fontCache.at (key);
254254
} @catch (NSException*) {
255-
return nil;
255+
256256
}
257257
}
258258
return nil;

0 commit comments

Comments
 (0)