[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - cppcanvas/source

Muthu Subramanian sumuthu at suse.com
Fri Apr 26 04:32:05 PDT 2013


 cppcanvas/source/mtfrenderer/emfplus.cxx |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 8d64acdfac9acbf1a58902e8a531373b6f5c52fc
Author: Muthu Subramanian <sumuthu at suse.com>
Date:   Fri Apr 26 16:58:18 2013 +0530

    fdo#60638: Workaround should be in FillRects rather than FillPolygon.
    
    Ported from: 5a1d77327867ae9b80bc676d67f1f70a5d8a2fd4

diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 1ef38a6..2c80e1d 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -893,10 +893,6 @@ namespace cppcanvas
                 EMFP_DEBUG (printf ("EMF+\t\tcolor fill:0x%X\n", brushIndexOrColor));
                 rState.isFillColorSet = true;
                 rState.isLineColorSet = false;
-                // n#812793: EMF+ Seems to specify transparent background with Alpha=0xFF !
-                // Workaround for the problem.
-                if(brushIndexOrColor == 0xFFFFFFFF)
-                    brushIndexOrColor = 0xFFFFFF;
 
                 SET_FILL_COLOR(brushIndexOrColor);
 
@@ -1370,6 +1366,7 @@ namespace cppcanvas
 
                         sal_uInt32 brushIndexOrColor;
                         sal_Int32 rectangles;
+                        bool isColor = (flags & 0x8000);
                         ::basegfx::B2DPolygon polygon;
 
                         rMF >> brushIndexOrColor >> rectangles;
@@ -1405,7 +1402,12 @@ namespace cppcanvas
 
                             ::basegfx::B2DPolyPolygon polyPolygon (polygon);
 
-                            EMFPPlusFillPolygon (polyPolygon, rFactoryParms, rState, rCanvas, flags & 0x8000, brushIndexOrColor);
+                            // n#812793: EMF+ Seems to specify transparent background with Alpha=0xFF !
+                            // Workaround for the problem.
+                            if( isColor && brushIndexOrColor == 0xFFFFFFFF && rectangles == 1 )
+                                brushIndexOrColor = 0xFFFFFF;
+
+                            EMFPPlusFillPolygon (polyPolygon, rFactoryParms, rState, rCanvas, isColor, brushIndexOrColor);
                         }
                         break;
                     }


More information about the Libreoffice-commits mailing list