cppcanvas/source/mtfrenderer/emfplus.cxx | 34 +++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-)
New commits: commit 78a3a304871eb3eb861a49ed00345b54fba01114 Author: Bartosz Kosiorek <gan...@poczta.onet.pl> Date: Thu Apr 20 15:58:41 2017 +0200 tdf#47243 tdf#39327 Add support for SetPageTransform Change-Id: Iea78cf1e9ca99c97814d9eaa4a65ad4b83a2bbe2 Reviewed-on: https://gerrit.libreoffice.org/36749 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gan...@poczta.onet.pl> diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 368450d9e6ab..d5c497a3f5bd 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -148,6 +148,16 @@ enum EmfPlusFontStyle FontStyleStrikeout = 0x00000008 }; +enum UnitType +{ + UnitTypeWorld = 0x00, + UnitTypeDisplay = 0x01, + UnitTypePixel = 0x02, + UnitTypePoint = 0x03, + UnitTypeInch = 0x04, + UnitTypeDocument = 0x05, + UnitTypeMillimeter = 0x06 +}; const char* emfTypeToName(sal_uInt16 type) { @@ -1314,12 +1324,28 @@ namespace cppcanvas } } break; + case EmfPlusRecordTypeSetPageTransform: - rMF.ReadFloat( fPageScale ); + { + rMF.ReadFloat( fPageScale ); - SAL_INFO("cppcanvas.emf", "EMF+ SetPageTransform"); - SAL_INFO("cppcanvas.emf", "EMF+\tscale: " << fPageScale << " unit: " << flags); - SAL_INFO("cppcanvas.emf", "EMF+\tTODO"); + SAL_INFO("cppcanvas.emf", "EMF+ SetPageTransform"); + SAL_INFO("cppcanvas.emf", "EMF+\tscale: " << fPageScale << " unit: " << flags); + + if (flags != UnitTypePixel) + SAL_WARN("cppcanvas.emf", "EMF+\t TODO Only UnitTypePixel is supported. "); + + XForm transform = XForm(); + transform.eM11 = fPageScale; + transform.eM22 = fPageScale; + + SAL_INFO("cppcanvas.emf", + "EMF+\t m11: " << aBaseTransform.eM11 << ", m12: " << aBaseTransform.eM12 << + "EMF+\t m21: " << aBaseTransform.eM21 << ", m22: " << aBaseTransform.eM22 << + "EMF+\t dx: " << aBaseTransform.eDx << ", dy: " << aBaseTransform.eDy); + + aBaseTransform.Multiply (transform); + } break; case EmfPlusRecordTypeSetRenderingOrigin: rMF.ReadInt32( nOriginX ).ReadInt32( nOriginY ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits