Handle wxELLIPSIZE_NONE gracefully in wxControl::Ellipsize()

Since 44bcc3a723 wxRendererGeneric::DrawItemText()
could call Ellipsize() with wxELLIPSIZE_NONE mode, resulting in an assert.

Fix this by just not doing anything in this case.

Closes #125.
This commit is contained in:
Wacek Gocki
2015-11-03 22:27:08 +01:00
committed by Vadim Zeitlin
parent 1bb714b9df
commit 4e49638a6c
2 changed files with 5 additions and 1 deletions

View File

@@ -520,6 +520,9 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc,
wxEllipsizeMode mode, int maxFinalWidth,
int flags)
{
if (mode == wxELLIPSIZE_NONE)
return label;
wxString ret;
// these cannot be cached between different Ellipsize() calls as they can