Skip to content

Restore fldatabasesaveas guard in menu save address update #392

Description

@jsavin

Summary

The mesavemenustructure_legacy and mesavemenustructure_v7 functions in menupack.c unconditionally update (**hm).adroutline after a successful save. The original code guarded this with !fldatabasesaveas to preserve Save As semantics (the original document's address should remain unchanged after Save As).

This guard was removed during the PR #391 refactoring. While headless mode doesn't currently support fileMenu.saveAs(), it will eventually need to work outside the migration context.

Impact

After a Save As operation, subsequent regular saves would go to the Save As destination instead of the original file, breaking expected Save As semantics.

Location

  • Common/source/menupack.cmesavemenustructure_legacy() (~line 418) and mesavemenustructure_v7() (~line 462)

Fix

Restore the if (!fldatabasesaveas) guard around the (**hm).adroutline = ... update in both functions.

Priority

P1 — Not blocking current work (headless mode has no Save As yet), but must be fixed before fileMenu.saveAs() is implemented.

Source

Cursor bot review on PR #391 (comment by cursor[bot]).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority/p1High priority - address soontype/bugDefect in existing functionality, needs fix

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions