Revision: 13911
          http://sourceforge.net/p/skim-app/code/13911
Author:   hofman
Date:     2023-12-17 15:48:57 +0000 (Sun, 17 Dec 2023)
Log Message:
-----------
Do not need to explicitly retain retainable ivars of copied cells and 
formatters under ARC

Modified Paths:
--------------
    trunk/SKAnnotationTypeImageCell.m
    trunk/SKColorCell.m
    trunk/SKFontWell.m
    trunk/SKNavigationWindow.m
    trunk/SKNumberArrayFormatter.m

Modified: trunk/SKAnnotationTypeImageCell.m
===================================================================
--- trunk/SKAnnotationTypeImageCell.m   2023-12-17 15:01:58 UTC (rev 13910)
+++ trunk/SKAnnotationTypeImageCell.m   2023-12-17 15:48:57 UTC (rev 13911)
@@ -53,12 +53,6 @@
     activeImages = [[NSMutableDictionary alloc] init];
 }
 
-- (instancetype)copyWithZone:(NSZone *)aZone {
-    SKAnnotationTypeImageCell *copy = [super copyWithZone:aZone];
-    copy->hasOutline = hasOutline;
-    return copy;
-}
-
 - (instancetype)initWithCoder:(NSCoder *)decoder {
     self = [super initWithCoder:decoder];
     if (self) {

Modified: trunk/SKColorCell.m
===================================================================
--- trunk/SKColorCell.m 2023-12-17 15:01:58 UTC (rev 13910)
+++ trunk/SKColorCell.m 2023-12-17 15:48:57 UTC (rev 13911)
@@ -61,8 +61,9 @@
 
 - (instancetype)copyWithZone:(NSZone *)zone {
     SKColorCell *copy = [super copyWithZone:zone];
-    copy->color = color;
-    copy->shouldFill = shouldFill;
+    // super sets objectValue on the copy, which resets the color ivar
+    if (color)
+        [copy setObjectValue:color];
     return copy;
 }
 

Modified: trunk/SKFontWell.m
===================================================================
--- trunk/SKFontWell.m  2023-12-17 15:01:58 UTC (rev 13910)
+++ trunk/SKFontWell.m  2023-12-17 15:48:57 UTC (rev 13911)
@@ -483,14 +483,6 @@
     [coder encodeObject:textColor forKey:HASTEXTCOLOR_KEY];
 }
 
-- (instancetype)copyWithZone:(NSZone *)zone {
-    SKFontWellCell *copy = [super copyWithZone:zone];
-    copy->textColor = [textColor copyWithZone:zone];
-    copy->hasTextColor = hasTextColor;
-    return copy;
-}
-
-
 - (void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView {
     SKDrawTextFieldBezel(frame, controlView);
     

Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m  2023-12-17 15:01:58 UTC (rev 13910)
+++ trunk/SKNavigationWindow.m  2023-12-17 15:48:57 UTC (rev 13911)
@@ -596,15 +596,6 @@
     [coder encodeObject:alternatePath forKey:@"alternatePath"];
 }
 
-- (instancetype)copyWithZone:(NSZone *)zone {
-    SKNavigationButtonCell *copy = [super copyWithZone:zone];
-    copy->toolTip = toolTip;
-    copy->alternateToolTip = alternateToolTip;
-    copy->path = path;
-    copy->alternatePath = alternatePath;
-    return copy;
-}
-
 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
     [[NSColor colorWithDeviceWhite:1.0 alpha:[self isEnabled] == NO ? 0.3 : 
[self isHighlighted] ? 0.9 : 0.6] setFill];
     [([self state] == NSOnState && [self alternatePath] ? [self alternatePath] 
: [self path]) fill];

Modified: trunk/SKNumberArrayFormatter.m
===================================================================
--- trunk/SKNumberArrayFormatter.m      2023-12-17 15:01:58 UTC (rev 13910)
+++ trunk/SKNumberArrayFormatter.m      2023-12-17 15:48:57 UTC (rev 13911)
@@ -62,12 +62,6 @@
         [self commonInit];
     return self;
 }
-
-- (instancetype)copyWithZone:(NSZone *)zone {
-    SKNumberArrayFormatter *copy = [super copyWithZone:zone];
-    copy->numberFormatter = [numberFormatter copyWithZone:zone];
-    return copy;
-}
  
 - (NSString *)stringForObjectValue:(id)obj {
     if ([obj isKindOfClass:[NSString class]])

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