Revision: 16351
http://sourceforge.net/p/skim-app/code/16351
Author: hofman
Date: 2026-06-02 21:53:07 +0000 (Tue, 02 Jun 2026)
Log Message:
-----------
don't use same variable in loop
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2026-06-02 21:19:05 UTC (rev 16350)
+++ trunk/SKPDFView.m 2026-06-02 21:53:07 UTC (rev 16351)
@@ -2399,8 +2399,6 @@
- (void)addMarkupAnnotationWithType:(SKNoteType)annotationType
selection:(PDFSelection *)selection {
BOOL noSelection = selection == nil;
- NSString *type = SKTypeForNoteType(annotationType);
- NSInteger disableUpdateString = [[NSUserDefaults standardUserDefaults]
integerForKey:SKDisableUpdateContentsFromEnclosedTextKey];
if (noSelection)
selection = [self currentSelection];
PDFPage *page = [selection safeFirstPage];
@@ -2410,6 +2408,7 @@
return;
}
+ NSString *type = SKTypeForNoteType(annotationType);
NSColor *color = nil;
// add new markup to the active markup if it's the same type on the same
page, unless we add a specific selection
@@ -2421,15 +2420,16 @@
[self removeCurrentAnnotation:nil];
}
+ NSInteger disableUpdateString = [[NSUserDefaults standardUserDefaults]
integerForKey:SKDisableUpdateContentsFromEnclosedTextKey];
NSString *text = disableUpdateString < 2 ? ([selection cleanedString] ?:
@"") : @"";
NSMutableArray *newAnnotations = [NSMutableArray array];
- for (PDFPage *page in [selection pages]) {
- PDFAnnotation *newAnnotation = [PDFAnnotation
newSkimNoteWithSelection:selection forPage:page forType:type];
+ for (PDFPage *aPage in [selection pages]) {
+ PDFAnnotation *newAnnotation = [PDFAnnotation
newSkimNoteWithSelection:selection forPage:aPage forType:type];
if (newAnnotation) {
[newAnnotation setString:text];
if (color)
[newAnnotation setColor:color];
- [newAnnotations addObject:@[newAnnotation, page]];
+ [newAnnotations addObject:@[newAnnotation, aPage]];
}
}
if ([newAnnotations count] == 0) {
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