git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@456
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
else
{
// add 50% but not too much
- uint uiIncrement = m_uiSize >> 1;
+ uint uiIncrement = m_uiSize < WX_ARRAY_DEFAULT_INITIAL_SIZE
+ ? WX_ARRAY_DEFAULT_INITIAL_SIZE : m_uiSize >> 1;
if ( uiIncrement > ARRAY_MAXSIZE_INCREMENT )
uiIncrement = ARRAY_MAXSIZE_INCREMENT;
m_uiSize += uiIncrement;
// we check that all of mask bits are set in the current mask, so
// that wxLogTrace(wxTraceRefCount | wxTraceOle) will only do something
// if both bits are set.
- if ( pLog != NULL && (pLog->GetTraceMask() & mask == mask) ) {
+ if ( pLog != NULL && ((pLog->GetTraceMask() & mask) == mask) ) {
va_list argptr;
va_start(argptr, szFormat);
vsprintf(s_szBuf, szFormat, argptr);
// assignment operator
wxArrayString& wxArrayString::operator=(const wxArrayString& src)
{
- Clear();
+ if ( m_nSize > 0 )
+ Clear();
- m_nSize = 0;
if ( src.m_nCount > ARRAY_DEFAULT_INITIAL_SIZE )
Alloc(src.m_nCount);