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 "public/fpdf_formfill.h" | 7 #include "public/fpdf_formfill.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 | 590 |
591 std::vector<CFX_ByteString>* sSuggestWords = FromFPDFStringHandle(sHandle); | 591 std::vector<CFX_ByteString>* sSuggestWords = FromFPDFStringHandle(sHandle); |
592 uint32_t len = (*sSuggestWords)[index].GetLength(); | 592 uint32_t len = (*sSuggestWords)[index].GetLength(); |
593 if (!bsText) { | 593 if (!bsText) { |
594 *size = len; | 594 *size = len; |
595 return TRUE; | 595 return TRUE; |
596 } | 596 } |
597 | 597 |
598 uint32_t real_size = len < *size ? len : *size; | 598 uint32_t real_size = len < *size ? len : *size; |
599 if (real_size > 0) | 599 if (real_size > 0) |
600 FXSYS_memcpy((void*)bsText, (const FX_CHAR*)(*sSuggestWords)[index], | 600 FXSYS_memcpy((void*)bsText, (*sSuggestWords)[index].c_str(), real_size); |
601 real_size); | |
602 *size = real_size; | 601 *size = real_size; |
603 return TRUE; | 602 return TRUE; |
604 } | 603 } |
605 | 604 |
606 DLLEXPORT void STDCALL | 605 DLLEXPORT void STDCALL |
607 FPDF_StringHandleRelease(FPDF_STRINGHANDLE stringHandle) { | 606 FPDF_StringHandleRelease(FPDF_STRINGHANDLE stringHandle) { |
608 delete FromFPDFStringHandle(stringHandle); | 607 delete FromFPDFStringHandle(stringHandle); |
609 } | 608 } |
610 | 609 |
611 DLLEXPORT FPDF_BOOL STDCALL | 610 DLLEXPORT FPDF_BOOL STDCALL |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); | 718 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); |
720 } | 719 } |
721 } else { | 720 } else { |
722 if (aa.ActionExist(CPDF_AAction::ClosePage)) { | 721 if (aa.ActionExist(CPDF_AAction::ClosePage)) { |
723 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 722 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
724 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 723 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
725 } | 724 } |
726 } | 725 } |
727 } | 726 } |
728 } | 727 } |
OLD | NEW |