sc/source/core/data/drwlayer.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit e401663fa338c04aa3c3422a8f268c732816f5bc
Author: Samuel Mehrbrodt <samuel.mehrbr...@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));
                 }
             }
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to