git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4447
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxLayoutDataObject *wldo = new wxLayoutDataObject;
wxLayoutList *llist = m_llist->GetSelection(wldo, invalidate);
if(! llist)
wxLayoutDataObject *wldo = new wxLayoutDataObject;
wxLayoutList *llist = m_llist->GetSelection(wldo, invalidate);
if(! llist)
+ {
+ delete wldo;
+ delete data;
// Export selection as text:
wxString text;
wxLayoutExportObject *exp;
// Export selection as text:
wxString text;
wxLayoutExportObject *exp;
// The exporter always appends a newline, so we chop it off if it
// is there:
{
// The exporter always appends a newline, so we chop it off if it
// is there:
{
text = text.Mid(0,len-1);
}
text = text.Mid(0,len-1);
}
- if (!wxTheClipboard->Open())
- return FALSE;
-
+ if (wxTheClipboard->Open())
+ {
#if wxUSE_PRIVATE_CLIPBOARD_FORMAT
#if wxUSE_PRIVATE_CLIPBOARD_FORMAT
- data->Add(wldo, TRUE /* preferred */);
- data->Add(new wxTextDataObject(text));
-#else
- wxTextDataObject *data = new wxTextDataObject( text );
+ data->Add(wldo, TRUE /* preferred */);
+ data->Add(new wxTextDataObject(text));
+ rc = wxTheClipboard->SetData( data );
+ wxTheClipboard->Close();
+ }
+ else
+ rc = FALSE;
- bool rc = wxTheClipboard->SetData( data );
-
- wxTheClipboard->Close();
+ delete wldo;
+ delete data;