Revision: 13476
http://sourceforge.net/p/skim-app/code/13476
Author: hofman
Date: 2023-06-15 09:44:37 +0000 (Thu, 15 Jun 2023)
Log Message:
-----------
Make sure we use always the same values for alignment in scripting, as
different architectures use different values for right and center.
Modified Paths:
--------------
trunk/PDFAnnotationFreeText_SKExtensions.h
trunk/PDFAnnotationFreeText_SKExtensions.m
trunk/PDFAnnotation_SKExtensions.h
trunk/PDFAnnotation_SKExtensions.m
trunk/SKNotePrefs.h
trunk/SKNotePrefs.m
Modified: trunk/PDFAnnotationFreeText_SKExtensions.h
===================================================================
--- trunk/PDFAnnotationFreeText_SKExtensions.h 2023-06-14 16:46:25 UTC (rev
13475)
+++ trunk/PDFAnnotationFreeText_SKExtensions.h 2023-06-15 09:44:37 UTC (rev
13476)
@@ -49,6 +49,6 @@
- (void)setFontName:(NSString *)fontName;
- (void)setFontSize:(CGFloat)pointSize;
- (void)setScriptingFontColor:(NSColor *)newScriptingFontColor;
-- (void)setScriptingAlignment:(NSTextAlignment)alignment;
+- (void)setScriptingAlignment:(NSInteger)alignment;
@end
Modified: trunk/PDFAnnotationFreeText_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationFreeText_SKExtensions.m 2023-06-14 16:46:25 UTC (rev
13475)
+++ trunk/PDFAnnotationFreeText_SKExtensions.m 2023-06-15 09:44:37 UTC (rev
13476)
@@ -180,13 +180,14 @@
}
}
-- (NSTextAlignment)scriptingAlignment {
- return [self alignment];
+- (NSInteger)scriptingAlignment {
+ NSTextAlignment align = [self alignment];
+ return align == 0 ? NSTextAlignmentLeft : align == 1 ?
NSTextAlignmentRight : NSTextAlignmentCenter;
}
-- (void)setScriptingAlignment:(NSTextAlignment)alignment {
+- (void)setScriptingAlignment:(NSInteger)alignment {
if ([self isEditable]) {
- [self setAlignment:alignment];
+ [self setAlignment:alignment == NSTextAlignmentLeft ? 0 : alignment ==
NSTextAlignmentRight ? 1 : 2];
}
}
Modified: trunk/PDFAnnotation_SKExtensions.h
===================================================================
--- trunk/PDFAnnotation_SKExtensions.h 2023-06-14 16:46:25 UTC (rev 13475)
+++ trunk/PDFAnnotation_SKExtensions.h 2023-06-15 09:44:37 UTC (rev 13476)
@@ -150,7 +150,7 @@
- (id)richText;
- (void)setBoundsAsQDRect:(NSData *)inQDBoundsAsData;
- (NSData *)boundsAsQDRect;
-- (NSTextAlignment)scriptingAlignment;
+- (NSInteger)scriptingAlignment;
- (NSString *)fontName;
- (CGFloat)fontSize;
- (NSColor *)scriptingFontColor;
Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m 2023-06-14 16:46:25 UTC (rev 13475)
+++ trunk/PDFAnnotation_SKExtensions.m 2023-06-15 09:44:37 UTC (rev 13476)
@@ -796,7 +796,7 @@
return nil;
}
-- (NSTextAlignment)scriptingAlignment {
+- (NSInteger)scriptingAlignment {
return NSTextAlignmentLeft;
}
Modified: trunk/SKNotePrefs.h
===================================================================
--- trunk/SKNotePrefs.h 2023-06-14 16:46:25 UTC (rev 13475)
+++ trunk/SKNotePrefs.h 2023-06-15 09:44:37 UTC (rev 13476)
@@ -55,7 +55,7 @@
@property (nonatomic, retain) NSString *fontName;
@property (nonatomic) CGFloat fontSize;
@property (nonatomic, retain) NSColor *scriptingFontColor;
-@property (nonatomic) NSTextAlignment scriptingAlignment;
+@property (nonatomic) NSInteger scriptingAlignment;
@property (nonatomic) PDFTextAnnotationIconType scriptingIconType;
@property (nonatomic, retain) NSString *scriptingUserName;
@property (nonatomic, retain) NSDictionary *scriptingProperties;
Modified: trunk/SKNotePrefs.m
===================================================================
--- trunk/SKNotePrefs.m 2023-06-14 16:46:25 UTC (rev 13475)
+++ trunk/SKNotePrefs.m 2023-06-15 09:44:37 UTC (rev 13476)
@@ -236,13 +236,13 @@
[[NSUserDefaults standardUserDefaults] setDouble:fontSize
forKey:SKAnchoredNoteFontSizeKey];
}
-- (NSTextAlignment)scriptingAlignment {
+- (NSInteger)scriptingAlignment {
if ([type isEqualToString:SKNFreeTextString])
return [[NSUserDefaults standardUserDefaults]
integerForKey:SKFreeTextNoteAlignmentKey];
return 0;
}
-- (void)setScriptingAlignment:(NSTextAlignment)alignment {
+- (void)setScriptingAlignment:(NSInteger)alignment {
if ([type isEqualToString:SKNFreeTextString])
[[NSUserDefaults standardUserDefaults] setInteger:alignment
forKey:SKFreeTextNoteAlignmentKey];
}
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