From c6833c2366e97b4779641464bf1d14d4115cc51d Mon Sep 17 00:00:00 2001 From: npm Date: Fri, 12 Aug 2016 10:29:31 -0700 Subject: Make g_LinuxGpFontList be a 2D char array. Review-Url: https://codereview.chromium.org/2240863002 --- core/fxge/ge/fx_ge_linux.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/core/fxge/ge/fx_ge_linux.cpp b/core/fxge/ge/fx_ge_linux.cpp index 642bbc4561..f57efe8a32 100644 --- a/core/fxge/ge/fx_ge_linux.cpp +++ b/core/fxge/ge/fx_ge_linux.cpp @@ -31,17 +31,15 @@ class CFX_LinuxFontInfo : public CFX_FolderFontInfo { const size_t kLinuxGpNameSize = 6; -const struct { - const FX_CHAR* NameArr[kLinuxGpNameSize]; -} g_LinuxGpFontList[] = { - {{"TakaoPGothic", "VL PGothic", "IPAPGothic", "VL Gothic", "Kochi Gothic", - "VL Gothic regular"}}, - {{"TakaoGothic", "VL Gothic", "IPAGothic", "Kochi Gothic", nullptr, - "VL Gothic regular"}}, - {{"TakaoPMincho", "IPAPMincho", "VL Gothic", "Kochi Mincho", nullptr, - "VL Gothic regular"}}, - {{"TakaoMincho", "IPAMincho", "VL Gothic", "Kochi Mincho", nullptr, - "VL Gothic regular"}}, +const FX_CHAR* const g_LinuxGpFontList[][kLinuxGpNameSize] = { + {"TakaoPGothic", "VL PGothic", "IPAPGothic", "VL Gothic", "Kochi Gothic", + "VL Gothic regular"}, + {"TakaoGothic", "VL Gothic", "IPAGothic", "Kochi Gothic", nullptr, + "VL Gothic regular"}, + {"TakaoPMincho", "IPAPMincho", "VL Gothic", "Kochi Mincho", nullptr, + "VL Gothic regular"}, + {"TakaoMincho", "IPAMincho", "VL Gothic", "Kochi Mincho", nullptr, + "VL Gothic regular"}, }; const FX_CHAR* const g_LinuxGbFontList[] = { @@ -100,7 +98,7 @@ void* CFX_LinuxFontInfo::MapFont(int weight, size_t index = GetJapanesePreference(cstr_face, weight, pitch_family); ASSERT(index < FX_ArraySize(g_LinuxGpFontList)); for (size_t i = 0; i < kLinuxGpNameSize; i++) { - auto it = m_FontList.find(g_LinuxGpFontList[index].NameArr[i]); + auto it = m_FontList.find(g_LinuxGpFontList[index][i]); if (it != m_FontList.end()) { return it->second; } -- cgit v1.2.3