summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_widgetacc.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-07 20:24:10 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-07 20:24:10 +0000
commit4d48bbfd5378ffe70a17ad613b9c167ad3ef03b2 (patch)
tree6726e3a65a59e152d075746a1af6a49967949ac7 /xfa/fxfa/cxfa_widgetacc.cpp
parentd32fa8b75a3af1cddc4517a3085a43f7a3544c90 (diff)
downloadpdfium-4d48bbfd5378ffe70a17ad613b9c167ad3ef03b2.tar.xz
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 <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_widgetacc.cpp')
-rw-r--r--xfa/fxfa/cxfa_widgetacc.cpp26
1 files changed, 12 insertions, 14 deletions
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<CFGAS_GEFont> 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<CFGAS_GEFont> 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;
}