From 5cf745611b9c17e44882f82ac264679ab6c6a0cb Mon Sep 17 00:00:00 2001 From: iwbnwif Date: Sat, 9 Nov 2019 08:23:15 +0000 Subject: [PATCH] Don't take trailing whitespace into account when ellipsizing Trailing spaces and tabs are invisible, so the string shouldn't be truncated (possibly losing some printable characters that could have been displayed) just in order to show "..." instead of them. --- src/common/ctrlcmn.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index f0081b479e..147e613e1d 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -596,6 +596,7 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc, { if ( pc == label.end() || *pc == wxS('\n') ) { + curLine.Trim(); curLine = DoEllipsizeSingleLine(curLine, dc, mode, maxFinalWidth, replacementWidth, flags);