Revision: 29830
          http://sourceforge.net/p/bibdesk/svn/29830
Author:   hofman
Date:     2025-11-17 10:18:45 +0000 (Mon, 17 Nov 2025)
Log Message:
-----------
remove convenience initializers for macro and number string nodes

Modified Paths:
--------------
    trunk/bibdesk/BDSKComplexString.m
    trunk/bibdesk/BDSKStringNode.h
    trunk/bibdesk/BDSKStringNode.m
    trunk/bibdesk/UnitTests/TestComplexString.m

Modified: trunk/bibdesk/BDSKComplexString.m
===================================================================
--- trunk/bibdesk/BDSKComplexString.m   2025-11-17 10:11:04 UTC (rev 29829)
+++ trunk/bibdesk/BDSKComplexString.m   2025-11-17 10:18:45 UTC (rev 29830)
@@ -172,13 +172,13 @@
         else if ([[NSCharacterSet decimalDigitCharacterSet] 
characterIsMember:ch]) {
             // this should be all numbers
             [sc scanCharactersFromSet:[NSCharacterSet 
decimalDigitCharacterSet] intoString:&s];
-            node = [[BDSKStringNode alloc] initWithNumberString:s];
+            node = [[BDSKStringNode alloc] initWithType:BDSKStringNodeNumber 
value:s];
                        [returnNodes addObject:node];
         }
         else if ([macroCharSet characterIsMember:ch]) {
             // a macro
             if ([sc scanCharactersFromSet:macroCharSet intoString:&s]) {
-                               node = [[BDSKStringNode alloc] 
initWithMacroString:s];
+                               node = [[BDSKStringNode alloc] 
initWithType:BDSKStringNodeMacro value:s];
                 [returnNodes addObject:node];
                        }
         }

Modified: trunk/bibdesk/BDSKStringNode.h
===================================================================
--- trunk/bibdesk/BDSKStringNode.h      2025-11-17 10:11:04 UTC (rev 29829)
+++ trunk/bibdesk/BDSKStringNode.h      2025-11-17 10:18:45 UTC (rev 29830)
@@ -62,24 +62,6 @@
 - (BDSKStringNode *)initWithQuotedString:(NSString *)s;
 
     /*!
-        @method     initWithNumberString:
-     @abstract   Returns a newly allocated and initialized string node for a 
raw number. The string is expected to be valid, i.e. it should contain only 
numbers. Error checking is not performed.
-     @discussion (comprehensive description)
-     @param      s The number value as a string. 
-     @result     A newly allocated string node of number type. 
-     */
-- (BDSKStringNode *)initWithNumberString:(NSString *)s;
-
-    /*!
-         @method     initWithMacroString:
-     @abstract   Returns a newly allocated and initialized string node for a 
quoted string. The string is expected to be valid, i.e. it should not contain 
unbalanced braces. Error checking is not performed.
-     @discussion (comprehensive description)
-     @param      s The string value without the quotes. 
-     @result     A newly allocated string node of string type. 
-     */
-- (BDSKStringNode *)initWithMacroString:(NSString *)s;
-
-    /*!
                @method     initWithType:value:
      @abstract   Initializes a new string node with the given type and value. 
This is the designated initializer.
      @discussion (description)

Modified: trunk/bibdesk/BDSKStringNode.m
===================================================================
--- trunk/bibdesk/BDSKStringNode.m      2025-11-17 10:11:04 UTC (rev 29829)
+++ trunk/bibdesk/BDSKStringNode.m      2025-11-17 10:18:45 UTC (rev 29830)
@@ -48,14 +48,6 @@
     return [self initWithType:BDSKStringNodeString value:s];
 }
 
-- (BDSKStringNode *)initWithNumberString:(NSString *)s{
-    return [self initWithType:BDSKStringNodeNumber value:s];
-}
-
-- (BDSKStringNode *)initWithMacroString:(NSString *)s{
-    return [self initWithType:BDSKStringNodeMacro value:s];
-}
-
 - (instancetype)init{
        return [self initWithType:BDSKStringNodeString value:@""];
 }

Modified: trunk/bibdesk/UnitTests/TestComplexString.m
===================================================================
--- trunk/bibdesk/UnitTests/TestComplexString.m 2025-11-17 10:11:04 UTC (rev 
29829)
+++ trunk/bibdesk/UnitTests/TestComplexString.m 2025-11-17 10:18:45 UTC (rev 
29830)
@@ -44,7 +44,7 @@
 @implementation TestStringNode
 
 - (void)testNumberFromBibTeXString{
-    BDSKStringNode *sn = [[[BDSKStringNode alloc] initWithNumberString:@"14"] 
autorelease];
+    BDSKStringNode *sn = [[[BDSKStringNode alloc] 
initWithType:BDSKStringNodeNumber value:@"14"] autorelease];
     STAssertNotNil(sn,nil);
     STAssertTrue(BDSKStringNodeNumber==[sn type],nil);
     STAssertEqualObjects(@"14", [sn value],nil);
@@ -59,7 +59,7 @@
 }
 
 - (void)testMacroFromBibTeXString{
-    BDSKStringNode *sn = [[[BDSKStringNode alloc] 
initWithMacroString:@"macro"] autorelease];
+    BDSKStringNode *sn = [[[BDSKStringNode alloc] 
initWithType:BDSKStringNodeMacro value:@"macro"] autorelease];
     
     STAssertNotNil(sn,nil);
     STAssertTrue(BDSKStringNodeMacro==[sn type],nil);
@@ -145,8 +145,8 @@
 }
 
 - (void)testDisplayTwoNumbers{
-    NSArray *a = [NSArray arrayWithObjects:[[[BDSKStringNode alloc] 
initWithNumberString:@"14"] autorelease],
-                                 [[[BDSKStringNode alloc] 
initWithNumberString:@"14"] autorelease], nil];
+    NSArray *a = [NSArray arrayWithObjects:[[[BDSKStringNode alloc] 
initWithType:BDSKStringNodeNumber value:@"14"] autorelease],
+                                 [[[BDSKStringNode alloc] 
initWithType:BDSKStringNodeNumber value:@"14"] autorelease], nil];
     NSString *cs = [NSString stringWithNodes:a
                                                           macroResolver:[self 
macroResolver]];
     STAssertNotNil(cs,nil);
@@ -155,9 +155,9 @@
 }
 
 - (void)testDisplayThreeNumbers{
-    NSArray *a = [NSArray arrayWithObjects:[[[BDSKStringNode alloc] 
initWithNumberString:@"14"] autorelease],
-                                 [[[BDSKStringNode alloc] 
initWithNumberString:@"14"] autorelease],
-                                 [[[BDSKStringNode alloc] 
initWithNumberString:@"14"] autorelease], nil];
+    NSArray *a = [NSArray arrayWithObjects:[[[BDSKStringNode alloc] 
initWithType:BDSKStringNodeNumber value:@"14"] autorelease],
+                                 [[[BDSKStringNode alloc] 
initWithType:BDSKStringNodeNumber value:@"14"] autorelease],
+                                 [[[BDSKStringNode alloc] 
initWithType:BDSKStringNodeNumber value:@"14"] autorelease], nil];
     NSString *cs = [NSString stringWithNodes:a
                                                                                
macroResolver:[self macroResolver]];
     STAssertNotNil(cs,nil);

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



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to