TTMSFNCGanttChart 1.3.3.10: locked task with a predecessor shows different dates after save/load - intended?

Attachment: LockedTaskSaveLoad.zip (small VCL demo, only TMS FNC Gantt Chart needed)

Delphi 13.1 Florence, VCL, TMS FNC Gantt Chart 1.3.3.10.

A quick question about Locked in combination with task dependencies - I'm not sure whether this is intended.

The attached demo creates two tasks (Mon–Fri work days, whWorkDaysOnly): A starts on Mon 2026-11-02 with 5 work days, B has 5 work days and a finish-to-start dependency on A. Press "Run all steps" (or the three buttons one by one); the memo logs the dates after every step:

Step B shown (ScheduledStart → ScheduledEnd) B.PlannedStart B.Locked
Start Mon 2026-11-09 → Sat 2026-11-14 Sat 2026-11-07 False
1. Lock B Mon 2026-11-09 → Sat 2026-11-14 Sat 2026-11-07 True
2. Extend A from 5 to 8 work days Mon 2026-11-09 → Sat 2026-11-14 Thu 2026-11-12 True
3. SaveTasksToJSONStream + LoadTasksFromJSONStream Thu 2026-11-12 → Thu 2026-11-19 Thu 2026-11-12 True

So after step 2, B stays where it is on screen — as expected for a locked task — but its PlannedStart has already moved. After saving and loading, B shows the moved dates while it is still locked.

What we found in the sources (VCL.TMSFNCGanttClasses.pas, 1.3.3.10):

  • CalculateTaskTimes moves FPlannedStart to the dependency date without checking FLocked (lines 2597–2600).
  • For a locked task the displayed dates come from FTempSchedStart / FTempSchedEnd, which ClearTemporaryValues deliberately keeps (lines 2649–2656). That is why B stays in place on screen.
  • SaveToJSON writes PlannedStart (line 5343) — the value that has already been moved — and loading does not restore the scheduled dates. After loading, the moved value becomes visible.

The documentation of Locked says "Prevents interactive or programmatic schedule changes when True" ( TTMSFNCGanttTask.Locked Property – TMS FNC Gantt Chart | TMS Software Documentation ), so we would expect B to keep its dates through save and load.

Question: Is this the intended behavior? If not, would skipping the dependency adjustment of FPlannedStart in CalculateTaskTimes for locked tasks be the right place? The fields involved are private, so we can't work around it cleanly from the outside.

FMX and WEB sources are identical at these lines.

Thanks a lot for having a look!

LockedTaskSaveLoad.zip (5.5 KB)

Thanks for the detailed analysis and the demo, it made this easy to reproduce.

You're right, this was not intended.
A locked task should not have its PlannedStart moved by a dependency.
We've fixed the following: dependencies no longer change a locked task,
unlocking it applies the dependencies again,
and files saved with the current version are corrected when loaded, so locked tasks keep the dates they were shown with.

The fix will be in the next update.

Gantt 1.3.3.11 solves this, thank you. With the demo from this thread, task B keeps its dates (09.11.–14.11.2026), and B.PlannedStart stays on 07.11.2026, also after SaveTasksToJSONStream / LoadTasksFromJSONStream. With 1.3.3.10, B moved behind A after loading. In our application a locked task with a predecessor now keeps its dates after saving and reopening the plan as well.

As you wrote above, unlocking a task applies its dependencies again, and it now recalculates right away (SetLocked calls CalculateTaskTimes). Our cancel logic in the task dialog relies on this, so it would be great if it stays like this.