summaryrefslogtreecommitdiff
path: root/cppcanvas/source/mtfrenderer
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2017-04-08 02:35:34 +0200
committerBartosz Kosiorek <gang65@poczta.onet.pl>2017-04-13 18:30:02 +0200
commitfcb32f1cbc335a953cea62f66b9f50170263fb56 (patch)
tree718cdec77ca6fbd7d1c46c3f830a643901133ff0 /cppcanvas/source/mtfrenderer
parent747a4f30d2e6b44e31854849be30295cca25af5b (diff)
tdf#106084 EMF+ Add support for EmfPlusTranslateWorldTransform record
The EmfPlusTranslateWorldTransform record performs a translation on the current world space transform. Change-Id: I3e5744060c8a6d758bcc2804c6798e0208d2191f Reviewed-on: https://gerrit.libreoffice.org/36287 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'cppcanvas/source/mtfrenderer')
-rw-r--r--cppcanvas/source/mtfrenderer/emfplus.cxx27
1 files changed, 26 insertions, 1 deletions
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 618eddfa7915..97f3a59928f3 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -102,7 +102,7 @@ namespace
#define EmfPlusRecordTypeSetWorldTransform 0x402A
#define EmfPlusRecordTypeResetWorldTransform 0x402B
#define EmfPlusRecordTypeMultiplyWorldTransform 0x402C
-//TODO EmfPlusRecordTypeTranslateWorldTransform 0x402D
+#define EmfPlusRecordTypeTranslateWorldTransform 0x402D
//TODO EmfPlusRecordTypeScaleWorldTransform 0x402E
//TODO EmfPlusRecordTypeRotateWorldTransform 0x402F
#define EmfPlusRecordTypeSetPageTransform 0x4030
@@ -174,6 +174,7 @@ const char* emfTypeToName(sal_uInt16 type)
case EmfPlusRecordTypeSetWorldTransform: return "EmfPlusRecordTypeSetWorldTransform";
case EmfPlusRecordTypeResetWorldTransform: return "EmfPlusRecordTypeResetWorldTransform";
case EmfPlusRecordTypeMultiplyWorldTransform: return "EmfPlusRecordTypeMultiplyWorldTransform";
+ case EmfPlusRecordTypeTranslateWorldTransform: return "EmfPlusRecordTypeTranslateWorldTransform";
case EmfPlusRecordTypeSetPageTransform: return "EmfPlusRecordTypeSetPageTransform";
case EmfPlusRecordTypeSetClipRect: return "EmfPlusRecordTypeSetClipRect";
case EmfPlusRecordTypeSetClipPath: return "EmfPlusRecordTypeSetClipPath";
@@ -1393,6 +1394,30 @@ namespace cppcanvas
"EMF+\tdx: " << aWorldTransform.eDx << "dy: " << aWorldTransform.eDy);
break;
}
+ case EmfPlusRecordTypeTranslateWorldTransform:
+ {
+ SAL_INFO("cppcanvas.emf", "EMF+ TranslateWorldTransform");
+
+ XForm transform = XForm();
+ rMF.ReadFloat( transform.eDx ).ReadFloat( transform.eDy );
+
+ SAL_INFO("cppcanvas.emf",
+ "EMF+\t m11: " << transform.eM11 << ", m12: " << transform.eM12 <<
+ "EMF+\t m21: " << transform.eM21 << ", m22: " << transform.eM22 <<
+ "EMF+\t dx: " << transform.eDx << ", dy: " << transform.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;