Revision: 18405
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18405&view=rev
Author:   hofman
Date:     2012-01-15 12:30:18 +0000 (Sun, 15 Jan 2012)
Log Message:
-----------
don't allow selecting more than one token in repository tokenfields for 
template document

Modified Paths:
--------------
    trunk/bibdesk/BDSKTemplateDocument.m

Modified: trunk/bibdesk/BDSKTemplateDocument.m
===================================================================
--- trunk/bibdesk/BDSKTemplateDocument.m        2012-01-15 07:35:34 UTC (rev 
18404)
+++ trunk/bibdesk/BDSKTemplateDocument.m        2012-01-15 12:30:18 UTC (rev 
18405)
@@ -1471,6 +1471,14 @@
 
 @implementation BDSKTokenField
 
+- (NSRange)textView:(NSTextView *)aTextView 
willChangeSelectionFromCharacterRange:(NSRange)oldSelectedCharRange 
toCharacterRange:(NSRange)newSelectedCharRange {
+    if ([[BDSKTokenField superclass] instancesRespondToSelector:_cmd])
+        newSelectedCharRange = [(id)super textView:aTextView 
willChangeSelectionFromCharacterRange:oldSelectedCharRange 
toCharacterRange:newSelectedCharRange];
+    if ([self isEditable] == NO && newSelectedCharRange.length > 1)
+        newSelectedCharRange.length = 1;
+    return newSelectedCharRange;
+}
+
 - (void)textViewDidChangeSelection:(NSNotification *)notification {
     if ([[BDSKTokenField superclass] instancesRespondToSelector:_cmd])
         [(id)super textViewDidChangeSelection:notification];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to