From fc4cfd4b9b2369d131f7f7b87f3598a4238effbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Sun, 17 Apr 2016 18:36:20 +0200 Subject: [PATCH] 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. --- src/common/filehistorycmn.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/common/filehistorycmn.cpp b/src/common/filehistorycmn.cpp index c27ed12c0f..f349f44065 100644 --- a/src/common/filehistorycmn.cpp +++ b/src/common/filehistorycmn.cpp @@ -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); }