summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-04-06 10:20:43 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-04-06 13:09:55 +0200
commit89b671c4a4288f3058157da292b1275e5bfb8392 (patch)
tree8bd7dc860d74e8db1f52066b702be1f4766ad487
parent49a2ca259287173d86a303b5c75d25ce52a9e26c (diff)
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 <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r--sc/source/core/data/drwlayer.cxx8
1 files 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<double>(aRect.getX()) * fWidthFactor));
- aRect.setY(rtl::math::round(static_cast<double>(aRect.getY()) * fHeightFactor));
+ Point aAvailableSpaceInCell = Point(aRect.getX() - aLastCellRect.TopLeft().X(),
+ aRect.getY() - aLastCellRect.TopLeft().Y());
+ aRect.setX(rtl::math::round(static_cast<double>(aRect.getX())
+ + aAvailableSpaceInCell.X() * fWidthFactor));
+ aRect.setY(rtl::math::round(static_cast<double>(aRect.getY())
+ + aAvailableSpaceInCell.Y() * fHeightFactor));
}
}
}