summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2017-11-10 14:08:38 +0100
committerMark Page <aptitude@btconnect.com>2017-11-13 15:22:51 +0100
commit6db0267156030ca24163efd9b66278f54bf28d73 (patch)
tree32ed88814167514199f0169889bd26ea622abb85 /drawinglayer
parent4b334e45d570b79708ef34afba2eab78a410dab5 (diff)
tdf#113758 EMF+ Add support to OffsetClip record
OffsetClip record applies a translation transform on the current clipping region for the world space. Change-Id: Iac024a3c2eaba58edc5bb59d817796b6022f559f Reviewed-on: https://gerrit.libreoffice.org/44597 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/tools/emfphelperdata.cxx22
-rw-r--r--drawinglayer/source/tools/emfphelperdata.hxx2
2 files changed, 21 insertions, 3 deletions
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index d791eb034309..a1cdab8559d5 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -89,6 +89,7 @@ namespace emfplushelper
case EmfPlusRecordTypeSetClipRect: return "EmfPlusRecordTypeSetClipRect";
case EmfPlusRecordTypeSetClipPath: return "EmfPlusRecordTypeSetClipPath";
case EmfPlusRecordTypeSetClipRegion: return "EmfPlusRecordTypeSetClipRegion";
+ case EmfPlusRecordTypeOffsetClip: return "EmfPlusRecordTypeOffsetClip";
case EmfPlusRecordTypeDrawDriverString: return "EmfPlusRecordTypeDrawDriverString";
}
return "";
@@ -1506,7 +1507,7 @@ namespace emfplushelper
float eAngle;
rMS.ReadFloat(eAngle);
- SAL_INFO("drawinglayer", "EMF+ EmfPlusRecordTypeRotateWorldTransform Angle: " << eAngle <<
+ SAL_INFO("drawinglayer", "EMF+ RotateWorldTransform Angle: " << eAngle <<
", post multiply: " << (flags & 0x2000));
// Skipping flags & 0x2000
// For rotation transformation there is no difference between post and pre multiply
@@ -1519,7 +1520,7 @@ namespace emfplushelper
}
case EmfPlusRecordTypeResetClip:
{
- SAL_INFO("drawinglayer", "EMF+ EmfPlusRecordTypeResetClip");
+ SAL_INFO("drawinglayer", "EMF+ ResetClip");
// We don't need to read anything more, as Size needs to be set 0x0000000C
// and DataSize must be set to 0.
@@ -1584,6 +1585,23 @@ namespace emfplushelper
}
break;
}
+ case EmfPlusRecordTypeOffsetClip:
+ {
+ float dx, dy;
+ rMS.ReadFloat(dx).ReadFloat(dy);
+ SAL_INFO("drawinglayer", "EMF+ OffsetClip, Offset x:" << dx << ", y:" << dy);
+
+ basegfx::B2DPolyPolygon aPolyPolygon(
+ mrPropertyHolders.Current().getClipPolyPolygon());
+ basegfx::B2DHomMatrix transformMatrix;
+ transformMatrix.set(0, 2, dx);
+ transformMatrix.set(1, 2, dy);
+ aPolyPolygon.transform(transformMatrix);
+
+ HandleNewClipRegion(aPolyPolygon, mrTargetHolders, mrPropertyHolders);
+
+ break;
+ }
case EmfPlusRecordTypeDrawDriverString:
{
SAL_INFO("drawinglayer", "EMF+ DrawDriverString, flags: 0x" << std::hex << flags << std::dec);
diff --git a/drawinglayer/source/tools/emfphelperdata.hxx b/drawinglayer/source/tools/emfphelperdata.hxx
index 71aa0758544f..8c91e4edadb0 100644
--- a/drawinglayer/source/tools/emfphelperdata.hxx
+++ b/drawinglayer/source/tools/emfphelperdata.hxx
@@ -86,7 +86,7 @@ namespace emfplushelper
#define EmfPlusRecordTypeSetClipRect 0x4032
#define EmfPlusRecordTypeSetClipPath 0x4033
#define EmfPlusRecordTypeSetClipRegion 0x4034
- //TODO EmfPlusRecordTypeOffsetClip 0x4035
+ #define EmfPlusRecordTypeOffsetClip 0x4035
#define EmfPlusRecordTypeDrawDriverString 0x4036
//TODO EmfPlusRecordTypeStrokeFillPath 0x4037
//TODO EmfPlusRecordTypeSerializableObject 0x4038