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

Unified Diff: xfa/fxfa/app/xfa_ffbarcode.cpp

Issue 2421633002: Fix nullptr crash inXFA_FFBarcode::UpdateWidgetProperty(). (Closed)
Patch Set: Created 4 years, 2 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_ffbarcode.cpp
diff --git a/xfa/fxfa/app/xfa_ffbarcode.cpp b/xfa/fxfa/app/xfa_ffbarcode.cpp
index 728a701c1fe8753b6fb83c94ddda20596ef4478f..4bb3ba0a4dde5776db3bc611920fdd30ff06f7cd 100644
--- a/xfa/fxfa/app/xfa_ffbarcode.cpp
+++ b/xfa/fxfa/app/xfa_ffbarcode.cpp
@@ -161,12 +161,16 @@ void CXFA_FFBarcode::RenderWidget(CFX_Graphics* pGS,
mt.Concat(mtRotate);
m_pNormalWidget->DrawWidget(pGS, &mt);
}
+
void CXFA_FFBarcode::UpdateWidgetProperty() {
CXFA_FFTextEdit::UpdateWidgetProperty();
CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget;
CFX_WideString wsType = GetDataAcc()->GetBarcodeType();
XFA_LPCBARCODETYPEENUMINFO pBarcodeTypeInfo =
XFA_GetBarcodeTypeByName(wsType.AsStringC());
+ if (!pBarcodeTypeInfo)
+ return;
+
pBarCodeWidget->SetType(pBarcodeTypeInfo->eBCType);
CXFA_WidgetAcc* pAcc = GetDataAcc();
int32_t intVal;
@@ -216,6 +220,7 @@ void CXFA_FFBarcode::UpdateWidgetProperty() {
pBarCodeWidget->SetPrintChecksum(TRUE);
}
}
+
FX_BOOL CXFA_FFBarcode::OnLButtonDown(uint32_t dwFlags,
FX_FLOAT fx,
FX_FLOAT fy) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698