Locked logic is not moved during Layout. Locked logic only becomes permanent if you commit the changes to your design before exiting.
To lock macros:
Select the macro to lock. To select multiple macros, hold down the CTRL key and select multiple macros with your mouse. To select all macros, from the Edit menu, choose Select All.
From the Logic menu, choose Lock.
From the File menu, choose Commit to save your changes in this session. To save your changes in the design file (.adb), you must save your design in Designer as well.
To unlock a macro:
Select the macro. To select multiple macros, hold down the CTRL key and select multiple macros. To select all macros, from the Edit menu, choose Select All.
From the Logic menu, choose Unlock.