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

Unified Diff: xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp

Issue 1441243005: Add AsLayoutItem()/ToLayoutItem() functions. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Typos Created 5 years, 1 month 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/src/fxfa/src/parser/xfa_layout_appadapter.h ('k') | xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
index 4cb1192d205227f1da9603b59eeda086bf2ad9b9..263d36dbc79759f15fbc1e30786f13792e2c791e 100644
--- a/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp
@@ -385,8 +385,9 @@ void CXFA_LayoutItem::GetRect(CFX_RectF& rtLayout, FX_BOOL bRelative) const {
if (!bRelative) {
for (CXFA_LayoutItem* pLayoutItem = pThis->m_pParent; pLayoutItem;
pLayoutItem = pLayoutItem->m_pParent) {
- if (pLayoutItem->IsContentLayoutItem()) {
- sPos += static_cast<CXFA_ContentLayoutItem*>(pLayoutItem)->m_sPos;
+ if (CXFA_ContentLayoutItem* pContent =
+ pLayoutItem->AsContentLayoutItem()) {
+ sPos += pContent->m_sPos;
if (CXFA_Node* pMarginNode =
pLayoutItem->m_pFormNode->GetFirstChildByClass(
XFA_ELEMENT_Margin)) {
@@ -556,7 +557,7 @@ CXFA_ContentLayoutItem* CXFA_ItemLayoutProcessor::ExtractLayoutItem() {
}
#ifdef _XFA_LAYOUTITEM_ProcessCACHE_
if (m_nCurChildNodeStage == XFA_ItemLayoutProcessorStages_Done &&
- m_pOldLayoutItem && m_pOldLayoutItem->IsContentLayoutItem()) {
+ ToContentLayoutItem(m_pOldLayoutItem)) {
if (m_pOldLayoutItem->m_pPrev) {
m_pOldLayoutItem->m_pPrev->m_pNext = NULL;
}
« no previous file with comments | « xfa/src/fxfa/src/parser/xfa_layout_appadapter.h ('k') | xfa/src/fxfa/src/parser/xfa_layout_pagemgr_new.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698