Revision: 28972
          http://sourceforge.net/p/bibdesk/svn/28972
Author:   hofman
Date:     2024-11-12 10:37:32 +0000 (Tue, 12 Nov 2024)
Log Message:
-----------
Shift selection in field name, typee name, and crossref formatters when 
removing an invalid character

Modified Paths:
--------------
    trunk/bibdesk/BDSKCitationFormatter.m
    trunk/bibdesk/BDSKFieldNameFormatter.m
    trunk/bibdesk/BDSKTypeNameFormatter.m

Modified: trunk/bibdesk/BDSKCitationFormatter.m
===================================================================
--- trunk/bibdesk/BDSKCitationFormatter.m       2024-11-12 10:26:34 UTC (rev 
28971)
+++ trunk/bibdesk/BDSKCitationFormatter.m       2024-11-12 10:37:32 UTC (rev 
28972)
@@ -140,6 +140,8 @@
         [new replaceOccurrencesOfCharactersInSet:invalidSet withString:@""];
         if ([new length]) {
             *partialStringPtr = new;
+            if (r.location < proposedSelRangePtr->location)
+                --proposedSelRangePtr->location;
             if (NSMaxRange(*proposedSelRangePtr) > [new length])
                 *proposedSelRangePtr = NSMakeRange(r.location, 0);
         } else {

Modified: trunk/bibdesk/BDSKFieldNameFormatter.m
===================================================================
--- trunk/bibdesk/BDSKFieldNameFormatter.m      2024-11-12 10:26:34 UTC (rev 
28971)
+++ trunk/bibdesk/BDSKFieldNameFormatter.m      2024-11-12 10:37:32 UTC (rev 
28972)
@@ -116,6 +116,8 @@
         NSMutableString *new = [partialString mutableCopy];
         [new replaceOccurrencesOfCharactersInSet:invalidSet withString:@""];
         if ([new length]) {
+            if (r.location < proposedSelRangePtr->location)
+                --proposedSelRangePtr->location;
             *partialStringPtr = new;
             if (NSMaxRange(*proposedSelRangePtr) > [new length])
                 *proposedSelRangePtr = NSMakeRange(r.location, 0);

Modified: trunk/bibdesk/BDSKTypeNameFormatter.m
===================================================================
--- trunk/bibdesk/BDSKTypeNameFormatter.m       2024-11-12 10:26:34 UTC (rev 
28971)
+++ trunk/bibdesk/BDSKTypeNameFormatter.m       2024-11-12 10:37:32 UTC (rev 
28972)
@@ -86,6 +86,8 @@
         [new replaceOccurrencesOfCharactersInSet:invalidSet withString:@""];
         if ([new length]) {
             *partialStringPtr = new;
+            if (r.location < proposedSelRangePtr->location)
+                --proposedSelRangePtr->location;
             if (NSMaxRange(*proposedSelRangePtr) > [new length])
                 *proposedSelRangePtr = NSMakeRange(r.location, 0);
         } else {

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



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to