vcl/win/gdi/DWriteTextRenderer.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit c9974818bdf9ab8ccf2f8db140ff6b2b3eb1c461 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Sep 9 11:56:17 2022 +0100 Commit: خالد حسني <kha...@aliftype.com> CommitDate: Sat Sep 10 07:55:11 2022 +0200 win: Explicitly cast glyph ID to 16 bit After commit ba02639c9c17d75e73fc2eff83e64c116fcdaeb2 Date: Wed Sep 7 11:00:26 2022 +0200 vcl: Make glyph IDs 32bit , my clang-cl Windows build would otherwise fail as follows: [build CXX] vcl/win/gdi/DWriteTextRenderer.cxx [build CUS] postprocess/images C:/tools/cygwin/home/michael/development/git/libreoffice/vcl/win/gdi/DWriteTextRenderer.cxx(264,39): error: non-constant-expression cannot be narrowed from type 'sal_GlyphId' (aka 'unsigned int') to 'UINT16' (aka 'unsigned short') in initializer list [-Wc++11-narrowing] UINT16 glyphIndices[] = { pGlyph->glyphId() }; ^~~~~~~~~~~~~~~~~ C:/tools/cygwin/home/michael/development/git/libreoffice/vcl/win/gdi/DWriteTextRenderer.cxx(264,39): note: insert an explicit cast to silence this issue UINT16 glyphIndices[] = { pGlyph->glyphId() }; ^~~~~~~~~~~~~~~~~ static_cast<UINT16>( ) 1 error generated. Change-Id: Ifa4fcdd98331378b5d9340f961e0bc4d7e842fe2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139721 Tested-by: Jenkins Reviewed-by: خالد حسني <kha...@aliftype.com> diff --git a/vcl/win/gdi/DWriteTextRenderer.cxx b/vcl/win/gdi/DWriteTextRenderer.cxx index 835e09e7eed9..c160166a541e 100644 --- a/vcl/win/gdi/DWriteTextRenderer.cxx +++ b/vcl/win/gdi/DWriteTextRenderer.cxx @@ -261,7 +261,7 @@ bool D2DWriteTextOutRenderer::performRender(GenericSalLayout const & rLayout, Sa const GlyphItem* pGlyph; while (rLayout.GetNextGlyph(&pGlyph, aPos, nStart)) { - UINT16 glyphIndices[] = { pGlyph->glyphId() }; + UINT16 glyphIndices[] = { static_cast<UINT16>(pGlyph->glyphId()) }; FLOAT glyphAdvances[] = { static_cast<FLOAT>(pGlyph->newWidth()) / fHScale }; DWRITE_GLYPH_OFFSET glyphOffsets[] = { { 0.0f, 0.0f }, }; D2D1_POINT_2F baseline = { static_cast<FLOAT>(aPos.getX() - bounds.Left()) / fHScale,