Convert FX_CHARSET to an enum type.
This is complicated because charsets are exposed as ints in the public
API, so some structs and functions must remain using ints.
Change-Id: I8136dc3a79f35483e87840e73d617594019fe4bf
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/83330
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfdoc/cpvt_variabletext.h b/core/fpdfdoc/cpvt_variabletext.h
index b3995c9..65a3c4c 100644
--- a/core/fpdfdoc/cpvt_variabletext.h
+++ b/core/fpdfdoc/cpvt_variabletext.h
@@ -15,6 +15,7 @@
#include "core/fpdfdoc/cpvt_lineinfo.h"
#include "core/fpdfdoc/cpvt_wordplace.h"
#include "core/fpdfdoc/cpvt_wordrange.h"
+#include "core/fxcrt/fx_codepage_forward.h"
#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
@@ -54,7 +55,7 @@
virtual int32_t GetTypeAscent(int32_t nFontIndex);
virtual int32_t GetTypeDescent(int32_t nFontIndex);
virtual int32_t GetWordFontIndex(uint16_t word,
- int32_t charset,
+ FX_Charset charset,
int32_t nFontIndex);
virtual int32_t GetDefaultFontIndex();
@@ -92,7 +93,7 @@
void SetText(const WideString& text);
CPVT_WordPlace InsertWord(const CPVT_WordPlace& place,
uint16_t word,
- int32_t charset);
+ FX_Charset charset);
CPVT_WordPlace InsertSection(const CPVT_WordPlace& place);
CPVT_WordPlace DeleteWords(const CPVT_WordRange& PlaceRange);
CPVT_WordPlace DeleteWord(const CPVT_WordPlace& place);
@@ -161,7 +162,9 @@
private:
int GetCharWidth(int32_t nFontIndex, uint16_t Word, uint16_t SubWord) const;
- int32_t GetWordFontIndex(uint16_t word, int32_t charset, int32_t nFontIndex);
+ int32_t GetWordFontIndex(uint16_t word,
+ FX_Charset charset,
+ int32_t nFontIndex);
CPVT_WordPlace AddSection(const CPVT_WordPlace& place);
CPVT_WordPlace AddLine(const CPVT_WordPlace& place,