Fix inserting an element of wxArrayString itself back into it.

Do the insertion/addition before deallocating the old memory to allow things
like array.Add(array[0]) to work correctly.

Closes #2290.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-07-13 14:27:29 +00:00
parent 7da4930b12
commit 0de26e62a7
3 changed files with 28 additions and 10 deletions

View File

@@ -348,6 +348,10 @@ void ArraysTestCase::wxStringArrayTest()
a5.resize(3);
CPPUNIT_ASSERT_EQUAL( 3, a5.size() );
CPPUNIT_ASSERT_EQUAL( "Foo", a5[2] );
wxArrayString a6;
a6.Add("Foo");
a6.Insert(a6[0], 1, 100);
}
void ArraysTestCase::SortedArray()