summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffnotify.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/cxfa_ffnotify.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffnotify.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp
index a3e082681e..586b048b8a 100644
--- a/xfa/fxfa/cxfa_ffnotify.cpp
+++ b/xfa/fxfa/cxfa_ffnotify.cpp
@@ -116,21 +116,24 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem(
switch (pNode->GetFFWidgetType()) {
case XFA_FFWidgetType::kBarcode: {
CXFA_Node* child = pNode->GetUIChildNode();
- ASSERT(child->GetElementType() == XFA_Element::Barcode);
- pWidget = new CXFA_FFBarcode(pNode, static_cast<CXFA_Barcode*>(child));
+ if (child->GetElementType() == XFA_Element::Barcode)
+ pWidget = new CXFA_FFBarcode(pNode, static_cast<CXFA_Barcode*>(child));
break;
}
case XFA_FFWidgetType::kButton: {
CXFA_Node* child = pNode->GetUIChildNode();
- ASSERT(child->GetElementType() == XFA_Element::Button);
- pWidget = new CXFA_FFPushButton(pNode, static_cast<CXFA_Button*>(child));
+ if (child->GetElementType() == XFA_Element::Button) {
+ pWidget =
+ new CXFA_FFPushButton(pNode, static_cast<CXFA_Button*>(child));
+ }
break;
}
case XFA_FFWidgetType::kCheckButton: {
CXFA_Node* child = pNode->GetUIChildNode();
- ASSERT(child->GetElementType() == XFA_Element::CheckButton);
- pWidget =
- new CXFA_FFCheckButton(pNode, static_cast<CXFA_CheckButton*>(child));
+ if (child->GetElementType() == XFA_Element::CheckButton) {
+ pWidget = new CXFA_FFCheckButton(pNode,
+ static_cast<CXFA_CheckButton*>(child));
+ }
break;
}
case XFA_FFWidgetType::kChoiceList: {
@@ -138,7 +141,8 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem(
pWidget = new CXFA_FFListBox(pNode);
else
pWidget = new CXFA_FFComboBox(pNode);
- } break;
+ break;
+ }
case XFA_FFWidgetType::kDateTimeEdit:
pWidget = new CXFA_FFDateTimeEdit(pNode);
break;
@@ -150,9 +154,10 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem(
break;
case XFA_FFWidgetType::kPasswordEdit: {
CXFA_Node* child = pNode->GetUIChildNode();
- ASSERT(child->GetElementType() == XFA_Element::PasswordEdit);
- pWidget = new CXFA_FFPasswordEdit(pNode,
- static_cast<CXFA_PasswordEdit*>(child));
+ if (child->GetElementType() == XFA_Element::PasswordEdit) {
+ pWidget = new CXFA_FFPasswordEdit(
+ pNode, static_cast<CXFA_PasswordEdit*>(child));
+ }
break;
}
case XFA_FFWidgetType::kSignature:
@@ -186,10 +191,8 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem(
return nullptr;
}
ASSERT(pWidget);
-
CXFA_LayoutProcessor* pLayout = m_pDoc->GetXFADoc()->GetLayoutProcessor();
pWidget->SetDocView(m_pDoc->GetDocView(pLayout));
-
return pWidget;
}