9293276
From f41ae9bc40fae21ac66d859057488801c1d47ccd Mon Sep 17 00:00:00 2001
d68e2d5
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
d68e2d5
Date: Thu, 31 Aug 2017 16:22:58 +0100
d68e2d5
Subject: [PATCH] Resolves: tdf#112145 pdf export of editengine highlight color
d68e2d5
 fails sometimes
d68e2d5
d68e2d5
When setting a fill or line color on the outputdevice, put it back to its previous
d68e2d5
setting when finished with the record, PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D
d68e2d5
was the one in this case but protect the other similar ones here too
d68e2d5
d68e2d5
Change-Id: Ifb9b182d72bb6c48a9d9480270fde4384be6291e
d68e2d5
---
d68e2d5
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 8 ++++++++
d68e2d5
 1 file changed, 8 insertions(+)
d68e2d5
d68e2d5
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
9293276
index 885367d..0274b7c 100644
d68e2d5
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
d68e2d5
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
d68e2d5
@@ -1219,6 +1219,8 @@ namespace drawinglayer
d68e2d5
                     }
d68e2d5
                     else
d68e2d5
                     {
d68e2d5
+                        mpOutputDevice->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
d68e2d5
+
d68e2d5
                         // support SvtGraphicStroke MetaCommentAction
d68e2d5
                         SvtGraphicStroke* pSvtGraphicStroke = impTryToCreateSvtGraphicStroke(
d68e2d5
                             rBasePolygon, nullptr,
d68e2d5
@@ -1274,6 +1276,8 @@ namespace drawinglayer
d68e2d5
                         }
d68e2d5
 
d68e2d5
                         impEndSvtGraphicStroke(pSvtGraphicStroke);
d68e2d5
+
d68e2d5
+                        mpOutputDevice->Pop();
d68e2d5
                     }
d68e2d5
 
d68e2d5
                     break;
d68e2d5
@@ -1666,6 +1670,7 @@ namespace drawinglayer
d68e2d5
                 }
d68e2d5
                 case PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D :
d68e2d5
                 {
d68e2d5
+                    mpOutputDevice->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
d68e2d5
                     const primitive2d::PolyPolygonColorPrimitive2D& rPolygonCandidate(static_cast< const primitive2d::PolyPolygonColorPrimitive2D& >(rCandidate));
d68e2d5
                     basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
d68e2d5
 
9293276
@@ -1722,6 +1727,7 @@ namespace drawinglayer
9293276
                         impEndSvtGraphicFill(pSvtGraphicFill);
d68e2d5
                     }
d68e2d5
 
d68e2d5
+                    mpOutputDevice->Pop();
d68e2d5
                     break;
d68e2d5
                 }
9293276
                 case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D :
d68e2d5
@@ -1811,6 +1817,7 @@ namespace drawinglayer
d68e2d5
                 }
d68e2d5
                 case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D :
d68e2d5
                 {
5919e74
+                    mpOutputDevice->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
d68e2d5
                     // for metafile: Need to examine what the pure vcl version is doing here actually
d68e2d5
                     // - uses DrawTransparent with metafile for content and a gradient
d68e2d5
                     // - uses DrawTransparent for single PolyPoylgons directly. Can be detected by
d68e2d5
@@ -1945,6 +1952,7 @@ namespace drawinglayer
d68e2d5
                         }
d68e2d5
                     }
d68e2d5
 
d68e2d5
+                    mpOutputDevice->Pop();
d68e2d5
                     break;
d68e2d5
                 }
d68e2d5
                 case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
d68e2d5
-- 
9293276
2.13.5
d68e2d5