diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-04-14 18:53:34 +0200 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-04-15 11:35:49 +0200 |
commit | 1393ba60b1eb43b55820f74c393da04308221d97 (patch) | |
tree | 1aafe1d3ac8e3e370aaaaef63a3c260654355b3b /sw/source/filter | |
parent | b65de36ecb839ec4d7a8f40f9ffe67956e9bc79d (diff) |
fdo#70838: fix rotation transformation in DML exporter
This patch fixes an error in commit
c6ff03f37a6898f50a5ca07152168fb4fe911e05.
And now that fdo#75722 is fixed, I completed the existing unit test
for this bug with absolute position checks.
Change-Id: I76b4fa046db9b946fd23194e91686ffa4fcb5362
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index c80cce040c2e..a2cb1092da11 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -85,7 +85,7 @@ OUString lclGetAnchorIdFromGrabBag(const SdrObject* pObj) return aResult; } -void lclMovePositionWithRotation(awt::Point& aPos, sal_Int64 nRotation) +void lclMovePositionWithRotation(awt::Point& aPos, const Size& rSize, sal_Int64 nRotation) { // code from ImplEESdrWriter::ImplFlipBoundingBox (filter/source/msfilter/eschesdo.cxx) // TODO: refactor @@ -104,8 +104,8 @@ void lclMovePositionWithRotation(awt::Point& aPos, sal_Int64 nRotation) double fCos = cos(fVal); double fSin = sin(fVal); - double nWidthHalf = (double) aPos.X / 2; - double nHeightHalf = (double) aPos.Y / 2; + double nWidthHalf = (double) rSize.Width() / 2; + double nHeightHalf = (double) rSize.Height() / 2; double nXDiff = fSin * nHeightHalf + fCos * nWidthHalf - nWidthHalf; double nYDiff = fSin * nWidthHalf + fCos * nHeightHalf - nHeightHalf; @@ -303,7 +303,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrmFmt* pFrmFmt, const Size& rS // SdrObjects know their layer, consider that instead of the frame format. bOpaque = pObj->GetLayer() != pFrmFmt->GetDoc()->GetHellId() && pObj->GetLayer() != pFrmFmt->GetDoc()->GetInvisibleHellId(); - lclMovePositionWithRotation(aPos, pObj->GetRotateAngle()); + lclMovePositionWithRotation(aPos, rSize, pObj->GetRotateAngle()); } attrList->add(XML_behindDoc, bOpaque ? "0" : "1"); attrList->add(XML_distT, OString::number(TwipsToEMU(pULSpaceItem.GetUpper())).getStr()); |