From 6cd37dd3c8ac672324621d2b0eaa75b66b8e257d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 30 Nov 2015 00:08:06 +0100 Subject: [PATCH] Don't eat ampersands in wxDataViewCtrl and similar controls items Fix the call to wxControl::Ellipsize() inside DrawItemText() added in b7a89f8746b8861712b4e066aaeca4f93083afea (see #16414) which removed all ampersands from the string with the default flags to not do it. Closes #17269. --- src/generic/renderg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generic/renderg.cpp b/src/generic/renderg.cpp index d8850c0945..d42a5e654b 100644 --- a/src/generic/renderg.cpp +++ b/src/generic/renderg.cpp @@ -959,9 +959,12 @@ wxRendererGeneric::DrawItemText(wxWindow* WXUNUSED(win), textColour = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT); } + // Be careful to avoid using the default flags here as otherwise any + // ampersands in the text would be consumed (and tabs expanded). const wxString paintText = wxControl::Ellipsize(text, dc, ellipsizeMode, - rect.GetWidth()); + rect.GetWidth(), + wxELLIPSIZE_FLAGS_NONE); // Draw text taking care not to change its colour if it had been set by the // caller for a normal item to allow having items in non-default colours.