Allow initializing wxScopedArray more conveniently.
Typical wxScopedArray initialization uses "new T[n]" expression, allow to omit most of it and specify just n, the number of elements to allocate. Use the new shorter form in the places where wxScopedArray(new ...) was used (which is in almost all of them) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75504 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -626,7 +626,7 @@ bool wxClipboard::AddData( wxDataObject *data )
|
||||
|
||||
// get formats from wxDataObjects
|
||||
const size_t count = data->GetFormatCount();
|
||||
wxDataFormatArray formats(new wxDataFormat[count]);
|
||||
wxDataFormatArray formats(count);
|
||||
data->GetAllFormats(formats.get());
|
||||
|
||||
// always provide TIMESTAMP as a target, see comments in selection_handler
|
||||
@@ -690,7 +690,7 @@ bool wxClipboard::GetData( wxDataObject& data )
|
||||
// get all supported formats from wxDataObjects: notice that we are setting
|
||||
// the object data, so we need them in "Set" direction
|
||||
const size_t count = data.GetFormatCount(wxDataObject::Set);
|
||||
wxDataFormatArray formats(new wxDataFormat[count]);
|
||||
wxDataFormatArray formats(count);
|
||||
data.GetAllFormats(formats.get(), wxDataObject::Set);
|
||||
|
||||
for ( size_t i = 0; i < count; i++ )
|
||||
|
Reference in New Issue
Block a user