[QGIS Commit] r13641 - trunk/qgis/src/app/legend

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Jun 3 21:39:03 EDT 2010


Author: brushtyler
Date: 2010-06-03 21:39:01 -0400 (Thu, 03 Jun 2010)
New Revision: 13641

Modified:
   trunk/qgis/src/app/legend/qgslegend.cpp
Log:
applied patch to fix #699

Modified: trunk/qgis/src/app/legend/qgslegend.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegend.cpp	2010-06-04 01:33:41 UTC (rev 13640)
+++ trunk/qgis/src/app/legend/qgslegend.cpp	2010-06-04 01:39:01 UTC (rev 13641)
@@ -356,20 +356,23 @@
 
   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 ) )



More information about the QGIS-commit mailing list