wxMSW: Fix display of file history items in menus
Unlike other platforms, wxMSW assumes natural text directionality (i.e. right to left under RTL locales), but absolutely filenames are always LTR because they begin with a Latin character. It is therefore necessary to add an explicit directional mark in front of them on Windows.
This commit is contained in:
@@ -50,6 +50,14 @@ wxString GetMRUEntryLabel(int n, const wxString& path)
|
||||
wxString pathInMenu(path);
|
||||
pathInMenu.Replace("&", "&&");
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// absolute paths always start with Latin characters even in RTL
|
||||
// environments and should therefore be rendered as LTR text (possibly with
|
||||
// RTL chunks in it). Ensure this on Windows by prepending
|
||||
// LEFT-TO-RIGHT EMBEDDING (other platforms detect this automatically)
|
||||
pathInMenu.insert(0, wchar_t(0x202a));
|
||||
#endif
|
||||
|
||||
return wxString::Format("&%d %s", n + 1, pathInMenu);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user