fix MSVC warning about possibly uninitialized variable in Ellipsize() (which indicated possibly incorrect usage of this function)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57658 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-12-30 12:06:54 +00:00
parent 4cb591b9df
commit 41ce5eff75

View File

@@ -324,9 +324,18 @@ wxString wxStaticTextBase::Ellipsize(const wxString& label) const
dc.SetFont(GetFont()); dc.SetFont(GetFont());
wxEllipsizeMode mode; wxEllipsizeMode mode;
if (HasFlag(wxST_ELLIPSIZE_START)) mode = wxELLIPSIZE_START; if ( HasFlag(wxST_ELLIPSIZE_START) )
else if (HasFlag(wxST_ELLIPSIZE_MIDDLE)) mode = wxELLIPSIZE_MIDDLE; mode = wxELLIPSIZE_START;
else if (HasFlag(wxST_ELLIPSIZE_END)) mode = wxELLIPSIZE_END; 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()); return wxControl::Ellipsize(label, dc, mode, sz.GetWidth());
} }