diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-07-03 11:46:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-07-03 13:32:17 +0100 |
commit | f1256611054701a2bba20225fb654814eecbf559 (patch) | |
tree | 2aef0217b202c4959e0d9ef51f35504ca2b23274 | |
parent | 3b32c5898ff4e744d3f18b00421b433500426d74 (diff) |
Resolves: tdf#92137 drawing layer resize undo in writer fails...
to restore location 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.
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
Change-Id: I5402d851fcae7f240cc6e9a0e15159115bb663ce
-rw-r--r-- | sw/source/core/undo/unattr.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index ec5770db5516..9283ae2f3ac4 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -480,9 +480,9 @@ bool SwUndoFormatAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) } } + SwDrawContact *pCont = NULL; if ( RES_DRAWFRMFMT == pFrameFormat->Which() ) { - SwDrawContact *pCont = - static_cast<SwDrawContact*>(pFrameFormat->FindContactObj()); + pCont = static_cast<SwDrawContact*>(pFrameFormat->FindContactObj()); // The Draw model also prepared an Undo object for its right positioning // which unfortunately is relative. Therefore block here a position // change of the Contact object by setting the anchor. @@ -508,8 +508,13 @@ bool SwUndoFormatAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) pTextNd->InsertItem( aFormat, pPos->nContent.GetIndex(), 0 ); } - if( RES_DRAWFRMFMT != pFrameFormat->Which() ) + if (RES_DRAWFRMFMT != pFrameFormat->Which()) pFrameFormat->MakeFrms(); + else + { + SdrObject* pSdrObj = pFrameFormat->FindSdrObject(); + pCont->GetAnchoredObj(pSdrObj)->MakeObjPos(); + } rContext.SetSelections(pFrameFormat, 0); |