Bug 1317653: Since we don't support XP anymore remove manual language pack initialization for printing surfaces. r=jrmuizel draft
authorBas Schouten <bschouten@mozilla.com>
Thu, 09 Feb 2017 16:29:14 +0000
changeset 481366 95d63a14f816fe57d73b17543e66ae25d9b92ae5
parent 481299 d8276bdfb12b96e3c834feed02325551e559ae57
child 545155 cf9b2a0e5a4d375d82e1491f437c9767d1ac9475
push id44768
push userbschouten@mozilla.com
push dateThu, 09 Feb 2017 16:29:58 +0000
reviewersjrmuizel
bugs1317653
milestone54.0a1
Bug 1317653: Since we don't support XP anymore remove manual language pack initialization for printing surfaces. r=jrmuizel MozReview-Commit-ID: 3R9HYyPofXu
gfx/cairo/cairo/src/cairo-win32-printing-surface.c
--- a/gfx/cairo/cairo/src/cairo-win32-printing-surface.c
+++ b/gfx/cairo/cairo/src/cairo-win32-printing-surface.c
@@ -119,52 +119,16 @@ static void
     if (ExtEscape(surface->dc, QUERYESCSUPPORT, sizeof(word), (char *)&word, 0, (char *)NULL) > 0)
 	surface->flags |= CAIRO_WIN32_SURFACE_CAN_CHECK_JPEG;
 
     word = CHECKPNGFORMAT;
     if (ExtEscape(surface->dc, QUERYESCSUPPORT, sizeof(word), (char *)&word, 0, (char *)NULL) > 0)
 	surface->flags |= CAIRO_WIN32_SURFACE_CAN_CHECK_PNG;
 }
 
-/* When creating an EMF file, ExtTextOut with ETO_GLYPH_INDEX does not
- * work unless the GDI function GdiInitializeLanguagePack() has been
- * called.
- *
- *   http://m-a-tech.blogspot.com/2009/04/emf-buffer-idiocracy.html
- *
- * The only information I could find on the how to use this
- * undocumented function is the use in:
- *
- * http://src.chromium.org/viewvc/chrome/trunk/src/chrome/renderer/render_process.cc?view=markup
- *
- * to solve the same problem. The above code first checks if LPK.DLL
- * is already loaded. If it is not it calls
- * GdiInitializeLanguagePack() using the prototype
- *   BOOL GdiInitializeLanguagePack (int)
- * and argument 0.
- */
-static void
-_cairo_win32_printing_surface_init_language_pack (cairo_win32_surface_t *surface)
-{
-    typedef BOOL (WINAPI *gdi_init_lang_pack_func_t)(int);
-    gdi_init_lang_pack_func_t gdi_init_lang_pack;
-    HMODULE module;
-
-    if (GetModuleHandleW (L"LPK.DLL"))
-	return;
-
-    module = GetModuleHandleW (L"GDI32.DLL");
-    if (module) {
-	gdi_init_lang_pack = (gdi_init_lang_pack_func_t)
-	    GetProcAddress (module, "GdiInitializeLanguagePack");
-	if (gdi_init_lang_pack)
-	    gdi_init_lang_pack (0);
-    }
-}
-
 static cairo_int_status_t
 analyze_surface_pattern_transparency (cairo_surface_pattern_t *pattern)
 {
     cairo_image_surface_t  *image;
     void		   *image_extra;
     cairo_int_status_t      status;
     cairo_image_transparency_t transparency;
 
@@ -1917,17 +1881,16 @@ cairo_win32_printing_surface_create (HDC
     surface->extents.width = rect.right - rect.left;
     surface->extents.height = rect.bottom - rect.top;
 
     surface->flags = _cairo_win32_flags_for_dc (surface->dc);
     surface->flags |= CAIRO_WIN32_SURFACE_FOR_PRINTING;
 
     _cairo_win32_printing_surface_init_ps_mode (surface);
     _cairo_win32_printing_surface_init_image_support (surface);
-    _cairo_win32_printing_surface_init_language_pack (surface);
     _cairo_surface_init (&surface->base,
 			 &cairo_win32_printing_surface_backend,
 			 NULL, /* device */
                          CAIRO_CONTENT_COLOR_ALPHA);
 
     paginated = _cairo_paginated_surface_create (&surface->base,
 						 CAIRO_CONTENT_COLOR_ALPHA,
 						 &cairo_win32_surface_paginated_backend);