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. To select all macros, from the Edit menu, choose Select All.
From the Edit menu, choose Lock.
From the File menu, choose Commit to make the changes permanent and update your .adb file.
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 Edit menu, choose Unlock.