Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
applied patch to fix #699
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13641 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler committed Jun 4, 2010
1 parent 8d2c1f8 commit 0693339
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app/legend/qgslegend.cpp
Expand Up @@ -356,20 +356,23 @@ void QgsLegend::mouseReleaseEvent( QMouseEvent * e )

mMousePressedFlag = false;

if ( !mItemBeingMoved )
// move only if we have a valid item and drop place
// otherwise reset the stored values
if ( !mItemBeingMoved || !mDropTarget )
{
mItemBeingMoved = NULL;
mDropTarget = NULL;
return;
}

hideLine();

QTreeWidgetItem *destItem = mDropTarget;

QgsLegendItem* origin = dynamic_cast<QgsLegendItem *>( mItemBeingMoved );
mItemBeingMoved = NULL;
QModelIndex oldIndex = indexFromItem( origin );

QgsLegendItem* dest = dynamic_cast<QgsLegendItem *>( destItem );
QgsLegendItem* dest = dynamic_cast<QgsLegendItem *>( mDropTarget );
mDropTarget = NULL;

// no change?
if ( !dest || !origin || ( dest == origin ) )
Expand Down

0 comments on commit 0693339

Please sign in to comment.