Don't eat ampersands in wxDataViewCtrl and similar controls items

Fix the call to wxControl::Ellipsize() inside DrawItemText() added in
b7a89f8746 (see #16414) which removed all
ampersands from the string with the default flags to not do it.

Closes #17269.
This commit is contained in:
Vadim Zeitlin 2015-11-30 00:08:06 +01:00
parent f8bc9abfc4
commit 6cd37dd3c8

View File

@ -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.