Created attachment 129352 [details] Rerproducer document. Steps to reproduce: 1) Open the bugdoc. 2) Click on the right of Frame1. 3) Press enter -> Frame2 moves to page 2. 4) Press Undo Expected: the initial layout and the layout after undo matches. Actual: Frame2 remains on page 2 after undo. I'm not yet sure what is the correct layout here, either the initial layout is wrong, or the layout produced after undo is wrong. But they should be the same.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=862c12396585661606d4e6ae583d1d024a19d222 tdf#104440 sw: fix layout inconsistency with dynamic wrapping and undo It will be available in 5.4.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.