diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-08 16:41:57 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-08 16:41:57 -0500 |
commit | 7842c9a9734255b512e624865d7101c2599728d4 (patch) | |
tree | 3ee9b3f1d924ceab93dcf3c50b0497bee8f4f3c0 /sc | |
parent | 365bf7410caaf9a81b0c62b806a221744745a3b9 (diff) |
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.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index cdbb95dabaa3..74c9d35f659e 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); } } |