Make CXFA_LayoutItem::GetPage() return a const pointer.
Change-Id: I5bfb6d42bb74c7d30d8a06f498699a06686eff96
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/54493
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/xfa/fxfa/layout/cxfa_layoutitem.cpp b/xfa/fxfa/layout/cxfa_layoutitem.cpp
index f39ba88..1e18566 100644
--- a/xfa/fxfa/layout/cxfa_layoutitem.cpp
+++ b/xfa/fxfa/layout/cxfa_layoutitem.cpp
@@ -74,7 +74,7 @@
: nullptr;
}
-CXFA_ViewLayoutItem* CXFA_LayoutItem::GetPage() const {
+const CXFA_ViewLayoutItem* CXFA_LayoutItem::GetPage() const {
for (CXFA_LayoutItem* pCurNode = const_cast<CXFA_LayoutItem*>(this); pCurNode;
pCurNode = pCurNode->GetParent()) {
if (pCurNode->m_pFormNode->GetElementType() == XFA_Element::PageArea)
diff --git a/xfa/fxfa/layout/cxfa_layoutitem.h b/xfa/fxfa/layout/cxfa_layoutitem.h
index cc85ce0..b92fdc1 100644
--- a/xfa/fxfa/layout/cxfa_layoutitem.h
+++ b/xfa/fxfa/layout/cxfa_layoutitem.h
@@ -26,7 +26,7 @@
CXFA_ContentLayoutItem* AsContentLayoutItem();
const CXFA_ContentLayoutItem* AsContentLayoutItem() const;
- CXFA_ViewLayoutItem* GetPage() const;
+ const CXFA_ViewLayoutItem* GetPage() const;
CXFA_Node* GetFormNode() const { return m_pFormNode.Get(); }
void SetFormNode(CXFA_Node* pNode) { m_pFormNode = pNode; }