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
This commit is contained in:
Václav Slavík 2011-02-09 19:51:58 +00:00
parent 1d065710d3
commit d6ebae9a94

2
src/common/ctrlcmn.cpp Normal file → Executable file
View File

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