Fix wxStringTokenizer copy ctor and assignment operator.

Implement copying of wxStringTokenizer correctly: compiler-generated versions
didn't work as the position of the tokenizer didn't point into the correct
string after making the copy.

Fix this by adjusting the position iterator to use the copy of the string.

Closes #16339.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-10-20 15:08:09 +00:00
parent 82a591c138
commit 069415c2a6
4 changed files with 78 additions and 0 deletions

View File

@@ -47,6 +47,9 @@ public:
wxStringTokenizer(const wxString& str,
const wxString& delims = wxDEFAULT_DELIMITERS,
wxStringTokenizerMode mode = wxTOKEN_DEFAULT);
// copy ctor and assignment operator
wxStringTokenizer(const wxStringTokenizer& src);
wxStringTokenizer& operator=(const wxStringTokenizer& src);
// args are same as for the non default ctor above
void SetString(const wxString& str,
@@ -112,6 +115,8 @@ protected:
bool DoHasMoreTokens() const;
void DoCopyFrom(const wxStringTokenizer& src);
enum MoreTokensState
{
MoreTokens_Unknown,