Revision: 16350
          http://sourceforge.net/p/skim-app/code/16350
Author:   hofman
Date:     2026-06-02 21:19:05 +0000 (Tue, 02 Jun 2026)
Log Message:
-----------
make variable more local

Modified Paths:
--------------
    trunk/SKPDFView.m

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2026-06-02 17:21:08 UTC (rev 16349)
+++ trunk/SKPDFView.m   2026-06-02 21:19:05 UTC (rev 16350)
@@ -2443,9 +2443,6 @@
 
 - (void)addOtherAnnotationWithType:(SKNoteType)annotationType 
selection:(PDFSelection *)selection point:(NSPoint)point {
     BOOL noSelection = selection == nil;
-    NSInteger disableUpdateString = [[NSUserDefaults standardUserDefaults] 
integerForKey:SKDisableUpdateContentsFromEnclosedTextKey];
-    NSString *text = nil;
-    
     if (noSelection)
         selection = [self currentSelection];
     
@@ -2577,8 +2574,6 @@
         
     }
     
-    text = disableUpdateString < 2 ? [selection cleanedString] : nil;
-    
     PDFAnnotation *newAnnotation = [PDFAnnotation newSkimNoteWithBounds:bounds 
forType:SKTypeForNoteType(annotationType)];
     // should never happen
     if (newAnnotation == nil) {
@@ -2606,10 +2601,13 @@
                     break;
             }
         }
-    } else if ([text length] > 0) {
-        [newAnnotation setString:text];
-    } else if (disableUpdateString == 0) {
-        [newAnnotation autoUpdateStringWithPage:page];
+    } else {
+        NSInteger disableUpdateString = [[NSUserDefaults standardUserDefaults] 
integerForKey:SKDisableUpdateContentsFromEnclosedTextKey];
+        NSString *text = disableUpdateString < 2 ? [selection cleanedString] : 
nil;
+        if ([text length] > 0)
+            [newAnnotation setString:text];
+        else if (disableUpdateString == 0)
+            [newAnnotation autoUpdateStringWithPage:page];
     }
     if ([newAnnotation string] == nil)
         [newAnnotation setString:@""];

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



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to