From 89b671c4a4288f3058157da292b1275e5bfb8392 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Fri, 6 Apr 2018 10:20:43 +0200 Subject: tdf#116836 Don't move objects out of cell when shrinking cell Change-Id: I8185f3501eb17a62ef4f55b2c8bb2d70f1895365 Reviewed-on: https://gerrit.libreoffice.org/52491 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- sc/source/core/data/drwlayer.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 3a765e8965bd..e694fed7c25a 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -729,8 +729,12 @@ void ScDrawLayer::ResizeLastRectFromAnchor(const SdrObject* pObj, ScDrawObjData& // Reduce offset also when shrinking if (!bIsGrowingLarger) { - aRect.setX(rtl::math::round(static_cast(aRect.getX()) * fWidthFactor)); - aRect.setY(rtl::math::round(static_cast(aRect.getY()) * fHeightFactor)); + Point aAvailableSpaceInCell = Point(aRect.getX() - aLastCellRect.TopLeft().X(), + aRect.getY() - aLastCellRect.TopLeft().Y()); + aRect.setX(rtl::math::round(static_cast(aRect.getX()) + + aAvailableSpaceInCell.X() * fWidthFactor)); + aRect.setY(rtl::math::round(static_cast(aRect.getY()) + + aAvailableSpaceInCell.Y() * fHeightFactor)); } } } -- cgit v1.2.3