fix a fatal crash due to using wxHSCROLL presence in m_windowStyle as indicator of whether we wrap lines or not: this didn't work because wxHSCROLL was temporarily reset in wxWindow::Create() and so we used wxTextWrappedData when we only had created wxTextMultiLineData
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -650,6 +650,7 @@ void wxTextCtrl::Init()
|
||||
|
||||
m_isModified = false;
|
||||
m_isEditable = true;
|
||||
m_wrapLines = false;
|
||||
|
||||
m_posLast =
|
||||
m_curPos =
|
||||
@@ -695,9 +696,18 @@ bool wxTextCtrl::Create(wxWindow *parent,
|
||||
// create data object for normal multiline or for controls with line
|
||||
// wrap as needed
|
||||
if ( style & wxHSCROLL )
|
||||
{
|
||||
m_data.mdata = new wxTextMultiLineData;
|
||||
else
|
||||
}
|
||||
else // we must wrap lines if we don't have horizontal scrollbar
|
||||
{
|
||||
// NB: we can't rely on HasFlag(wxHSCROLL) as the flags can change
|
||||
// later and even wxWindow::Create() itself temporarily resets
|
||||
// wxHSCROLL in wxUniv, so remember that we have a wrapped data
|
||||
// and not just a multi line data in a separate variable
|
||||
m_wrapLines = true;
|
||||
m_data.wdata = new wxTextWrappedData;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user