minor cleanup

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38349 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Surovell 2006-03-24 17:19:35 +00:00
parent 6fa9383b57
commit de5e599c8a

View File

@ -188,8 +188,6 @@ bool wxDropTarget::GetData()
FlavorType theType;
FlavorFlags theFlags;
UInt16 flavors;
bool firstFileAdded = false;
wxString filenamesPassed;
CountDragItems( (DragReference)m_currentDrag, &items );
@ -262,7 +260,6 @@ bool wxDropTarget::GetData()
#endif
case kDragFlavorTypeHFS:
{
if (theData != NULL)
{
HFSFlavor* theFile = (HFSFlavor*)theData;
@ -271,7 +268,6 @@ bool wxDropTarget::GetData()
if (!name.IsEmpty())
filenamesPassed += name + wxT("\n");
}
}
break;
default:
@ -285,6 +281,7 @@ bool wxDropTarget::GetData()
}
}
}
if (filenamesPassed.Len() > 0)
{
wxCharBuffer buf = filenamesPassed.fn_str();
@ -334,14 +331,13 @@ wxDragResult wxDropSource::DoDragDrop(int flags)
{
wxASSERT_MSG( m_data, wxT("Drop source: no data") );
if (!m_data)
return (wxDragResult) wxDragNone;
if (m_data->GetFormatCount() == 0)
if ((m_data == NULL) || (m_data->GetFormatCount() == 0))
return (wxDragResult)wxDragNone;
OSStatus result;
DragReference theDrag;
RgnHandle dragRegion;
if ((result = NewDrag( &theDrag )) != noErr)
return wxDragNone;
@ -619,27 +615,20 @@ pascal OSErr wxMacWindowDragTrackingHandler(
{
if ( !trackingGlobals->m_currentSource->MacInstallDefaultCursor( result ) )
{
int cursorID = wxCURSOR_NONE;
switch (result)
{
case wxDragCopy:
{
wxCursor cursor(wxCURSOR_COPY_ARROW);
cursor.MacInstall();
}
cursorID = wxCURSOR_COPY_ARROW;
break;
case wxDragMove:
{
wxCursor cursor(wxCURSOR_ARROW);
cursor.MacInstall();
}
cursorID = wxCURSOR_ARROW;
break;
case wxDragNone:
{
wxCursor cursor(wxCURSOR_NO_ENTRY);
cursor.MacInstall();
}
cursorID = wxCURSOR_NO_ENTRY;
break;
case wxDragError:
@ -649,6 +638,12 @@ pascal OSErr wxMacWindowDragTrackingHandler(
// put these here to make gcc happy
;
}
if (cursorID != wxCURSOR_NONE)
{
wxCursor cursor( cursorID );
cursor.MacInstall();
}
}
}
}