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/trunk@76909 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-07-13 14:30:22 +00:00
parent 86e587a096
commit 45adc64f9f
3 changed files with 28 additions and 10 deletions

View File

@@ -346,6 +346,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()