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

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

Issue 2010923002: Add opaque "layout item" to widgets for caller's use. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Cast to FFWidget. Created 4 years, 7 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
« no previous file with comments | « xfa/fxfa/app/xfa_fwladapter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_fwltheme.cpp
diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp
index df09fb504a9a94629e16fc6ac051d8b1026e617b..14649f1b80add370328113ca371962e94c864a28 100644
--- a/xfa/fxfa/app/xfa_fwltheme.cpp
+++ b/xfa/fxfa/app/xfa_fwltheme.cpp
@@ -35,14 +35,13 @@ const FX_WCHAR* const g_FWLTheme_CalFonts[] = {
CXFA_FFWidget* XFA_ThemeGetOuterWidget(IFWL_Widget* pWidget) {
IFWL_Widget* pOuter = pWidget;
- while (pOuter->GetOuter()) {
+ while (pOuter && pOuter->GetOuter())
pOuter = pOuter->GetOuter();
- }
- if (pOuter) {
- return (CXFA_FFWidget*)pOuter->GetPrivateData(pOuter);
- }
- return NULL;
+
+ return pOuter ? static_cast<CXFA_FFWidget*>(pOuter->GetLayoutItem())
+ : nullptr;
}
+
CXFA_FWLTheme::CXFA_FWLTheme(CXFA_FFApp* pApp) : m_pApp(pApp) {
m_dwCapacity = 0;
m_fCapacity = 0;
« no previous file with comments | « xfa/fxfa/app/xfa_fwladapter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698