[Libreoffice-commits] core.git: Branch 'libreoffice-4-1-6' - cppcanvas/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Apr 22 06:33:55 PDT 2014


 cppcanvas/source/mtfrenderer/emfplus.cxx |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

New commits:
commit af8d6c6e58d18758c2544fc71c076ae537285c48
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Apr 9 10:47:25 2014 +0200

    fdo#77229 EMF+ rendering: improve EmfPlusSetClipPath's CombineModeExclude case
    
    This is still not perfect, but at least we now don't do the opposite of
    what was asked.
    
    Change-Id: I5e144c5ec2987902e65b2eb472259d9c39bbbd11
    (cherry picked from commit c2af50eb6df396c957890a6b912b8f3185893551)
    (cherry picked from commit 9b1108fb4107d1a009acf468a1771214928516c4)
    Reviewed-on: https://gerrit.libreoffice.org/9128
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index cb0a37b..36e6499 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -115,6 +115,16 @@ const sal_uInt32 EmfPlusLineJoinTypeBevel = 0x00000001;
 const sal_uInt32 EmfPlusLineJoinTypeRound = 0x00000002;
 const sal_uInt32 EmfPlusLineJoinTypeMiterClipped = 0x00000003;
 
+enum EmfPlusCombineMode
+{
+    EmfPlusCombineModeReplace = 0x00000000,
+    EmfPlusCombineModeIntersect = 0x00000001,
+    EmfPlusCombineModeUnion = 0x00000002,
+    EmfPlusCombineModeXOR = 0x00000003,
+    EmfPlusCombineModeExclude = 0x00000004,
+    EmfPlusCombineModeComplement = 0x00000005
+};
+
 using namespace ::com::sun::star;
 using namespace ::basegfx;
 
@@ -2185,7 +2195,19 @@ namespace cppcanvas
                             ::basegfx::B2DPolyPolygon& clipPoly (path.GetPolygon (*this));
 
                             clipPoly.transform (rState.mapModeTransform);
-                            updateClipping (clipPoly, rFactoryParms, combineMode == 1);
+                            switch (combineMode)
+                            {
+                            case EmfPlusCombineModeReplace:
+                            case EmfPlusCombineModeIntersect:
+                            case EmfPlusCombineModeUnion: // Is this, EmfPlusCombineModeXOR and EmfPlusCombineModeComplement correct?
+                            case EmfPlusCombineModeXOR:
+                            case EmfPlusCombineModeComplement:
+                                updateClipping (clipPoly, rFactoryParms, combineMode == 1);
+                                break;
+                            case EmfPlusCombineModeExclude:
+                                // Not doing anything is better then including exactly what we wanted to exclude.
+                                break;
+                            }
 
                             break;
                         }


More information about the Libreoffice-commits mailing list