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:
Václav Slavík
2016-04-17 18:36:20 +02:00
parent 59531f9616
commit fc4cfd4b9b

View File

@@ -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);
}