From 2233af93b024adfdca370ad58436aab92374a087 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 25 Mar 2007 19:46:05 +0000 Subject: [PATCH] remove wxStringBase::AllocCopy(), it wasn't used anywhere git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45053 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/string.h | 2 -- src/common/string.cpp | 20 -------------------- 2 files changed, 22 deletions(-) diff --git a/include/wx/string.h b/include/wx/string.h index aa01f5fee3..bc55fadaa4 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -291,8 +291,6 @@ protected: // memory allocation // allocates memory for string of length nLen bool AllocBuffer(size_t nLen); - // copies data to another string - bool AllocCopy(wxString&, int, int) const; // effectively copies data to string bool AssignCopy(size_t, const wxChar *); diff --git a/src/common/string.cpp b/src/common/string.cpp index f26486112a..8d39d9ceea 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -891,26 +891,6 @@ bool wxStringBase::ConcatSelf(size_t nSrcLen, const wxChar *pszSrcData, return true; } -// --------------------------------------------------------------------------- -// simple sub-string extraction -// --------------------------------------------------------------------------- - -// helper function: clone the data attached to this string -bool wxStringBase::AllocCopy(wxString& dest, int nCopyLen, int nCopyIndex) const -{ - if ( nCopyLen == 0 ) { - dest.Init(); - } - else { - if ( !dest.AllocBuffer(nCopyLen) ) { - // allocation failure handled by caller - return false; - } - memcpy(dest.m_pchData, m_pchData + nCopyIndex, nCopyLen*sizeof(wxChar)); - } - return true; -} - #endif // !wxUSE_STL_BASED_WXSTRING #if !wxUSE_STL_BASED_WXSTRING || !defined(HAVE_STD_STRING_COMPARE) -- 2.45.2