Unreviewed changes
3 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: core/fxge/win32/cwin32_platform.cpp
Insertions: 5, Deletions: 5.
@@ -128,7 +128,7 @@
void DeleteFont(void* hFont) override;
void AddInstalledFont(CFX_FontMapper* mapper,
- ByteString* last_family,
+ ByteString& last_family,
const LOGFONTA* plf,
uint32_t font_type);
@@ -162,7 +162,7 @@
uint32_t font_type,
LPARAM lParam) {
auto* arg = reinterpret_cast<FontEnumCallbackArg*>(lParam);
- arg->font_info->AddInstalledFont(arg->mapper, &arg->last_family, plf,
+ arg->font_info->AddInstalledFont(arg->mapper, arg->last_family, plf,
font_type);
return 1;
}
@@ -195,7 +195,7 @@
}
void CFX_Win32FontInfo::AddInstalledFont(CFX_FontMapper* mapper,
- ByteString* last_family,
+ ByteString& last_family,
const LOGFONTA* plf,
uint32_t font_type) {
ByteString name(plf->lfFaceName);
@@ -203,7 +203,7 @@
return;
}
- if (name == *last_family) {
+ if (name == last_family) {
mapper->AddInstalledFont(name, FX_GetCharsetFromInt(plf->lfCharSet));
return;
}
@@ -214,7 +214,7 @@
}
mapper->AddInstalledFont(name, FX_GetCharsetFromInt(plf->lfCharSet));
- *last_family = name;
+ last_family = name;
}
void CFX_Win32FontInfo::EnumFontList(CFX_FontMapper* pMapper) {
```
Change information
Commit message:
Pass CFX_FontMapper to SystemFontInfoIface::MapFont
Currently, SystemFontInfoIface implementations (like CFX_Win32FontInfo)
store a pointer to CFX_FontMapper during EnumFontList() because they
need it later during MapFont() calls.
This CL changes SystemFontInfoIface::MapFont() signature to accept
CFX_FontMapper* as the first argument. Since CFX_FontMapper is always
the caller of MapFont(), it can pass itself. This allows removing the
mapper_ member variable from SystemFontInfoIface implementations.
For CFX_Win32FontInfo, the GDI callback state (last_family) is also
moved out of the class and into a local FontEnumCallbackArg struct
used only during enumeration. AddInstalledFont() is decoupled from
this struct by passing the required pointers directly.
TAG=agy
CONV=30003669-9b4b-42c1-bdbf-15c9e0075074
Change-Id: Ib5a79bd4ef31360ea5cab496d706eecf59b35381
Files:
- M core/fxge/android/cfx_androidfontinfo.cpp
- M core/fxge/android/cfx_androidfontinfo.h
- M core/fxge/android/cfx_androidfontinfo_unittest.cpp
- M core/fxge/apple/capple_platform.cpp
- M core/fxge/cfx_folderfontinfo.cpp
- M core/fxge/cfx_folderfontinfo.h
- M core/fxge/cfx_fontmapper.cpp
- M core/fxge/cfx_fontmapper_unittest.cpp
- M core/fxge/linux/fx_linux_impl.cpp
- M core/fxge/systemfontinfo_iface.h
- M core/fxge/win32/cwin32_platform.cpp
- M fpdfsdk/fpdf_sysfontinfo.cpp
- M testing/test_fonts.cpp
Change size: M
Delta: 13 files changed, 86 insertions(+), 53 deletions(-)
Branch: refs/heads/main
Submit Requirements:
Code-Review: +1 by Lei Zhang