Revision: 26901
          http://sourceforge.net/p/bibdesk/svn/26901
Author:   hofman
Date:     2021-09-16 15:03:19 +0000 (Thu, 16 Sep 2021)
Log Message:
-----------
Only change font in attributed header when the size is wrong

Modified Paths:
--------------
    trunk/bibdesk/BDSKGroupParentCell.m

Modified: trunk/bibdesk/BDSKGroupParentCell.m
===================================================================
--- trunk/bibdesk/BDSKGroupParentCell.m 2021-09-16 14:17:20 UTC (rev 26900)
+++ trunk/bibdesk/BDSKGroupParentCell.m 2021-09-16 15:03:19 UTC (rev 26901)
@@ -44,10 +44,14 @@
 
 - (void)setObjectValue:(id)objectValue {
     if ([objectValue isKindOfClass:[NSAttributedString class]] && [objectValue 
length]) {
-        NSFont *font = [[self font] demiFont];
-        NSMutableAttributedString *attrString = [objectValue mutableCopy];
-        [attrString addAttribute:NSFontAttributeName value:font 
range:NSMakeRange(0, [attrString length])];
-        objectValue = [attrString autorelease];
+        NSFont *font = [self font];
+        NSFont *newFont = [(NSAttributedString *)objectValue 
attribute:NSFontAttributeName atIndex:0 effectiveRange:NULL];
+        if (fabs([font pointSize] - [newFont pointSize]) > 0.0) {
+            font = [font demiFont];
+            NSMutableAttributedString *attrString = [objectValue mutableCopy];
+            [attrString addAttribute:NSFontAttributeName value:font 
range:NSMakeRange(0, [attrString length])];
+            objectValue = [attrString autorelease];
+        }
     }
     [super setObjectValue:objectValue];
 }

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