From 7392abbe587cfe4d1547646e5cf2358e4f749981 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Mon, 30 Mar 2020 12:34:20 +0200 Subject: build Skia on Windows with UNICODE set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Skia uses the Windows generic macros that map to the ANSI *A variants or the unicode *W variants of functions/types, but in LO code we mostly use explicitly the *W variants and do not set the UNICODE define. So build Skia with UNICODE and explicitly use *W API in SKia's API that we use. Change-Id: I689797b30a412820f97d9ce88e9fe078ead2cf76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91376 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- vcl/skia/win/gdiimpl.cxx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'vcl') diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx index e7d0b576e37a..c90185b3e4bf 100644 --- a/vcl/skia/win/gdiimpl.cxx +++ b/vcl/skia/win/gdiimpl.cxx @@ -117,16 +117,8 @@ bool WinSkiaSalGraphicsImpl::DrawTextLayout(const GenericSalLayout& rLayout) assert(dynamic_cast(&rLayout.GetFont())); const WinFontInstance* pWinFont = static_cast(&rLayout.GetFont()); const HFONT hLayoutFont = pWinFont->GetHFONT(); - LOGFONT logFont; -// Bring back GetObject that got #undef-ed in include/postwin.hxx . -// The GetObjectA/W() functions are type-unsafe, so they should match the LOGFONTA/W, -// otherwise the font name will be incorrect and Skia will choose an incorrect font. -#ifdef UNICODE -#define GetObject GetObjectW -#else -#define GetObject GetObjectA -#endif - if (GetObject(hLayoutFont, sizeof(logFont), &logFont) == 0) + LOGFONTW logFont; + if (GetObjectW(hLayoutFont, sizeof(logFont), &logFont) == 0) { assert(false); return false; -- cgit