[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - drawinglayer/source
Bartosz Kosiorek
gang65 at poczta.onet.pl
Thu Apr 19 11:23:21 UTC 2018
drawinglayer/source/tools/emfphelperdata.cxx | 10 +++++++++-
drawinglayer/source/tools/emfphelperdata.hxx | 1 +
2 files changed, 10 insertions(+), 1 deletion(-)
New commits:
commit 674e8c5412e938191ad3e928e9a52b5420bec85c
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
Date: Sun Apr 15 02:00:16 2018 +0200
tdf#53485 tdf#117015 EMF+ Fix for displaying EMF+ files where GetDC is used
With EMF+ Only mode, still the EMF records could be used for
displaying objects, by using Get Device Context (GetDC).
Files identified as EMF+ Only can contain both EMF+ records and EMF records. All EMF+
records are used to render the image. The EMF records that are part of the drawing are those
preceded by a Get Device Context record.
Unfortunately after finishing EMF drawing, the clip region was
not reset. As a result records after EMF record was not displayed.
With this patch, the issue was fixed by resetting clip region.
Change-Id: I998b14e7c3b56a7711ba6a7bec08ec2097e0dfce
Reviewed-on: https://gerrit.libreoffice.org/52897
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Bartosz Kosiorek <gang65 at poczta.onet.pl>
(cherry picked from commit a2851d562cdfaf06e5f767030677846f3f129b1c)
Reviewed-on: https://gerrit.libreoffice.org/53093
Reviewed-by: Armin Le Grand <Armin.Le.Grand at cib.de>
Tested-by: Bartosz Kosiorek <gang65 at poczta.onet.pl>
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index 2b123372b908..bd7b4d90a40f 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -714,7 +714,8 @@ namespace emfplushelper
mMFlags(0),
mMStream(),
mrTargetHolders(rTargetHolders),
- mrPropertyHolders(rPropertyHolders)
+ mrPropertyHolders(rPropertyHolders),
+ bIsGetDCProcessing(false)
{
rMS.ReadInt32(mnFrameLeft).ReadInt32(mnFrameTop).ReadInt32(mnFrameRight).ReadInt32(mnFrameBottom);
SAL_INFO("drawinglayer", "EMF+ picture frame: " << mnFrameLeft << "," << mnFrameTop << " - " << mnFrameRight << "," << mnFrameBottom);
@@ -807,6 +808,12 @@ namespace emfplushelper
SAL_INFO("drawinglayer", "EMF+ record size: " << size << " type: " << emfTypeToName(type) << " flags: " << flags << " data size: " << dataSize);
+ if (bIsGetDCProcessing)
+ {
+ SAL_INFO("drawinglayer", "EMF+ Resets the current clipping region for the world space to infinity.");
+ wmfemfhelper::HandleNewClipRegion(::basegfx::B2DPolyPolygon(), mrTargetHolders, mrPropertyHolders);
+ bIsGetDCProcessing = false;
+ }
if (type == EmfPlusRecordTypeObject && ((mbMultipart && (flags & 0x7fff) == (mMFlags & 0x7fff)) || (flags & 0x8000)))
{
if (!mbMultipart)
@@ -881,6 +888,7 @@ namespace emfplushelper
}
case EmfPlusRecordTypeGetDC:
{
+ bIsGetDCProcessing = true;
SAL_INFO("drawinglayer", "EMF+ GetDC");
SAL_INFO("drawinglayer", "EMF+\talready used in svtools wmf/emf filter parser");
break;
diff --git a/drawinglayer/source/tools/emfphelperdata.hxx b/drawinglayer/source/tools/emfphelperdata.hxx
index ba58686088f9..3c03af6d17f3 100644
--- a/drawinglayer/source/tools/emfphelperdata.hxx
+++ b/drawinglayer/source/tools/emfphelperdata.hxx
@@ -223,6 +223,7 @@ namespace emfplushelper
/// data holders
wmfemfhelper::TargetHolders& mrTargetHolders;
wmfemfhelper::PropertyHolders& mrPropertyHolders;
+ bool bIsGetDCProcessing;
// readers
void processObjectRecord(SvMemoryStream& rObjectStream, sal_uInt16 flags, sal_uInt32 dataSize, bool bUseWholeStream = false);
More information about the Libreoffice-commits
mailing list