Add wxItemContainer::DetachClientObject() and use it in wxRearrangeList.
Add a method to detach the item from an item control without deleting it and use it in wxRearrangeList to correctly swap object client data without deleting the pointers in the process. Closes #12201. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -296,8 +296,13 @@ public:
|
||||
void SetClientData(unsigned int n, void* clientData);
|
||||
void* GetClientData(unsigned int n) const;
|
||||
|
||||
// SetClientObject() takes ownership of the pointer, GetClientObject()
|
||||
// returns it but keeps the ownership while DetachClientObject() expects
|
||||
// the caller to delete the pointer and also resets the internally stored
|
||||
// one to NULL for this item
|
||||
void SetClientObject(unsigned int n, wxClientData* clientData);
|
||||
wxClientData* GetClientObject(unsigned int n) const;
|
||||
wxClientData* DetachClientObject(unsigned int n);
|
||||
|
||||
// return the type of client data stored in this control: usually it just
|
||||
// returns m_clientDataItemsType but must be overridden in the controls
|
||||
|
Reference in New Issue
Block a user