OLD | NEW |
---|---|
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "fpdfsdk/include/fsdk_mgr.h" | 10 #include "fpdfsdk/include/fsdk_mgr.h" |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
325 void CPDFDoc_Environment::JS_docmailForm(void* mailData, | 325 void CPDFDoc_Environment::JS_docmailForm(void* mailData, |
326 int length, | 326 int length, |
327 FPDF_BOOL bUI, | 327 FPDF_BOOL bUI, |
328 const FX_WCHAR* To, | 328 const FX_WCHAR* To, |
329 const FX_WCHAR* Subject, | 329 const FX_WCHAR* Subject, |
330 const FX_WCHAR* CC, | 330 const FX_WCHAR* CC, |
331 const FX_WCHAR* BCC, | 331 const FX_WCHAR* BCC, |
332 const FX_WCHAR* Msg) { | 332 const FX_WCHAR* Msg) { |
333 if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_mail) { | 333 if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_mail) { |
334 CFX_ByteString bsTo = CFX_WideString(To).UTF16LE_Encode(); | 334 CFX_ByteString bsTo = CFX_WideString(To).UTF16LE_Encode(); |
335 CFX_ByteString bsCC = CFX_WideString(Subject).UTF16LE_Encode(); | 335 CFX_ByteString bsSubject = CFX_WideString(Subject).UTF16LE_Encode(); |
336 CFX_ByteString bsCC = CFX_WideString(CC).UTF16LE_Encode(); | |
336 CFX_ByteString bsBcc = CFX_WideString(BCC).UTF16LE_Encode(); | 337 CFX_ByteString bsBcc = CFX_WideString(BCC).UTF16LE_Encode(); |
337 CFX_ByteString bsSubject = CFX_WideString(Subject).UTF16LE_Encode(); | |
338 CFX_ByteString bsMsg = CFX_WideString(Msg).UTF16LE_Encode(); | 338 CFX_ByteString bsMsg = CFX_WideString(Msg).UTF16LE_Encode(); |
339 FPDF_WIDESTRING pTo = (FPDF_WIDESTRING)bsTo.GetBuffer(bsTo.GetLength()); | 339 FPDF_WIDESTRING pTo = (FPDF_WIDESTRING)bsTo.GetBuffer(bsTo.GetLength()); |
340 FPDF_WIDESTRING pCC = (FPDF_WIDESTRING)bsCC.GetBuffer(bsCC.GetLength()); | 340 FPDF_WIDESTRING pCC = (FPDF_WIDESTRING)bsCC.GetBuffer(bsCC.GetLength()); |
341 FPDF_WIDESTRING pBcc = (FPDF_WIDESTRING)bsBcc.GetBuffer(bsBcc.GetLength()); | 341 FPDF_WIDESTRING pBcc = (FPDF_WIDESTRING)bsBcc.GetBuffer(bsBcc.GetLength()); |
342 FPDF_WIDESTRING pSubject = | 342 FPDF_WIDESTRING pSubject = |
343 (FPDF_WIDESTRING)bsSubject.GetBuffer(bsSubject.GetLength()); | 343 (FPDF_WIDESTRING)bsSubject.GetBuffer(bsSubject.GetLength()); |
344 FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(bsMsg.GetLength()); | 344 FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(bsMsg.GetLength()); |
345 m_pInfo->m_pJsPlatform->Doc_mail(m_pInfo->m_pJsPlatform, mailData, length, | 345 m_pInfo->m_pJsPlatform->Doc_mail(m_pInfo->m_pJsPlatform, mailData, length, |
346 bUI, pTo, pSubject, pCC, pBcc, pMsg); | 346 bUI, pTo, pSubject, pCC, pBcc, pMsg); |
347 bsTo.ReleaseBuffer(); | 347 bsTo.ReleaseBuffer(); |
Tom Sepez
2016/01/29 18:55:50
nit: pointless. We'll get these later.
| |
348 bsCC.ReleaseBuffer(); | 348 bsCC.ReleaseBuffer(); |
349 bsBcc.ReleaseBuffer(); | 349 bsBcc.ReleaseBuffer(); |
350 bsSubject.ReleaseBuffer(); | 350 bsSubject.ReleaseBuffer(); |
351 bsMsg.ReleaseBuffer(); | 351 bsMsg.ReleaseBuffer(); |
352 } | 352 } |
353 } | 353 } |
354 | 354 |
355 IJS_Runtime* CPDFDoc_Environment::GetJSRuntime() { | 355 IJS_Runtime* CPDFDoc_Environment::GetJSRuntime() { |
356 if (!IsJSInitiated()) | 356 if (!IsJSInitiated()) |
357 return NULL; | 357 return NULL; |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
917 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 917 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
918 if (!pFocusAnnot) | 918 if (!pFocusAnnot) |
919 return nullptr; | 919 return nullptr; |
920 | 920 |
921 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 921 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
922 if (pAnnot == pFocusAnnot) | 922 if (pAnnot == pFocusAnnot) |
923 return pAnnot; | 923 return pAnnot; |
924 } | 924 } |
925 return nullptr; | 925 return nullptr; |
926 } | 926 } |
OLD | NEW |