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

Unified Diff: xfa/src/fxfa/src/parser/xfa_layout_appadapter.h

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/common/xfa_doclayout.h ('k') | xfa/src/fxfa/src/parser/xfa_layout_itemlayout.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_appadapter.h
diff --git a/xfa/src/fxfa/src/parser/xfa_layout_appadapter.h b/xfa/src/fxfa/src/parser/xfa_layout_appadapter.h
index 66d61dbfde987cdf5bdfd2e2e04e5c2716b743f8..66bde24d1a0e94ab4cba4be01ee5fb69ccd6633f 100644
--- a/xfa/src/fxfa/src/parser/xfa_layout_appadapter.h
+++ b/xfa/src/fxfa/src/parser/xfa_layout_appadapter.h
@@ -30,23 +30,23 @@ class CXFA_TraverseStrategy_ContentAreaContainerLayoutItem {
CXFA_ContainerLayoutItem* pLayoutItem) {
for (CXFA_LayoutItem* pChildItem = pLayoutItem->m_pFirstChild; pChildItem;
pChildItem = pChildItem->m_pNextSibling) {
- if (pChildItem->IsContentLayoutItem()) {
- continue;
+ if (CXFA_ContainerLayoutItem* pContainer =
+ pChildItem->AsContainerLayoutItem()) {
+ return pContainer;
}
- return (CXFA_ContainerLayoutItem*)pChildItem;
}
- return NULL;
+ return nullptr;
}
static inline CXFA_ContainerLayoutItem* GetNextSibling(
CXFA_ContainerLayoutItem* pLayoutItem) {
for (CXFA_LayoutItem* pChildItem = pLayoutItem->m_pNextSibling; pChildItem;
pChildItem = pChildItem->m_pNextSibling) {
- if (pChildItem->IsContentLayoutItem()) {
- continue;
+ if (CXFA_ContainerLayoutItem* pContainer =
+ pChildItem->AsContainerLayoutItem()) {
+ return pContainer;
}
- return (CXFA_ContainerLayoutItem*)pChildItem;
}
- return NULL;
+ return nullptr;
}
static inline CXFA_ContainerLayoutItem* GetParent(
CXFA_ContainerLayoutItem* pLayoutItem) {
« no previous file with comments | « xfa/src/fxfa/src/common/xfa_doclayout.h ('k') | xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698