Author: paullanders
Date: Tue Aug 18 01:19:29 2015
New Revision: 38908

URL: http://svn.gna.org/viewcvs/gnustep?rev=38908&view=rev
Log:
Moved earlier fix to editing a selected row with a single click, as it was 
overridding other behavior being too early in the function.

Modified:
    libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m

Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m?rev=38908&r1=38907&r2=38908&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m     
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSTableView.m     Tue Aug 
18 01:19:29 2015
@@ -3675,6 +3675,7 @@
 {
   NSPoint initialLocation = [theEvent locationInWindow];
   NSPoint location;
+  BOOL clickedRowSelectedBeforeClick;
   int clickCount = [theEvent clickCount];
   
   // Pathological case -- ignore mouse down
@@ -3718,15 +3719,7 @@
           if ([self _isGroupRow: _clickedRow])
             theColumn = -1;
                        
-                 // Check for single click on already-selected editable cell 
to begin editing
-                 if (clickCount == 1 && [self isRowSelected: _clickedRow] && 
[self _isCellEditableColumn: _clickedColumn row: _clickedRow ])
-                       {
-                         [self editColumn: _clickedColumn
-                           row: _clickedRow
-                     withEvent: theEvent
-                        select: YES];
-                         return;
-                       }
+          clickedRowSelectedBeforeClick = [self isRowSelected: _clickedRow];
 
           // Application specific hit test processing is handled within the 
delegate's should select callbacks
           // if they're implemented...however - I'm not sure when this SHOULD 
be invoked...
@@ -4103,15 +4096,26 @@
       /* If this was a simple click (ie. no dragging), we send our action. */
       if (sendAction)
         {
-          /*
-           _clickedRow and _clickedColumn are already set at the start of
-           this function.
-           
-           TODO: should we ask the data source/column for the cell for this
-           row/column and check whether it has its own action/target?
-           */
-          if (_clickedRow != -1)
-            [self sendAction: _action  to: _target];
+          // Check for single click on already-selected editable cell to begin 
editing
+          if (clickCount == 1 &&  clickedRowSelectedBeforeClick && [self 
_isCellEditableColumn: _clickedColumn row: _clickedRow ])
+            {
+              [self editColumn: _clickedColumn
+                           row: _clickedRow
+                     withEvent: theEvent
+                        select: YES];
+            }
+          else
+            {
+              /*
+               _clickedRow and _clickedColumn are already set at the start of
+               this function.
+
+               TODO: should we ask the data source/column for the cell for this
+               row/column and check whether it has its own action/target?
+               */
+              if (_clickedRow != -1)
+                [self sendAction: _action  to: _target];
+            }
         }
     }
   


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to