From e5e92c92ce5982662cb6c5dfd0f355ddb075da47 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 4654188081..c2ca5c5ea4 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); }