diff options
author | Jun Fang <jun_fang@foxitsoftware.com> | 2016-02-19 08:54:02 +0800 |
---|---|---|
committer | Jun Fang <jun_fang@foxitsoftware.com> | 2016-02-19 08:54:02 +0800 |
commit | d17a3af124c9e4fa218d5527910c0c9f22559a8f (patch) | |
tree | 102c3b57946194f1ec09c0f7370ccb399c88b798 /xfa/src/fxfa | |
parent | c5967f9dbaee98e8ac8302a62e015e5c595aa6e0 (diff) | |
download | pdfium-d17a3af124c9e4fa218d5527910c0c9f22559a8f.tar.xz |
Fix a crasher in CFDE_TxtEdtDoRecord_Insert::CFDE_TxtEdtDoRecord_Insert()
If a widget is barcode, we should set the data length
of barcode as the max length of input string.
BUG=pdfium:372
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1703963003 .
Diffstat (limited to 'xfa/src/fxfa')
-rw-r--r-- | xfa/src/fxfa/src/app/xfa_fftextedit.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp index 0b5a70170e..2d2177b670 100644 --- a/xfa/src/fxfa/src/app/xfa_fftextedit.cpp +++ b/xfa/src/fxfa/src/app/xfa_fftextedit.cpp @@ -259,6 +259,13 @@ FX_BOOL CXFA_FFTextEdit::UpdateFWLData() { bUpdate = TRUE; } } + if (m_pDataAcc->GetUIType() == XFA_ELEMENT_Barcode) { + int32_t nDataLen = 0; + if (eType == XFA_VALUEPICTURE_Edit) + m_pDataAcc->GetBarcodeAttribute_DataLength(nDataLen); + static_cast<CFWL_Edit*>(m_pNormalWidget)->SetLimit(nDataLen); + bUpdate = TRUE; + } CFX_WideString wsText; m_pDataAcc->GetValue(wsText, eType); CFX_WideString wsOldText; |