diff options
-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); |