[Libreoffice-commits] core.git: cppcanvas/source
Bartosz Kosiorek
gang65 at poczta.onet.pl
Thu Apr 13 16:32:24 UTC 2017
cppcanvas/source/mtfrenderer/emfplus.cxx | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
New commits:
commit fe62003caabf7665d41085c5d16f177f8186fce4
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
Date: Mon Apr 10 00:31:00 2017 +0200
tdf#106084 EMF+ Add support for EmfPlusScaleWorldTransform record
The EmfPlusScaleWorldTransform record performs a scaling on the current world space transform.
Change-Id: I03717b28a88d574d597174c6ca3446f937c96a15
Reviewed-on: https://gerrit.libreoffice.org/36320
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65 at poczta.onet.pl>
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 924e5a220ff4..f1e2f4f7f401 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -103,7 +103,7 @@ namespace
#define EmfPlusRecordTypeResetWorldTransform 0x402B
#define EmfPlusRecordTypeMultiplyWorldTransform 0x402C
#define EmfPlusRecordTypeTranslateWorldTransform 0x402D
-//TODO EmfPlusRecordTypeScaleWorldTransform 0x402E
+#define EmfPlusRecordTypeScaleWorldTransform 0x402E
//TODO EmfPlusRecordTypeRotateWorldTransform 0x402F
#define EmfPlusRecordTypeSetPageTransform 0x4030
//TODO EmfPlusRecordTypeResetClip 0x4031
@@ -175,6 +175,7 @@ const char* emfTypeToName(sal_uInt16 type)
case EmfPlusRecordTypeResetWorldTransform: return "EmfPlusRecordTypeResetWorldTransform";
case EmfPlusRecordTypeMultiplyWorldTransform: return "EmfPlusRecordTypeMultiplyWorldTransform";
case EmfPlusRecordTypeTranslateWorldTransform: return "EmfPlusRecordTypeTranslateWorldTransform";
+ case EmfPlusRecordTypeScaleWorldTransform: return "EmfPlusRecordTypeScaleWorldTransform";
case EmfPlusRecordTypeSetPageTransform: return "EmfPlusRecordTypeSetPageTransform";
case EmfPlusRecordTypeSetClipRect: return "EmfPlusRecordTypeSetClipRect";
case EmfPlusRecordTypeSetClipPath: return "EmfPlusRecordTypeSetClipPath";
@@ -1420,6 +1421,29 @@ namespace cppcanvas
"EMF+\t dx: " << aWorldTransform.eDx << ", dy: " << aWorldTransform.eDy);
break;
}
+ case EmfPlusRecordTypeScaleWorldTransform:
+ {
+ XForm transform = XForm();
+ rMF.ReadFloat( transform.eM11 ).ReadFloat( transform.eM22 );
+ SAL_INFO("cppcanvas.emf", "EMF+ ScaleWorldTransform Sx: " << transform.eM11 << " Sy: " << transform.eM22);
+
+ SAL_INFO("cppcanvas.emf",
+ "EMF+\t m11: " << aWorldTransform.eM11 << ", m12: " << aWorldTransform.eM12 <<
+ "EMF+\t m21: " << aWorldTransform.eM21 << ", m22: " << aWorldTransform.eM22 <<
+ "EMF+\t dx: " << aWorldTransform.eDx << ", dy: " << aWorldTransform.eDy);
+
+ if (flags & 0x2000) // post multiply
+ aWorldTransform.Multiply (transform);
+ else { // pre multiply
+ transform.Multiply (aWorldTransform);
+ aWorldTransform.Set (transform);
+ }
+ SAL_INFO("cppcanvas.emf",
+ "EMF+\t m11: " << aWorldTransform.eM11 << ", m12: " << aWorldTransform.eM12 <<
+ "EMF+\t m21: " << aWorldTransform.eM21 << ", m22: " << aWorldTransform.eM22 <<
+ "EMF+\t dx: " << aWorldTransform.eDx << ", dy: " << aWorldTransform.eDy);
+ break;
+ }
case EmfPlusRecordTypeSetClipRect:
{
int combineMode = (flags >> 8) & 0xf;
More information about the Libreoffice-commits
mailing list