Revision: 24033
          http://sourceforge.net/p/bibdesk/svn/24033
Author:   hofman
Date:     2019-07-15 22:00:20 +0000 (Mon, 15 Jul 2019)
Log Message:
-----------
use properties for formatters

Modified Paths:
--------------
    trunk/bibdesk/BDSKCitationFormatter.h
    trunk/bibdesk/BDSKCitationFormatter.m
    trunk/bibdesk/BDSKComplexStringFormatter.h
    trunk/bibdesk/BDSKComplexStringFormatter.m
    trunk/bibdesk/BDSKFieldNameFormatter.h
    trunk/bibdesk/BDSKFieldNameFormatter.m
    trunk/bibdesk/BDSKFormatStringFormatter.h
    trunk/bibdesk/BDSKFormatStringFormatter.m

Modified: trunk/bibdesk/BDSKCitationFormatter.h
===================================================================
--- trunk/bibdesk/BDSKCitationFormatter.h       2019-07-15 21:21:16 UTC (rev 
24032)
+++ trunk/bibdesk/BDSKCitationFormatter.h       2019-07-15 22:00:20 UTC (rev 
24033)
@@ -49,7 +49,9 @@
 @interface BDSKCitationFormatter : NSFormatter {
     id delegate;
 }
+
 - (id)initWithDelegate:(id<BDSKCitationFormatterDelegate>)aDelegate;
-- (id<BDSKCitationFormatterDelegate>)delegate;
-- (void)setDelegate:(id<BDSKCitationFormatterDelegate>)newDelegate;
+
+@property (nonatomic, assign) id<BDSKCitationFormatterDelegate> delegate;
+
 @end

Modified: trunk/bibdesk/BDSKCitationFormatter.m
===================================================================
--- trunk/bibdesk/BDSKCitationFormatter.m       2019-07-15 21:21:16 UTC (rev 
24032)
+++ trunk/bibdesk/BDSKCitationFormatter.m       2019-07-15 22:00:20 UTC (rev 
24033)
@@ -48,6 +48,8 @@
 
 @implementation BDSKCitationFormatter
 
+@synthesize delegate;
+
 static NSCharacterSet *invalidSet = nil;
 static NSCharacterSet *keySepCharSet = nil;
 static NSCharacterSet *keyCharSet = nil;
@@ -75,10 +77,6 @@
     return self;
 }
 
-- (id<BDSKCitationFormatterDelegate>)delegate { return delegate; }
-
-- (void)setDelegate:(id<BDSKCitationFormatterDelegate>)newDelegate { delegate 
= newDelegate; }
-
 - (NSString *)stringForObjectValue:(id)obj{
     return obj;
 }

Modified: trunk/bibdesk/BDSKComplexStringFormatter.h
===================================================================
--- trunk/bibdesk/BDSKComplexStringFormatter.h  2019-07-15 21:21:16 UTC (rev 
24032)
+++ trunk/bibdesk/BDSKComplexStringFormatter.h  2019-07-15 22:00:20 UTC (rev 
24033)
@@ -53,13 +53,8 @@
 
 - (id)initWithDelegate:(id<BDSKComplexStringFormatterDelegate>)anObject 
macroResolver:(BDSKMacroResolver *)aMacroResolver;
 
-- (id)macroResolver;
-- (void)setMacroResolver:(BDSKMacroResolver *)newMacroResolver;
+@property (nonatomic, retain) BDSKMacroResolver *macroResolver;
+@property (nonatomic) BOOL editAsComplexString;
+@property (nonatomic, assign) id<BDSKComplexStringFormatterDelegate> delegate;
 
-- (BOOL)editAsComplexString;
-- (void)setEditAsComplexString:(BOOL)newEditAsComplexString;
-
-- (id<BDSKComplexStringFormatterDelegate>)delegate;
-- (void)setDelegate:(id<BDSKComplexStringFormatterDelegate>)newDelegate;
-
 @end

Modified: trunk/bibdesk/BDSKComplexStringFormatter.m
===================================================================
--- trunk/bibdesk/BDSKComplexStringFormatter.m  2019-07-15 21:21:16 UTC (rev 
24032)
+++ trunk/bibdesk/BDSKComplexStringFormatter.m  2019-07-15 22:00:20 UTC (rev 
24033)
@@ -43,6 +43,8 @@
 
 @implementation BDSKComplexStringFormatter
 
