summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2017-10-26 01:28:51 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-10-28 04:11:48 +0200
commit9270e6ad00b75eb35cae71998642a7c306eb4d03 (patch)
treea8a3fe842261b79f6d8dda8b4b137753881e0ada
parent7cebfbeabb24f908fb586ef5fa47f103042d769c (diff)
tdf#106084 EMF+ Add support for RotateWorldTransform record
Change-Id: If5ce156b7d60d30be8451902beb8330b7177b26e Reviewed-on: https://gerrit.libreoffice.org/43858 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--drawinglayer/source/tools/emfphelperdata.cxx18
-rw-r--r--drawinglayer/source/tools/emfphelperdata.hxx2
2 files changed, 19 insertions, 1 deletions
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index 79ce930a5358..ad67d6994d06 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -1440,6 +1440,24 @@ namespace emfplushelper
"EMF+\t dx: " << maWorldTransform.get(2, 0) << ", dy: " << maWorldTransform.get(2, 1));
break;
}
+ case EmfPlusRecordTypeRotateWorldTransform:
+ {
+ // Angle of rotation in degrees
+ float eAngle;
+ rMS.ReadFloat(eAngle);
+
+ SAL_INFO("cppcanvas.emf", "EMF+ EmfPlusRecordTypeRotateWorldTransform Angle: " << eAngle);
+
+ // Skipping flags & 0x2000
+ // For rotation transformation there is no difference between post and pre multiply
+ maWorldTransform.rotate(eAngle * F_PI180);
+
+ mappingChanged();
+
+ SAL_INFO("cppcanvas.emf",
+ "EMF+\t " << maWorldTransform);
+ break;
+ }
case EmfPlusRecordTypeSetClipRect:
{
int combineMode = (flags >> 8) & 0xf;
diff --git a/drawinglayer/source/tools/emfphelperdata.hxx b/drawinglayer/source/tools/emfphelperdata.hxx
index 99ef9964b945..082ad1ae4c69 100644
--- a/drawinglayer/source/tools/emfphelperdata.hxx
+++ b/drawinglayer/source/tools/emfphelperdata.hxx
@@ -80,7 +80,7 @@ namespace emfplushelper
#define EmfPlusRecordTypeMultiplyWorldTransform 0x402C
#define EmfPlusRecordTypeTranslateWorldTransform 0x402D
#define EmfPlusRecordTypeScaleWorldTransform 0x402E
- //TODO EmfPlusRecordTypeRotateWorldTransform 0x402F
+ #define EmfPlusRecordTypeRotateWorldTransform 0x402F
#define EmfPlusRecordTypeSetPageTransform 0x4030
//TODO EmfPlusRecordTypeResetClip 0x4031
#define EmfPlusRecordTypeSetClipRect 0x4032