[PDF] Make FPDF_SYSFONTINFO initialization more readable
Use designated initializers to make it clearer what fields are being initialized. Also switch from 0 to nullptr, since the fields being initialized are function pointers. Change-Id: I1fd52fe60206ec2402ea9fa3f586edaefa33d9b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5940301 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/main@{#1370228}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
e16c86f61d
commit
1752c30ddf
pdf/pdfium
@ -252,8 +252,15 @@ void DeleteFont(FPDF_SYSFONTINFO*, void* font_id) {
|
||||
GetBlinkFontMapper().DeleteFont(font_id);
|
||||
}
|
||||
|
||||
FPDF_SYSFONTINFO g_font_info = {1, 0, EnumFonts, MapFont, 0,
|
||||
GetFontData, 0, 0, DeleteFont};
|
||||
FPDF_SYSFONTINFO g_font_info = {.version = 1,
|
||||
.Release = nullptr,
|
||||
.EnumFonts = EnumFonts,
|
||||
.MapFont = MapFont,
|
||||
.GetFont = nullptr,
|
||||
.GetFontData = GetFontData,
|
||||
.GetFaceName = nullptr,
|
||||
.GetFontCharset = nullptr,
|
||||
.DeleteFont = DeleteFont};
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -347,8 +347,15 @@ void DeleteFont(FPDF_SYSFONTINFO*, void* font_id) {
|
||||
GetSkiaFontMapper().DeleteFont(font_id);
|
||||
}
|
||||
|
||||
FPDF_SYSFONTINFO g_font_info = {1, 0, 0, MapFont, 0,
|
||||
GetFontData, 0, 0, DeleteFont};
|
||||
FPDF_SYSFONTINFO g_font_info = {.version = 1,
|
||||
.Release = nullptr,
|
||||
.EnumFonts = nullptr,
|
||||
.MapFont = MapFont,
|
||||
.GetFont = nullptr,
|
||||
.GetFontData = GetFontData,
|
||||
.GetFaceName = nullptr,
|
||||
.GetFontCharset = nullptr,
|
||||
.DeleteFont = DeleteFont};
|
||||
|
||||
} // namespace
|
||||
|
||||
|
Reference in New Issue
Block a user