Skip to content

Commit d4b4345

Browse files
Fixed ActivatePreviousStoryItem (navigate backwards) action
1 parent 53761b8 commit d4b4345

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

App/Views/READCOM.Views.StoryItem.pas

+2-2
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ function TStoryItem.GetPreviousSiblingStoryPoint: IStoryItem;
721721
var parentItem := ParentStoryItem;
722722
if not Assigned(parentItem) then exit(nil);
723723

724-
var storyItemIndex := parentItem.StoryItems.IndexOf(Self);
724+
var storyItemIndex := parentItem.StoryItems.IndexOf(Self as IStoryItem); //must use "as" here, else it won't always find it
725725
var siblings := parentItem.StoryItems;
726726

727727
for var i := (storyItemIndex - 1) downto 0 do //0-based array index
@@ -739,7 +739,7 @@ function TStoryItem.GetNextSiblingStoryPoint: IStoryItem;
739739
var parentItem := ParentStoryItem;
740740
if not Assigned(parentItem) then exit(nil);
741741

742-
var storyItemIndex := parentItem.StoryItems.IndexOf(Self as IStoryItem);
742+
var storyItemIndex := parentItem.StoryItems.IndexOf(Self as IStoryItem); //must use "as" here, else it won't always find it
743743
var siblings := parentItem.StoryItems;
744744

745745
for var i := (storyItemIndex + 1) to (siblings.Count - 1) do //0-based array index

0 commit comments

Comments
 (0)