diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-14 08:44:06 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-14 08:18:13 +0000 |
commit | c3acc06230169f141930945ebbff43b1a88dfdee (patch) | |
tree | 547be2e8aadc0ad490ec41f797e602d231a5347a /writerfilter | |
parent | 656513d15116a3c6feeadc6a3353a304e0b3ef2b (diff) |
Related: tdf#91684 RTF import: fix scaling of group shape children
It was assumed that the child size is in twips, but it's in relative
coordinates.
Change-Id: I51352180c2e61a70b1a34faad5d73f96121168a8
Reviewed-on: https://gerrit.libreoffice.org/26240
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfsdrimport.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index 7062c48e2f55..beffd4daa969 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -875,6 +875,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap bool bInShapeGroup = oGroupLeft && oGroupTop && oGroupRight && oGroupBottom && oRelLeft && oRelTop && oRelRight && oRelBottom; + awt::Size aSize; if (bInShapeGroup) { // See lclGetAbsPoint() in the VML import: rShape is the group shape, oGroup is its coordinate system, oRel is the relative child shape. @@ -886,6 +887,10 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap double fHeightRatio = static_cast< double >(nShapeHeight) / nCoordSysHeight; nLeft = static_cast< sal_Int32 >(rShape.nLeft + fWidthRatio * (*oRelLeft - *oGroupLeft)); nTop = static_cast< sal_Int32 >(rShape.nTop + fHeightRatio * (*oRelTop - *oGroupTop)); + + // See lclGetAbsRect() in the VML import. + aSize.Width = static_cast<sal_Int32>(fWidthRatio * (*oRelRight - *oRelLeft) + 0.5); + aSize.Height = static_cast<sal_Int32>(fHeightRatio * (*oRelBottom - *oRelTop) + 0.5); } if (m_bTextFrame) @@ -897,7 +902,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap xShape->setPosition(awt::Point(nLeft, nTop)); if (bInShapeGroup) - xShape->setSize(awt::Size(*oRelRight - *oRelLeft, *oRelBottom - *oRelTop)); + xShape->setSize(aSize); else xShape->setSize(awt::Size(rShape.nRight - rShape.nLeft, rShape.nBottom - rShape.nTop)); |