From 889b406b0ef25d6b6a0d3138180c3b038594a3a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Tue, 14 Feb 2017 12:12:35 +0100 Subject: [PATCH] Fix sizing in wxMarkupParserRenderItemOutput::OnText Pass the text without mnemonics to GetTextExtent(). --- src/generic/markuptext.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/generic/markuptext.cpp b/src/generic/markuptext.cpp index 8a24a282f9..ba999da5b1 100644 --- a/src/generic/markuptext.cpp +++ b/src/generic/markuptext.cpp @@ -253,8 +253,10 @@ public: m_ellipsizeMode = ellipsizeMode == wxELLIPSIZE_NONE ? wxELLIPSIZE_NONE : wxELLIPSIZE_END; } - virtual void OnText(const wxString& text) wxOVERRIDE + virtual void OnText(const wxString& text_) wxOVERRIDE { + const wxString text(wxControl::RemoveMnemonics(text_)); + wxRect rect(m_rect); rect.x = m_pos; rect.SetRight(m_rect.GetRight()); @@ -286,7 +288,7 @@ public: m_renderer->DrawItemText(m_win, m_dc, - wxControl::RemoveMnemonics(text), + text, rect, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL, m_rendererFlags,