summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2017-04-20 15:58:41 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2017-04-24 09:53:00 +0200
commit78a3a304871eb3eb861a49ed00345b54fba01114 (patch)
treecbc10a1ba6f15321e809ba1684f0d001a227080d
parentf9af0abce2c266a53f536a207a62bc691213f6a0 (diff)
tdf#47243 tdf#39327 Add support for SetPageTransform
Change-Id: Iea78cf1e9ca99c97814d9eaa4a65ad4b83a2bbe2 Reviewed-on: https://gerrit.libreoffice.org/36749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
-rw-r--r--cppcanvas/source/mtfrenderer/emfplus.cxx34
1 files changed, 30 insertions, 4 deletions
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 );