From d6ebae9a94d019147172f265576e02276b066df7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 9 Feb 2011 19:51:58 +0000 Subject: [PATCH] Ellipsization can't shorten 1-character string. It doesn't make sense to attempt to shorten 1 character long string, so don't do it. Note that 2 characters strings may be shortened (consider e.g. "mm" in some typefaces). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/ctrlcmn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 src/common/ctrlcmn.cpp diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp old mode 100644 new mode 100755 index da1a63db74..444e0163e8 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -255,7 +255,7 @@ wxString wxControlBase::DoEllipsizeSingleLine(const wxString& curLine, const wxD wxArrayInt charOffsetsPx; size_t len = curLine.length(); - if (len == 0 || + if (len <= 1 || !dc.GetPartialTextExtents(curLine, charOffsetsPx)) return curLine; -- 2.45.2