merged in the commit from the 2.2 branch

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8477 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-10-04 23:38:26 +00:00
parent 3438012b66
commit fb20fa43a0
2 changed files with 38 additions and 8 deletions

View File

@@ -1536,8 +1536,34 @@ int wxString::sprintf(const wxChar *pszFormat, ...)
// ---------------------------------------------------------------------------
// standard C++ library string functions
// ---------------------------------------------------------------------------
#ifdef wxSTD_STRING_COMPATIBILITY
void wxString::resize(size_t nSize, wxChar ch)
{
size_t len = length();
if ( nSize < len )
{
Truncate(nSize);
}
else if ( nSize > len )
{
*this += wxString(ch, len - nSize);
}
//else: we have exactly the specified length, nothing to do
}
void wxString::swap(wxString& str)
{
// this is slightly less efficient than fiddling with m_pchData directly,
// but it is still quite efficient as we don't copy the string here because
// ref count always stays positive
wxString tmp = str;
str = *this;
*this = str;
}
wxString& wxString::insert(size_t nPos, const wxString& str)
{
wxASSERT( str.GetStringData()->IsValid() );