[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Sun Jan 8 13:42:41 PST 2012


 sc/source/core/data/drwlayer.cxx |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit 7842c9a9734255b512e624865d7101c2599728d4
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Sun Jan 8 16:41:57 2012 -0500

    Handle resizing of cell-anchored polyline objects as well.
    
    This should take care of correctly resizing cell-anchored polyline
    objects when resizing row height / column width.

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index cdbb95d..74c9d35 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -794,6 +794,17 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
                 if (bRecording)
                     AddCalcUndo( new SdrUndoGeoObj( *pObj ) );
                 rData.maLastRect = lcl_makeSafeRectangle(aNew);
+                if (pObj->IsPolyObj())
+                {
+                    // Polyline objects need special treatment.
+                    Size aSizeMove(aNew.Left()-aOld.Left(), aNew.Top()-aOld.Top());
+                    pObj->NbcMove(aSizeMove);
+
+                    double fXFrac = static_cast<double>(aNew.GetWidth()) / static_cast<double>(aOld.GetWidth());
+                    double fYFrac = static_cast<double>(aNew.GetHeight()) / static_cast<double>(aOld.GetHeight());
+                    pObj->NbcResize(aNew.TopLeft(), Fraction(fXFrac), Fraction(fYFrac));
+                }
+
                 pObj->SetLogicRect(rData.maLastRect);
             }
         }


More information about the Libreoffice-commits mailing list