+@synthesize macroResolver, editAsComplexString, delegate;
+
 - (id)init {
     return [self initWithDelegate:nil macroResolver:nil];
 }
@@ -134,35 +136,4 @@
     return YES;
 }
 
-#pragma mark Accessors
-
-- (id)macroResolver {
-    return macroResolver;
-}
-
-- (void)setMacroResolver:(BDSKMacroResolver *)newMacroResolver {
-    if (macroResolver != newMacroResolver) {
-        [macroResolver release];
-        macroResolver = [newMacroResolver retain];
-    }
-}
-
-- (BOOL)editAsComplexString {
-       return editAsComplexString;
-}
-
-- (void)setEditAsComplexString:(BOOL)newEditAsComplexString {
-       if (editAsComplexString != newEditAsComplexString) {
-               editAsComplexString = newEditAsComplexString;
-       }
-}
-
-- (id<BDSKComplexStringFormatterDelegate>)delegate {
-    return delegate;
-}
-
-- (void)setDelegate:(id<BDSKComplexStringFormatterDelegate>)newDelegate {
-       delegate = newDelegate;
-}
-
 @end

Modified: trunk/bibdesk/BDSKFieldNameFormatter.h
===================================================================
--- trunk/bibdesk/BDSKFieldNameFormatter.h      2019-07-15 21:21:16 UTC (rev 
24032)
+++ trunk/bibdesk/BDSKFieldNameFormatter.h      2019-07-15 22:00:20 UTC (rev 
24033)
@@ -45,7 +45,6 @@
     NSArray *knownFieldNames;
 }
 
-- (NSArray *)knownFieldNames;
-- (void)setKnownFieldNames:(NSArray *)array;
+@property (nonatomic, copy) NSArray *knownFieldNames;
 
 @end

Modified: trunk/bibdesk/BDSKFieldNameFormatter.m
===================================================================
--- trunk/bibdesk/BDSKFieldNameFormatter.m      2019-07-15 21:21:16 UTC (rev 
24032)
+++ trunk/bibdesk/BDSKFieldNameFormatter.m      2019-07-15 22:00:20 UTC (rev 
24033)
@@ -49,22 +49,13 @@
 
 @implementation BDSKFieldNameFormatter
 
+@synthesize knownFieldNames;
+
 - (void)dealloc {
     BDSKDESTROY(knownFieldNames);
     [super dealloc];
 }
 
-- (NSArray *)knownFieldNames {
-    return knownFieldNames;
-}
-
-- (void)setKnownFieldNames:(NSArray *)array {
-    if (knownFieldNames != array) {
-        [knownFieldNames release];
-        knownFieldNames = [array copy];
-    }
-}
-
 - (NSString *)stringForObjectValue:(id)obj{
     return obj;
 }

Modified: trunk/bibdesk/BDSKFormatStringFormatter.h
===================================================================
--- trunk/bibdesk/BDSKFormatStringFormatter.h   2019-07-15 21:21:16 UTC (rev 
24032)
+++ trunk/bibdesk/BDSKFormatStringFormatter.h   2019-07-15 22:00:20 UTC (rev 
24033)
@@ -45,5 +45,5 @@
     NSString *formatError;
 }
 - (id)initWithField:(NSString *)field;
-- (NSString *)formatError;
+@property (nonatomic, readonly) NSString *formatError;
 @end

Modified: trunk/bibdesk/BDSKFormatStringFormatter.m
===================================================================
--- trunk/bibdesk/BDSKFormatStringFormatter.m   2019-07-15 21:21:16 UTC (rev 
24032)
+++ trunk/bibdesk/BDSKFormatStringFormatter.m   2019-07-15 22:00:20 UTC (rev 
24033)
@@ -42,6 +42,8 @@
 
 @implementation BDSKFormatStringFormatter
 
+@synthesize formatError;
+
 - (id)initWithField:(NSString *)field {
     // initWithFrame sets up the entire text system for us
     if(self = [super init]){
@@ -59,8 +61,6 @@
     [super dealloc];
 }
 
-- (NSString *)formatError { return formatError; }
-
 - (NSString *)stringForObjectValue:(id)obj{
     return obj;
 }

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