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:
2
src/common/ctrlcmn.cpp
Normal file → Executable file
2
src/common/ctrlcmn.cpp
Normal file → Executable file
@@ -255,7 +255,7 @@ wxString wxControlBase::DoEllipsizeSingleLine(const wxString& curLine, const wxD
|
|||||||
|
|
||||||
wxArrayInt charOffsetsPx;
|
wxArrayInt charOffsetsPx;
|
||||||
size_t len = curLine.length();
|
size_t len = curLine.length();
|
||||||
if (len == 0 ||
|
if (len <= 1 ||
|
||||||
!dc.GetPartialTextExtents(curLine, charOffsetsPx))
|
!dc.GetPartialTextExtents(curLine, charOffsetsPx))
|
||||||
return curLine;
|
return curLine;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user