summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_textparser.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-10 19:43:56 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-10 19:43:56 +0000
commit948879d23226aea31aa9ae5f6eb1fb8572f0fc05 (patch)
treee40d527c3f8757d8038ef7f7cd26dca7a83e3574 /xfa/fxfa/cxfa_textparser.cpp
parente844cccc8419dae40720aad57c3bcd7ced14a925 (diff)
downloadpdfium-948879d23226aea31aa9ae5f6eb1fb8572f0fc05.tar.xz
Rename GetFont to GetFontIfExists
This CL makes it explicit that GetFont may return nullptr. Change-Id: Icb7ec5ad4ed6c5f7a728230d1237898b8f2fd778 Reviewed-on: https://pdfium-review.googlesource.com/22673 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_textparser.cpp')
-rw-r--r--xfa/fxfa/cxfa_textparser.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/xfa/fxfa/cxfa_textparser.cpp b/xfa/fxfa/cxfa_textparser.cpp
index 03cba8e8e2..0fd59a0852 100644
--- a/xfa/fxfa/cxfa_textparser.cpp
+++ b/xfa/fxfa/cxfa_textparser.cpp
@@ -60,7 +60,7 @@ void CXFA_TextParser::InitCSSData(CXFA_TextProvider* pTextProvider) {
if (!m_pSelector) {
m_pSelector = pdfium::MakeUnique<CFX_CSSStyleSelector>();
- CXFA_Font* font = pTextProvider->GetFont();
+ CXFA_Font* font = pTextProvider->GetFontIfExists();
m_pSelector->SetDefFontSize(font ? font->GetFontSize() : 10.0f);
}
@@ -132,7 +132,7 @@ RetainPtr<CFX_CSSComputedStyle> CXFA_TextParser::CreateRootStyle(
pStyle->SetMarginWidth(rtMarginWidth);
}
- CXFA_Font* font = pTextProvider->GetFont();
+ CXFA_Font* font = pTextProvider->GetFontIfExists();
if (font) {
pStyle->SetColor(font->GetColor());
pStyle->SetFontStyle(font->IsItalic() ? CFX_CSSFontStyle::Italic
@@ -330,7 +330,7 @@ RetainPtr<CFGAS_GEFont> CXFA_TextParser::GetFont(
CFX_CSSComputedStyle* pStyle) const {
WideString wsFamily = L"Courier";
uint32_t dwStyle = 0;
- CXFA_Font* font = pTextProvider->GetFont();
+ CXFA_Font* font = pTextProvider->GetFontIfExists();
if (font) {
wsFamily = font->GetTypeface();
if (font->IsBold())
@@ -360,7 +360,7 @@ float CXFA_TextParser::GetFontSize(CXFA_TextProvider* pTextProvider,
if (pStyle)
return pStyle->GetFontSize();
- CXFA_Font* font = pTextProvider->GetFont();
+ CXFA_Font* font = pTextProvider->GetFontIfExists();
return font ? font->GetFontSize() : 10;
}
@@ -386,7 +386,7 @@ int32_t CXFA_TextParser::GetHorScale(CXFA_TextProvider* pTextProvider,
}
}
- CXFA_Font* font = pTextProvider->GetFont();
+ CXFA_Font* font = pTextProvider->GetFontIfExists();
return font ? static_cast<int32_t>(font->GetHorizontalScale()) : 100;
}
@@ -398,7 +398,7 @@ int32_t CXFA_TextParser::GetVerScale(CXFA_TextProvider* pTextProvider,
return wsValue.GetInteger();
}
- CXFA_Font* font = pTextProvider->GetFont();
+ CXFA_Font* font = pTextProvider->GetFontIfExists();
return font ? static_cast<int32_t>(font->GetVerticalScale()) : 100;
}
@@ -408,7 +408,7 @@ void CXFA_TextParser::GetUnderline(CXFA_TextProvider* pTextProvider,
XFA_AttributeEnum& iPeriod) const {
iUnderline = 0;
iPeriod = XFA_AttributeEnum::All;
- CXFA_Font* font = pTextProvider->GetFont();
+ CXFA_Font* font = pTextProvider->GetFontIfExists();
if (!pStyle) {
if (font) {
iUnderline = font->GetUnderline();
@@ -441,7 +441,7 @@ void CXFA_TextParser::GetLinethrough(CXFA_TextProvider* pTextProvider,
return;
}
- CXFA_Font* font = pTextProvider->GetFont();
+ CXFA_Font* font = pTextProvider->GetFontIfExists();
if (font)
iLinethrough = font->GetLineThrough();
}
@@ -451,7 +451,7 @@ FX_ARGB CXFA_TextParser::GetColor(CXFA_TextProvider* pTextProvider,
if (pStyle)
return pStyle->GetColor();
- CXFA_Font* font = pTextProvider->GetFont();
+ CXFA_Font* font = pTextProvider->GetFontIfExists();
return font ? font->GetColor() : 0xFF000000;
}
@@ -461,7 +461,7 @@ float CXFA_TextParser::GetBaseline(CXFA_TextProvider* pTextProvider,
if (pStyle->GetVerticalAlign() == CFX_CSSVerticalAlign::Number)
return pStyle->GetNumberVerticalAlign();
} else {
- CXFA_Font* font = pTextProvider->GetFont();
+ CXFA_Font* font = pTextProvider->GetFontIfExists();
if (font)
return font->GetBaselineShift();
}