Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1290)

Unified Diff: xfa/fxfa/app/xfa_ffwidgetacc.cpp

Issue 2609423003: Properly ref-count CFGAS_GEFont with CFX_RetainPtr. (Closed)
Patch Set: comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/fxfa/app/xfa_ffwidgetacc.cpp
diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
index 13145e6448b476048832459c886157c086b815f2..e62ebca302b1fafc2ceefb07e1fbd266e493cff3 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
@@ -1498,19 +1498,18 @@ CXFA_WidgetLayoutData* CXFA_WidgetAcc::GetWidgetLayoutData() {
return m_pLayoutData.get();
}
-CFGAS_GEFont* CXFA_WidgetAcc::GetFDEFont() {
+CFX_RetainPtr<CFGAS_GEFont> CXFA_WidgetAcc::GetFDEFont() {
CFX_WideStringC wsFontName = FX_WSTRC(L"Courier");
uint32_t dwFontStyle = 0;
if (CXFA_Font font = GetFont()) {
- if (font.IsBold()) {
+ if (font.IsBold())
dwFontStyle |= FX_FONTSTYLE_Bold;
- }
- if (font.IsItalic()) {
+ if (font.IsItalic())
dwFontStyle |= FX_FONTSTYLE_Italic;
- }
font.GetTypeface(wsFontName);
}
- CXFA_FFDoc* pDoc = GetDoc();
+
+ auto pDoc = GetDoc();
return pDoc->GetApp()->GetXFAFontMgr()->GetFont(pDoc, wsFontName,
dwFontStyle);
}

Powered by Google App Engine
This is Rietveld 408576698