Make wxMSW wxTextCtrl::AdjustSpaceLimit() safe to call in all cases.

Allow calling this function not only from inside DoWriteText(): first, because
the existing code could be doing this (although this is only a concern in 3.0
branch as it was made private in the trunk) and second because it could
actually happen if the text limit was exceeded by user typing in the control.

See #15980.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-04-27 22:38:50 +00:00
parent 498ef1d6dc
commit 635517ca85
2 changed files with 18 additions and 8 deletions

View File

@@ -203,11 +203,11 @@ protected:
// the limit is due to a previous call to SetMaxLength() and not built in)
bool HasSpaceLimit(unsigned int *len) const;
// call this to increase the size limit (will do nothing if the current
// limit is big enough)
// Used by EN_MAXTEXT handler to increase the size limit (will do nothing
// if the current limit is big enough). Should never be called directly.
//
// returns true if we increased the limit to allow entering more text,
// false if we hit the limit set by SetMaxLength() and so didn't change it
// Returns true if we increased the limit to allow entering more text,
// false if we hit the limit set by SetMaxLength() and so didn't change it.
bool AdjustSpaceLimit();
#if wxUSE_RICHEDIT && (!wxUSE_UNICODE || wxUSE_UNICODE_MSLU)