X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5c87527c5a81eda63e7ccbda2f226ca02716e7da..beb2638a997914bd12c55e81589adebd90af9ed2:/src/common/stattextcmn.cpp?ds=inline diff --git a/src/common/stattextcmn.cpp b/src/common/stattextcmn.cpp index 8dce7bed74..9558d2dfdd 100644 --- a/src/common/stattextcmn.cpp +++ b/src/common/stattextcmn.cpp @@ -324,9 +324,18 @@ wxString wxStaticTextBase::Ellipsize(const wxString& label) const dc.SetFont(GetFont()); wxEllipsizeMode mode; - if (HasFlag(wxST_ELLIPSIZE_START)) mode = wxELLIPSIZE_START; - else if (HasFlag(wxST_ELLIPSIZE_MIDDLE)) mode = wxELLIPSIZE_MIDDLE; - else if (HasFlag(wxST_ELLIPSIZE_END)) mode = wxELLIPSIZE_END; + if ( HasFlag(wxST_ELLIPSIZE_START) ) + mode = wxELLIPSIZE_START; + else if ( HasFlag(wxST_ELLIPSIZE_MIDDLE) ) + mode = wxELLIPSIZE_MIDDLE; + else if ( HasFlag(wxST_ELLIPSIZE_END) ) + mode = wxELLIPSIZE_END; + else + { + wxFAIL_MSG( "should only be called if have one of wxST_ELLIPSIZE_XXX" ); + + return label; + } return wxControl::Ellipsize(label, dc, mode, sz.GetWidth()); }