From 4d48bbfd5378ffe70a17ad613b9c167ad3ef03b2 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 7 Nov 2017 20:24:10 +0000 Subject: Rename CXFA_Font to CXFA_FontData This CL renames CXFA_Font to CXFA_FontData to make it clear this is part of the data hierarchy. The GetFontNode methods were renamed to GetFontData to match the return type. Change-Id: I5d5b9200eedc9c8c1bd8929a5a0df3d2663d7e3d Reviewed-on: https://pdfium-review.googlesource.com/17983 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- xfa/fxfa/cxfa_widgetacc.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'xfa/fxfa/cxfa_widgetacc.cpp') diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp index ea262f874d..32d925fead 100644 --- a/xfa/fxfa/cxfa_widgetacc.cpp +++ b/xfa/fxfa/cxfa_widgetacc.cpp @@ -712,10 +712,10 @@ void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) { bVert ? szCap.height = fCapReserve : szCap.width = fCapReserve; } else { float fFontSize = 10.0f; - if (CXFA_Font font = captionData.GetFont()) - fFontSize = font.GetFontSize(); - else if (CXFA_Font widgetfont = GetFont(false)) - fFontSize = widgetfont.GetFontSize(); + if (CXFA_FontData fontData = captionData.GetFontData()) + fFontSize = fontData.GetFontSize(); + else if (CXFA_FontData widgetfontData = GetFontData(false)) + fFontSize = widgetfontData.GetFontSize(); if (bVert) { szCap.height = fCapReserve > 0 ? fCapReserve : fFontSize; @@ -1482,12 +1482,12 @@ void CXFA_WidgetAcc::SetImageEditImage( RetainPtr CXFA_WidgetAcc::GetFDEFont() { WideStringView wsFontName = L"Courier"; uint32_t dwFontStyle = 0; - if (CXFA_Font font = GetFont(false)) { - if (font.IsBold()) + if (CXFA_FontData fontData = GetFontData(false)) { + if (fontData.IsBold()) dwFontStyle |= FXFONT_BOLD; - if (font.IsItalic()) + if (fontData.IsItalic()) dwFontStyle |= FXFONT_ITALIC; - font.GetTypeface(wsFontName); + fontData.GetTypeface(wsFontName); } auto* pDoc = GetDoc(); @@ -1496,9 +1496,8 @@ RetainPtr CXFA_WidgetAcc::GetFDEFont() { } float CXFA_WidgetAcc::GetFontSize() { - float fFontSize = 10.0f; - if (CXFA_Font font = GetFont(false)) - fFontSize = font.GetFontSize(); + CXFA_FontData fontData = GetFontData(false); + float fFontSize = fontData ? fontData.GetFontSize() : 10.0f; return fFontSize < 0.1f ? 10.0f : fFontSize; } @@ -1512,7 +1511,6 @@ float CXFA_WidgetAcc::GetLineHeight() { } FX_ARGB CXFA_WidgetAcc::GetTextColor() { - if (CXFA_Font font = GetFont(false)) - return font.GetColor(); - return 0xFF000000; + CXFA_FontData fontData = GetFontData(false); + return fontData ? fontData.GetColor() : 0xFF000000; } -- cgit v1.2.3