summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfedit_embeddertest.cpp20
-rw-r--r--fpdfsdk/fpdfedittext.cpp2
2 files changed, 11 insertions, 11 deletions
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp
index 383e207f54..05b665b33f 100644
--- a/fpdfsdk/fpdfedit_embeddertest.cpp
+++ b/fpdfsdk/fpdfedit_embeddertest.cpp
@@ -554,8 +554,8 @@ TEST_F(FPDFEditEmbeddertest, LoadSimpleType1Font) {
// TODO(npm): use other fonts after disallowing loading any font as any type
const CPDF_Font* stock_font =
CPDF_Font::GetStockFont(cpdf_doc(), "Times-Bold");
- const uint8_t* data = stock_font->m_Font.GetFontData();
- const uint32_t size = stock_font->m_Font.GetSize();
+ const uint8_t* data = stock_font->GetFont()->GetFontData();
+ const uint32_t size = stock_font->GetFont()->GetSize();
std::unique_ptr<void, FPDFFontDeleter> font(
FPDFText_LoadFont(document(), data, size, FPDF_FONT_TYPE1, false));
ASSERT_TRUE(font.get());
@@ -583,8 +583,8 @@ TEST_F(FPDFEditEmbeddertest, LoadSimpleType1Font) {
TEST_F(FPDFEditEmbeddertest, LoadSimpleTrueTypeFont) {
CreateNewDocument();
const CPDF_Font* stock_font = CPDF_Font::GetStockFont(cpdf_doc(), "Courier");
- const uint8_t* data = stock_font->m_Font.GetFontData();
- const uint32_t size = stock_font->m_Font.GetSize();
+ const uint8_t* data = stock_font->GetFont()->GetFontData();
+ const uint32_t size = stock_font->GetFont()->GetSize();
std::unique_ptr<void, FPDFFontDeleter> font(
FPDFText_LoadFont(document(), data, size, FPDF_FONT_TRUETYPE, false));
ASSERT_TRUE(font.get());
@@ -613,8 +613,8 @@ TEST_F(FPDFEditEmbeddertest, LoadCIDType0Font) {
CreateNewDocument();
const CPDF_Font* stock_font =
CPDF_Font::GetStockFont(cpdf_doc(), "Times-Roman");
- const uint8_t* data = stock_font->m_Font.GetFontData();
- const uint32_t size = stock_font->m_Font.GetSize();
+ const uint8_t* data = stock_font->GetFont()->GetFontData();
+ const uint32_t size = stock_font->GetFont()->GetSize();
std::unique_ptr<void, FPDFFontDeleter> font(
FPDFText_LoadFont(document(), data, size, FPDF_FONT_TYPE1, 1));
ASSERT_TRUE(font.get());
@@ -654,8 +654,8 @@ TEST_F(FPDFEditEmbeddertest, LoadCIDType2Font) {
CreateNewDocument();
const CPDF_Font* stock_font =
CPDF_Font::GetStockFont(cpdf_doc(), "Helvetica-Oblique");
- const uint8_t* data = stock_font->m_Font.GetFontData();
- const uint32_t size = stock_font->m_Font.GetSize();
+ const uint8_t* data = stock_font->GetFont()->GetFontData();
+ const uint32_t size = stock_font->GetFont()->GetSize();
std::unique_ptr<void, FPDFFontDeleter> font(
FPDFText_LoadFont(document(), data, size, FPDF_FONT_TRUETYPE, 1));
@@ -707,8 +707,8 @@ TEST_F(FPDFEditEmbeddertest, AddTrueTypeFontText) {
FPDF_PAGE page = FPDFPage_New(CreateNewDocument(), 0, 612, 792);
{
const CPDF_Font* stock_font = CPDF_Font::GetStockFont(cpdf_doc(), "Arial");
- const uint8_t* data = stock_font->m_Font.GetFontData();
- const uint32_t size = stock_font->m_Font.GetSize();
+ const uint8_t* data = stock_font->GetFont()->GetFontData();
+ const uint32_t size = stock_font->GetFont()->GetSize();
std::unique_ptr<void, FPDFFontDeleter> font(
FPDFText_LoadFont(document(), data, size, FPDF_FONT_TRUETYPE, 0));
ASSERT_TRUE(font.get());
diff --git a/fpdfsdk/fpdfedittext.cpp b/fpdfsdk/fpdfedittext.cpp
index cfb44f513d..4ff2269c9e 100644
--- a/fpdfsdk/fpdfedittext.cpp
+++ b/fpdfsdk/fpdfedittext.cpp
@@ -432,7 +432,7 @@ DLLEXPORT void STDCALL FPDFFont_Close(FPDF_FONT font) {
return;
CPDF_Font* cpdf_font = reinterpret_cast<CPDF_Font*>(font);
- CPDF_Document* pDoc = cpdf_font->m_pDocument;
+ CPDF_Document* pDoc = cpdf_font->GetDocument();
CPDF_DocPageData* pPageData = pDoc ? pDoc->GetPageData() : nullptr;
if (pPageData && !pPageData->IsForceClear())
pPageData->ReleaseFont(cpdf_font->GetFontDict());