From e2e4798b35ecd33a09dda85c575d7a7709ab9414 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 16 Feb 2018 10:23:51 +0200 Subject: Revert "loplugin:changetoolsgen in sc" and reapply plugin because I (a) forgot to insert parentheses which changes the meaning of some expressions and (b) I now use the AdjustFoo calls when changing unary operations, which reads much better This reverts commit 95fab7cbf2f0576d0f728bed8898b7ff769d90e6. Change-Id: Icbdcc0f4227d88812be12e18ba6961088db80c3e Reviewed-on: https://gerrit.libreoffice.org/49840 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/ui/view/viewfun7.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sc/source/ui/view/viewfun7.cxx') diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx index bf50a0739c87..57b56692f1fa 100644 --- a/sc/source/ui/view/viewfun7.cxx +++ b/sc/source/ui/view/viewfun7.cxx @@ -64,11 +64,11 @@ static void lcl_AdjustInsertPos( ScViewData* pData, Point& rPos, Size& rSize ) long y = aPgSize.Height() - rPos.Y() - rSize.Height(); // if necessary: adjustments (80/200) for pixel approx. errors if( x < 0 ) - rPos.setX( rPos.X() + x + 80 ); + rPos.AdjustX(x + 80 ); if( y < 0 ) - rPos.setY( rPos.Y() + y + 200 ); - rPos.setX( rPos.X() + rSize.Width() / 2 ); // position at paste is center - rPos.setY( rPos.Y() + rSize.Height() / 2 ); + rPos.AdjustY(y + 200 ); + rPos.AdjustX(rSize.Width() / 2 ); // position at paste is center + rPos.AdjustY(rSize.Height() / 2 ); } void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, @@ -347,7 +347,7 @@ bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::X // don't call AdjustInsertPos Point aInsPos = rPos; if ( GetViewData().GetDocument()->IsNegativePage( GetViewData().GetTabNo() ) ) - aInsPos.setX( aInsPos.X() - aSize.Width() ); + aInsPos.AdjustX( -(aSize.Width()) ); tools::Rectangle aRect( aInsPos, aSize ); ScDrawView* pDrView = GetScDrawView(); @@ -426,7 +426,7 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic, Size aSize = pWin->LogicToLogic( rGraphic.GetPrefSize(), &aSourceMap, &aDestMap ); if ( GetViewData().GetDocument()->IsNegativePage( GetViewData().GetTabNo() ) ) - aPos.setX( aPos.X() - aSize.Width() ); + aPos.AdjustX( -(aSize.Width()) ); GetViewData().GetViewShell()->SetDrawShell( true ); tools::Rectangle aRect(aPos, aSize); -- cgit