Created attachment 116604 [details]
Diagram that undoes wrongly after resizing box
See attached document. (On Fedora 22 x86-64 126.96.36.199-6.fc22)
1) Click the left edge of the outer blue box
2) With that selected, drag the edge to the right, e.g. to line up with the left edge of the smaller box. The outer box is now narrower than before, but it's vertical position is unchanged.
3) hit ctrl-z to undo
When hitting ctrl-z the box returns to a point higher up than it originally was.
Win 7 Pro 64-bit Version: 188.8.131.52.alpha1+
Build ID: 437210d58f32177ef1829d704f7f4d2f1bbfbfdd
TinderBox: Win-x86@39, Branch:master, Time: 2015-06-18_07:21:56
Locale: fi-FI (fi_FI)
Ubuntu 15.04 64-bit
hmm, if I click on these there is no "anchor" drawn. So I think the undo "works" to restore the position of the object relative to the anchor, but its the selection of "anchor" that has gone awry. e.g. if I change the anchor before I move it then the undo restores it correctly.
If SwFEShell::EndDrag is tweaked to not group the anchor change undo and the draw size/pos change undo together and then you undo each step in the ui one at a time this works fine.
So what's apparently happening is that the first undo occurs, then the layout kicks in on idle and calls MakeObjPos on the drawing item and updates it for the new anchor pos. Then on triggering size undo the anchor is correct so the new pos is set correctly.
If they are bundled together however, the layout at idle doesn't occur until after the anchor and size have been set, so the adjustment is too late
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":
Resolves: tdf#92137 drawing layer resize undo in writer fails...
It will be available in 5.1.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:
Affected users are encouraged to test the fix and report feedback.