Revision: 16784
          http://sourceforge.net/p/skim-app/code/16784
Author:   hofman
Date:     2026-11-03 17:16:35 +0000 (Tue, 03 Nov 2026)
Log Message:
-----------
implement scripting modifiers of bookmarks in folder class

Modified Paths:
--------------
    trunk/SKBookmark.m

Modified: trunk/SKBookmark.m
===================================================================
--- trunk/SKBookmark.m  2026-11-03 15:45:47 UTC (rev 16783)
+++ trunk/SKBookmark.m  2026-11-03 17:16:35 UTC (rev 16784)
@@ -255,14 +255,9 @@
 
 - (NSArray *)entireContents { return nil; }
 
-- (BOOL)isExpanded {
-    return [self bookmarkType] == SKBookmarkTypeFolder && 
[[SKBookmarkController sharedBookmarkController] isBookmarkExpanded:self];
-}
+- (BOOL)isExpanded { return NO; }
 
-- (void)setExpanded:(BOOL)flag {
-    if ([self bookmarkType] == SKBookmarkTypeFolder)
-        [[SKBookmarkController sharedBookmarkController] setExpanded:flag 
forBookmark:self];
-}
+- (void)setExpanded:(BOOL)flag {}
 
 - (NSArray *)bookmarks {
     return [self children];
@@ -269,21 +264,13 @@
 }
 
 - (void)insertObject:(SKBookmark *)bookmark 
inBookmarksAtIndex:(NSUInteger)anIndex {
-    if ([self bookmarkType] == SKBookmarkTypeFolder) {
-        [[SKBookmarkController sharedBookmarkController] 
insertBookmark:bookmark atIndex:anIndex ofBookmark:self animate:NO];
-    } else {
-        [[NSScriptCommand currentCommand] 
setScriptErrorNumber:NSReceiversCantHandleCommandScriptError];
-        [[NSScriptCommand currentCommand] setScriptErrorString:@"Invalid 
container for bookmark."];
-    }
+    [[NSScriptCommand currentCommand] 
setScriptErrorNumber:NSReceiversCantHandleCommandScriptError];
+    [[NSScriptCommand currentCommand] setScriptErrorString:@"Invalid container 
for bookmark."];
 }
 
 - (void)removeObjectFromBookmarksAtIndex:(NSUInteger)anIndex {
-    if ([self bookmarkType] == SKBookmarkTypeFolder) {
-        [[SKBookmarkController sharedBookmarkController] 
removeBookmarkAtIndex:anIndex ofBookmark:self animate:NO];
-    } else {
-        [[NSScriptCommand currentCommand] 
setScriptErrorNumber:NSReceiversCantHandleCommandScriptError];
-        [[NSScriptCommand currentCommand] setScriptErrorString:@"Invalid 
container for bookmark."];
-    }
+    [[NSScriptCommand currentCommand] 
setScriptErrorNumber:NSReceiversCantHandleCommandScriptError];
+    [[NSScriptCommand currentCommand] setScriptErrorString:@"Invalid container 
for bookmark."];
 }
 
 - (id)newScriptingObjectOfClass:(Class)objectClass forValueForKey:(NSString 
*)key withContentsValue:(id)contentsValue properties:(NSDictionary *)properties 
{
@@ -765,6 +752,23 @@
     return contents;
 }
 
+
+- (BOOL)isExpanded {
+    return [[SKBookmarkController sharedBookmarkController] 
isBookmarkExpanded:self];
+}
+
+- (void)setExpanded:(BOOL)flag {
+    [[SKBookmarkController sharedBookmarkController] setExpanded:flag 
forBookmark:self];
+}
+
+- (void)insertObject:(SKBookmark *)bookmark 
inBookmarksAtIndex:(NSUInteger)anIndex {
+    [[SKBookmarkController sharedBookmarkController] insertBookmark:bookmark 
atIndex:anIndex ofBookmark:self animate:NO];
+}
+
+- (void)removeObjectFromBookmarksAtIndex:(NSUInteger)anIndex {
+    [[SKBookmarkController sharedBookmarkController] 
removeBookmarkAtIndex:anIndex ofBookmark:self animate:NO];
+}
+
 - (id)newScriptingObjectOfClass:(Class)objectClass forValueForKey:(NSString 
*)key withContentsValue:(id)contentsValue properties:(NSDictionary *)properties 
{
     if ([key isEqualToString:@"bookmarks"]) {
         SKBookmark *bookmark = nil;
@@ -939,6 +943,22 @@
 
 - (NSArray *)entireContents { return nil; }
 
+- (BOOL)isExpanded {
+    return NO;
+}
+
+- (void)setExpanded:(BOOL)flag {}
+
+- (void)insertObject:(SKBookmark *)bookmark 
inBookmarksAtIndex:(NSUInteger)anIndex {
+    [[NSScriptCommand currentCommand] 
setScriptErrorNumber:NSReceiversCantHandleCommandScriptError];
+    [[NSScriptCommand currentCommand] setScriptErrorString:@"Invalid container 
for bookmark."];
+}
+
+- (void)removeObjectFromBookmarksAtIndex:(NSUInteger)anIndex {
+    [[NSScriptCommand currentCommand] 
setScriptErrorNumber:NSReceiversCantHandleCommandScriptError];
+    [[NSScriptCommand currentCommand] setScriptErrorString:@"Invalid container 
for bookmark."];
+}
+
 - (id)newScriptingObjectOfClass:(Class)objectClass forValueForKey:(NSString 
*)key withContentsValue:(id)contentsValue properties:(NSDictionary *)properties 
{
     if ([key isEqualToString:@"bookmarks"]) {
         [[NSScriptCommand currentCommand] 
setScriptErrorNumber:NSReceiversCantHandleCommandScriptError];

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