From 59cdc7dc88310bd8cdf2ace60e0f567561d38dbb Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 29 Jan 2018 20:38:16 +0000 Subject: Move barcode code to CXFA_Barcode This CL moves the barcode specific code out of CXFA_Node and into CXFA_Barcode. The CXFA_FFBarcode widget was modified to take the barcode as a parameter. Change-Id: I8ff91cb58402665f4ba63f2eeced45feeaa9ff50 Reviewed-on: https://pdfium-review.googlesource.com/24450 Commit-Queue: dsinclair Reviewed-by: Ryan Harrison --- xfa/fxfa/cxfa_ffnotify.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xfa/fxfa/cxfa_ffnotify.cpp') diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp index d4834f02f2..36f860199a 100644 --- a/xfa/fxfa/cxfa_ffnotify.cpp +++ b/xfa/fxfa/cxfa_ffnotify.cpp @@ -35,6 +35,7 @@ #include "xfa/fxfa/cxfa_fwladapterwidgetmgr.h" #include "xfa/fxfa/cxfa_textlayout.h" #include "xfa/fxfa/cxfa_textprovider.h" +#include "xfa/fxfa/parser/cxfa_barcode.h" #include "xfa/fxfa/parser/cxfa_binditems.h" #include "xfa/fxfa/parser/cxfa_node.h" @@ -119,7 +120,9 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem( CXFA_FFWidget* pWidget = nullptr; switch (pNode->GetFFWidgetType()) { case XFA_FFWidgetType::kBarcode: - pWidget = new CXFA_FFBarcode(pNode); + ASSERT(pNode->GetUIChildNode()->GetElementType() == XFA_Element::Barcode); + pWidget = new CXFA_FFBarcode( + pNode, static_cast(pNode->GetUIChildNode())); break; case XFA_FFWidgetType::kButton: pWidget = new CXFA_FFPushButton(pNode); -- cgit v1.2.3