sw/source/ui/shells/grfsh.cxx | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
New commits: commit 9121f09f3aeb75f3091c6b59cc3c3fade54cb607 Author: Tomaž Vajngerl <qui...@gmail.com> Date: Thu Aug 1 23:18:13 2013 +0200 fdo#67639 Rotate crop area when the image is rotated. Change-Id: Ifdd0080f278b67b815f15c71523497de59e615bd diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx index 33108c0..911d1e2 100644 --- a/sw/source/ui/shells/grfsh.cxx +++ b/sw/source/ui/shells/grfsh.cxx @@ -764,11 +764,33 @@ void SwGrfShell::ExecuteRotation(SfxRequest &rReq) aTransform.rotate(aRotation); rShell.ReRead(aEmptyStr, aEmptyStr, (const Graphic*) &aGraphic); - SwFlyFrmAttrMgr aManager( false, &rShell, rShell.IsFrmSelected() ? FRMMGR_TYPE_NONE : FRMMGR_TYPE_GRF); + SwFlyFrmAttrMgr aManager(false, &rShell, rShell.IsFrmSelected() ? FRMMGR_TYPE_NONE : FRMMGR_TYPE_GRF); Size aSize(aManager.GetSize().Height(), aManager.GetSize().Width()); aManager.SetSize(aSize); aManager.UpdateFlyFrm(); + SfxItemSet aSet( rShell.GetAttrPool(), RES_GRFATR_CROPGRF, RES_GRFATR_CROPGRF ); + rShell.GetCurAttr( aSet ); + SwCropGrf aCrop( (const SwCropGrf&) aSet.Get(RES_GRFATR_CROPGRF) ); + Rectangle aCropRectangle(aCrop.GetLeft(), aCrop.GetTop(), aCrop.GetRight(), aCrop.GetBottom()); + + if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_LEFT) + { + aCrop.SetLeft( aCropRectangle.Top() ); + aCrop.SetTop( aCropRectangle.Right() ); + aCrop.SetRight( aCropRectangle.Bottom() ); + aCrop.SetBottom( aCropRectangle.Left() ); + } + else if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_RIGHT) + { + aCrop.SetLeft( aCropRectangle.Bottom() ); + aCrop.SetTop( aCropRectangle.Left() ); + aCrop.SetRight( aCropRectangle.Top() ); + aCrop.SetBottom( aCropRectangle.Right() ); + } + + rShell.SetAttr(aCrop); + rShell.EndUndo(UNDO_END); rShell.EndAllAction(); }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits