Revision: 15729
http://sourceforge.net/p/skim-app/code/15729
Author: hofman
Date: 2025-10-29 15:39:46 +0000 (Wed, 29 Oct 2025)
Log Message:
-----------
implement NSScanner method as function in file where it is used
Modified Paths:
--------------
trunk/SKPDFSyncParser.m
trunk/Skim.xcodeproj/project.pbxproj
Removed Paths:
-------------
trunk/NSScanner_SKExtensions.h
trunk/NSScanner_SKExtensions.m
Deleted: trunk/NSScanner_SKExtensions.h
===================================================================
--- trunk/NSScanner_SKExtensions.h 2025-10-29 14:56:17 UTC (rev 15728)
+++ trunk/NSScanner_SKExtensions.h 2025-10-29 15:39:46 UTC (rev 15729)
@@ -1,49 +0,0 @@
-//
-// NSScanner_SKExtensions.h
-// Skim
-//
-// Created by Christiaan Hofman on 4/22/07.
-/*
- This software is Copyright (c) 2007
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Cocoa/Cocoa.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface NSScanner (SKExtensions)
-
-- (BOOL)scanCharacter:(unichar *)ch;
-
-@end
-
-NS_ASSUME_NONNULL_END
Deleted: trunk/NSScanner_SKExtensions.m
===================================================================
--- trunk/NSScanner_SKExtensions.m 2025-10-29 14:56:17 UTC (rev 15728)
+++ trunk/NSScanner_SKExtensions.m 2025-10-29 15:39:46 UTC (rev 15729)
@@ -1,59 +0,0 @@
-//
-// NSScanner_SKExtensions.m
-// Skim
-//
-// Created by Christiaan Hofman on 4/22/07.
-/*
- This software is Copyright (c) 2007
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "NSScanner_SKExtensions.h"
-
-
-@implementation NSScanner (SKExtensions)
-
-- (BOOL)scanCharacter:(unichar *)ch {
- NSInteger location, length = [[self string] length];
- unichar character = 0;
- BOOL success = NO;
- for (location = [self scanLocation]; success == NO && location < length;
location++) {
- character = [[self string] characterAtIndex:location];
- success = [[self charactersToBeSkipped] characterIsMember:character]
== NO;
- }
- if (success) {
- *ch = character;
- [self setScanLocation:location];
- }
- return success;
-}
-
-@end
Modified: trunk/SKPDFSyncParser.m
===================================================================
--- trunk/SKPDFSyncParser.m 2025-10-29 14:56:17 UTC (rev 15728)
+++ trunk/SKPDFSyncParser.m 2025-10-29 15:39:46 UTC (rev 15729)
@@ -39,7 +39,6 @@
#import "SKPDFSyncParser.h"
#import "SKPDFSyncRecord.h"
#import "NSPointerFunctions_SKExtensions.h"
-#import "NSScanner_SKExtensions.h"
// Offset of coordinates in PDFKit and what pdfsync tells us. Don't know what
they are; is this implementation dependent?
static NSPoint pdfOffset = {0.0, 0.0};
@@ -48,6 +47,8 @@
#define PDFSYNC_TO_PDF(coord) ((CGFloat)coord / 65536.0)
+static BOOL scanCharacter(NSScanner *scanner, unichar *ch);
+
@implementation SKPDFSyncParser
@synthesize syncFileName;
@@ -116,7 +117,7 @@
[sc scanCharactersFromSet:newlines intoString:NULL];
- while ([sc scanCharacter:&ch]) {
+ while (scanCharacter(sc, &ch)) {
switch (ch) {
case 'l':
@@ -306,3 +307,18 @@
}
@end
+
+static BOOL scanCharacter(NSScanner *scanner, unichar *ch) {
+ NSInteger location, length = [[scanner string] length];
+ unichar character = 0;
+ BOOL success = NO;
+ for (location = [scanner scanLocation]; success == NO && location <
length; location++) {
+ character = [[scanner string] characterAtIndex:location];
+ success = [[scanner charactersToBeSkipped]
characterIsMember:character] == NO;
+ }
+ if (success) {
+ *ch = character;
+ [scanner setScanLocation:location];
+ }
+ return success;
+}
Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj 2025-10-29 14:56:17 UTC (rev
15728)
+++ trunk/Skim.xcodeproj/project.pbxproj 2025-10-29 15:39:46 UTC (rev
15729)
@@ -81,7 +81,6 @@
CE1D798F129FE44E00EA3AF0 /* NSScriptCommand_SKExtensions.m in
Sources */ = {isa = PBXBuildFile; fileRef = CE1D798E129FE44E00EA3AF0 /*
NSScriptCommand_SKExtensions.m */; };
CE1DFA3D244CF04700D64C83 /* SKShareMenuController.m in Sources
*/ = {isa = PBXBuildFile; fileRef = CE1DFA3C244CF04700D64C83 /*
SKShareMenuController.m */; };
CE1E2B290BDAB6180011D9DD /* SKPDFSynchronizer.m in Sources */ =
{isa = PBXBuildFile; fileRef = CE1E2B270BDAB6180011D9DD /* SKPDFSynchronizer.m
*/; };
- CE1E301D0BDB9D5C0011D9DD /* NSScanner_SKExtensions.m in Sources
*/ = {isa = PBXBuildFile; fileRef = CE1E301B0BDB9D5C0011D9DD /*
NSScanner_SKExtensions.m */; };
CE1E30290BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.m in
Sources */ = {isa = PBXBuildFile; fileRef = CE1E30270BDB9D8E0011D9DD /*
NSCharacterSet_SKExtensions.m */; };
CE2083E416ADFFD600BC5AFB /* SKAlias.m in Sources */ = {isa =
PBXBuildFile; fileRef = CE2083E316ADFFD600BC5AFB /* SKAlias.m */; };
CE2093910C5F9A8D009D3EFB /* SKTopBarView.m in Sources */ = {isa
= PBXBuildFile; fileRef = CE20938F0C5F9A8D009D3EFB /* SKTopBarView.m */; };
@@ -843,8 +842,6 @@
CE1E2B260BDAB6180011D9DD /* SKPDFSynchronizer.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
SKPDFSynchronizer.h; sourceTree = "<group>"; };
CE1E2B270BDAB6180011D9DD /* SKPDFSynchronizer.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= SKPDFSynchronizer.m; sourceTree = "<group>"; };
CE1E2F120BDB86A10011D9DD /* displayline */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path =
displayline; sourceTree = "<group>"; };
- CE1E301A0BDB9D5C0011D9DD /* NSScanner_SKExtensions.h */ = {isa
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path
= NSScanner_SKExtensions.h; sourceTree = "<group>"; };
- CE1E301B0BDB9D5C0011D9DD /* NSScanner_SKExtensions.m */ = {isa
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc;
path = NSScanner_SKExtensions.m; sourceTree = "<group>"; };
CE1E30260BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.h */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h;
path = NSCharacterSet_SKExtensions.h; sourceTree = "<group>"; };
CE1E30270BDB9D8E0011D9DD /* NSCharacterSet_SKExtensions.m */ =
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType =
sourcecode.c.objc; path = NSCharacterSet_SKExtensions.m; sourceTree =
"<group>"; };
CE1E82102460D0F60004801E /* OpenGL.framework */ = {isa =
PBXFileReference; lastKnownFileType = wrapper.framework; name =
OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree
= SDKROOT; };
@@ -1615,8 +1612,6 @@
CE42B8EB106996C60091F588 /*
NSPointerArray_SKExtensions.m */,
CE017E7F2B2623A800F5FC1E /*
NSPointerFunctions_SKExtensions.h */,
CE017E802B2623A800F5FC1E /*
NSPointerFunctions_SKExtensions.m */,
- CE1E301A0BDB9D5C0011D9DD /*
NSScanner_SKExtensions.h */,
- CE1E301B0BDB9D5C0011D9DD /*
NSScanner_SKExtensions.m */,
CE1D798D129FE44E00EA3AF0 /*
NSScriptCommand_SKExtensions.h */,
CE1D798E129FE44E00EA3AF0 /*
NSScriptCommand_SKExtensions.m */,
CE38ECD10B8093B200A1B779 /*
NSString_SKExtensions.h */,
@@ -2845,7 +2840,6 @@
CE4294A30BBD29120016FDC2 /* SKReadingBar.m in
Sources */,
CEE106150BCBB72C00BF2D3E /* SKNotesDocument.m
in Sources */,
CE1E2B290BDAB6180011D9DD /* SKPDFSynchronizer.m
in Sources */,
- CE1E301D0BDB9D5C0011D9DD /*
NSScanner_SKExtensions.m in Sources */,
CE1E30290BDB9D8E0011D9DD /*
NSCharacterSet_SKExtensions.m in Sources */,
CE4972510BDE898F00D7F1D2 /* SKMainWindow.m in
Sources */,
CE49726D0BDE8A7400D7F1D2 /*
PDFSelection_SKExtensions.m in Sources */,
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