[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - sc/source
Samuel Mehrbrodt
Samuel.Mehrbrodt at cib.de
Fri Apr 6 11:04:13 UTC 2018
sc/source/core/data/drwlayer.cxx | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit e401663fa338c04aa3c3422a8f268c732816f5bc
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date: Fri Apr 6 10:20:43 2018 +0200
tdf#116836 Don't move objects out of cell when shrinking cell
Change-Id: I8185f3501eb17a62ef4f55b2c8bb2d70f1895365
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 000bbcc85a46..e55c3d5bdbeb 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -739,8 +739,12 @@ void ScDrawLayer::ResizeLastRectFromAnchor( SdrObject* pObj, ScDrawObjData& rDat
// 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));
}
}
}
More information about the Libreoffice-commits
mailing list