diff options
author | tsepez <tsepez@chromium.org> | 2016-05-16 12:03:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-16 12:03:24 -0700 |
commit | 3f80c864d5318d4d80ac811d42c92d8f63e0b5ac (patch) | |
tree | efc4acca871bfb2fb1af80f5ee5779ac6ef70034 /xfa/fxfa/app/xfa_fftextedit.cpp | |
parent | b22504a8c589ff39a1d6eaa83dcd3ead454d3443 (diff) | |
download | pdfium-3f80c864d5318d4d80ac811d42c92d8f63e0b5ac.tar.xz |
Remove some c_str() calls from StringCs in xfa docs.
Avoids the risk of possibly getting a non-null terminated
buffer if the StringC happened to be created by Mid(), etc.
Doesn't seem to happen in practice.
Review-Url: https://codereview.chromium.org/1983683003
Diffstat (limited to 'xfa/fxfa/app/xfa_fftextedit.cpp')
-rw-r--r-- | xfa/fxfa/app/xfa_fftextedit.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp index f5605c9775..ea641f2066 100644 --- a/xfa/fxfa/app/xfa_fftextedit.cpp +++ b/xfa/fxfa/app/xfa_fftextedit.cpp @@ -194,14 +194,13 @@ void CXFA_FFTextEdit::ValidateNumberField(const CFX_WideString& wsText) { if (pAppProvider) { CFX_WideString wsTitle; pAppProvider->LoadString(XFA_IDS_AppName, wsTitle); - CFX_WideString wsMessage; CFX_WideString wsError; pAppProvider->LoadString(XFA_IDS_ValidateNumberError, wsError); CFX_WideString wsSomField; pAcc->GetNode()->GetSOMExpression(wsSomField); + CFX_WideString wsMessage; wsMessage.Format(wsError.c_str(), wsText.c_str(), wsSomField.c_str()); - pAppProvider->MsgBox(wsMessage.AsStringC(), wsTitle.AsStringC(), - XFA_MBICON_Error, XFA_MB_OK); + pAppProvider->MsgBox(wsMessage, wsTitle, XFA_MBICON_Error, XFA_MB_OK); } } } |