| 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> |
| 11 | 11 |
| 12 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 12 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
| 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| 14 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" | 14 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" |
| 15 #include "fpdfsdk/include/fsdk_define.h" | 15 #include "fpdfsdk/include/fsdk_define.h" |
| 16 #include "fpdfsdk/include/fsdk_mgr.h" | 16 #include "fpdfsdk/include/fsdk_mgr.h" |
| 17 #include "public/fpdfview.h" | 17 #include "public/fpdfview.h" |
| 18 #include "third_party/base/stl_util.h" | 18 #include "third_party/base/stl_util.h" |
| 19 | 19 |
| 20 #ifdef PDF_ENABLE_XFA | 20 #ifdef PDF_ENABLE_XFA |
| 21 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h" | 21 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h" |
| 22 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h" | 22 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h" |
| 23 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_page.h" | 23 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_page.h" |
| 24 #include "xfa/include/fxfa/xfa_ffapp.h" | 24 #include "xfa/include/fxfa/xfa_ffapp.h" |
| 25 #include "xfa/include/fxfa/xfa_ffdocview.h" | 25 #include "xfa/include/fxfa/xfa_ffdocview.h" |
| 26 #include "xfa/include/fxfa/xfa_ffpageview.h" | 26 #include "xfa/include/fxfa/xfa_ffpageview.h" |
| 27 #include "xfa/include/fxfa/xfa_ffwidget.h" |
| 27 #endif // PDF_ENABLE_XFA | 28 #endif // PDF_ENABLE_XFA |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| 30 | 31 |
| 31 CPDFSDK_InterForm* FormHandleToInterForm(FPDF_FORMHANDLE hHandle) { | 32 CPDFSDK_InterForm* FormHandleToInterForm(FPDF_FORMHANDLE hHandle) { |
| 32 CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle); | 33 CPDFSDK_Document* pSDKDoc = CPDFSDK_Document::FromFPDFFormHandle(hHandle); |
| 33 return pSDKDoc ? pSDKDoc->GetInterForm() : nullptr; | 34 return pSDKDoc ? pSDKDoc->GetInterForm() : nullptr; |
| 34 } | 35 } |
| 35 | 36 |
| 36 CPDFSDK_PageView* FormHandleToPageView(FPDF_FORMHANDLE hHandle, | 37 CPDFSDK_PageView* FormHandleToPageView(FPDF_FORMHANDLE hHandle, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 std::unique_ptr<IXFA_WidgetIterator, ReleaseDeleter<IXFA_WidgetIterator>> | 94 std::unique_ptr<IXFA_WidgetIterator, ReleaseDeleter<IXFA_WidgetIterator>> |
| 94 pWidgetIterator(pPageView->CreateWidgetIterator( | 95 pWidgetIterator(pPageView->CreateWidgetIterator( |
| 95 XFA_TRAVERSEWAY_Form, | 96 XFA_TRAVERSEWAY_Form, |
| 96 XFA_WIDGETFILTER_Viewable | XFA_WIDGETFILTER_AllType)); | 97 XFA_WIDGETFILTER_Viewable | XFA_WIDGETFILTER_AllType)); |
| 97 if (!pWidgetIterator) | 98 if (!pWidgetIterator) |
| 98 return -1; | 99 return -1; |
| 99 | 100 |
| 100 CXFA_FFWidget* pXFAAnnot = pWidgetIterator->MoveToNext(); | 101 CXFA_FFWidget* pXFAAnnot = pWidgetIterator->MoveToNext(); |
| 101 while (pXFAAnnot) { | 102 while (pXFAAnnot) { |
| 102 CFX_RectF rcBBox; | 103 CFX_RectF rcBBox; |
| 103 pWidgetHandler->GetBBox(pXFAAnnot, rcBBox, 0); | 104 pXFAAnnot->GetBBox(rcBBox, 0); |
| 104 CFX_FloatRect rcWidget(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, | 105 CFX_FloatRect rcWidget(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, |
| 105 rcBBox.top + rcBBox.height); | 106 rcBBox.top + rcBBox.height); |
| 106 rcWidget.left -= 1.0f; | 107 rcWidget.left -= 1.0f; |
| 107 rcWidget.right += 1.0f; | 108 rcWidget.right += 1.0f; |
| 108 rcWidget.bottom -= 1.0f; | 109 rcWidget.bottom -= 1.0f; |
| 109 rcWidget.top += 1.0f; | 110 rcWidget.top += 1.0f; |
| 110 | 111 |
| 111 if (rcWidget.Contains(static_cast<FX_FLOAT>(page_x), | 112 if (rcWidget.Contains(static_cast<FX_FLOAT>(page_x), |
| 112 static_cast<FX_FLOAT>(page_y))) { | 113 static_cast<FX_FLOAT>(page_y))) { |
| 113 return FPDF_FORMFIELD_XFA; | 114 return FPDF_FORMFIELD_XFA; |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 int rotate, | 406 int rotate, |
| 406 int flags) { | 407 int flags) { |
| 407 FFLCommon(hHandle, nullptr, recorder, page, start_x, start_y, size_x, size_y, | 408 FFLCommon(hHandle, nullptr, recorder, page, start_x, start_y, size_x, size_y, |
| 408 rotate, flags); | 409 rotate, flags); |
| 409 } | 410 } |
| 410 #endif | 411 #endif |
| 411 | 412 |
| 412 #ifdef PDF_ENABLE_XFA | 413 #ifdef PDF_ENABLE_XFA |
| 413 DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, | 414 DLLEXPORT void STDCALL FPDF_Widget_Undo(FPDF_DOCUMENT document, |
| 414 FPDF_WIDGET hWidget) { | 415 FPDF_WIDGET hWidget) { |
| 415 if (NULL == hWidget || NULL == document) | 416 if (!hWidget || !document) |
| 416 return; | 417 return; |
| 417 | 418 |
| 418 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; | 419 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; |
| 419 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && | 420 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && |
| 420 pDocument->GetDocType() != XFA_DOCTYPE_Static) | 421 pDocument->GetDocType() != XFA_DOCTYPE_Static) |
| 421 return; | 422 return; |
| 422 | 423 |
| 423 CXFA_FFMenuHandler* pXFAMenuHander = | 424 static_cast<CXFA_FFWidget*>(hWidget)->Undo(); |
| 424 CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler(); | |
| 425 if (pXFAMenuHander == NULL) | |
| 426 return; | |
| 427 | |
| 428 pXFAMenuHander->Undo((CXFA_FFWidget*)hWidget); | |
| 429 } | 425 } |
| 430 DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document, | 426 DLLEXPORT void STDCALL FPDF_Widget_Redo(FPDF_DOCUMENT document, |
| 431 FPDF_WIDGET hWidget) { | 427 FPDF_WIDGET hWidget) { |
| 432 if (NULL == hWidget || NULL == document) | 428 if (!hWidget || !document) |
| 433 return; | 429 return; |
| 434 | 430 |
| 435 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; | 431 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; |
| 436 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && | 432 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && |
| 437 pDocument->GetDocType() != XFA_DOCTYPE_Static) | 433 pDocument->GetDocType() != XFA_DOCTYPE_Static) |
| 438 return; | 434 return; |
| 439 | 435 |
| 440 CXFA_FFMenuHandler* pXFAMenuHander = | 436 static_cast<CXFA_FFWidget*>(hWidget)->Redo(); |
| 441 CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler(); | |
| 442 if (pXFAMenuHander == NULL) | |
| 443 return; | |
| 444 | |
| 445 pXFAMenuHander->Redo((CXFA_FFWidget*)hWidget); | |
| 446 } | 437 } |
| 447 | 438 |
| 448 DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document, | 439 DLLEXPORT void STDCALL FPDF_Widget_SelectAll(FPDF_DOCUMENT document, |
| 449 FPDF_WIDGET hWidget) { | 440 FPDF_WIDGET hWidget) { |
| 450 if (NULL == hWidget || NULL == document) | 441 if (!hWidget || !document) |
| 451 return; | 442 return; |
| 452 | 443 |
| 453 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; | 444 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; |
| 454 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && | 445 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && |
| 455 pDocument->GetDocType() != XFA_DOCTYPE_Static) | 446 pDocument->GetDocType() != XFA_DOCTYPE_Static) |
| 456 return; | 447 return; |
| 457 | 448 |
| 458 CXFA_FFMenuHandler* pXFAMenuHander = | 449 static_cast<CXFA_FFWidget*>(hWidget)->SelectAll(); |
| 459 CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler(); | |
| 460 if (pXFAMenuHander == NULL) | |
| 461 return; | |
| 462 | |
| 463 pXFAMenuHander->SelectAll((CXFA_FFWidget*)hWidget); | |
| 464 } | 450 } |
| 465 DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document, | 451 DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document, |
| 466 FPDF_WIDGET hWidget, | 452 FPDF_WIDGET hWidget, |
| 467 FPDF_WIDESTRING wsText, | 453 FPDF_WIDESTRING wsText, |
| 468 FPDF_DWORD* size) { | 454 FPDF_DWORD* size) { |
| 469 if (NULL == hWidget || NULL == document) | 455 if (!hWidget || !document) |
| 470 return; | 456 return; |
| 471 | 457 |
| 472 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; | 458 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; |
| 473 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && | 459 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && |
| 474 pDocument->GetDocType() != XFA_DOCTYPE_Static) | 460 pDocument->GetDocType() != XFA_DOCTYPE_Static) |
| 475 return; | 461 return; |
| 476 | 462 |
| 477 CXFA_FFMenuHandler* pXFAMenuHander = | |
| 478 CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler(); | |
| 479 if (pXFAMenuHander == NULL) | |
| 480 return; | |
| 481 | |
| 482 CFX_WideString wsCpText; | 463 CFX_WideString wsCpText; |
| 483 pXFAMenuHander->Copy((CXFA_FFWidget*)hWidget, wsCpText); | 464 static_cast<CXFA_FFWidget*>(hWidget)->Copy(wsCpText); |
| 484 | 465 |
| 485 CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode(); | 466 CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode(); |
| 486 uint32_t len = bsCpText.GetLength() / sizeof(unsigned short); | 467 uint32_t len = bsCpText.GetLength() / sizeof(unsigned short); |
| 487 if (wsText == NULL) { | 468 if (wsText == NULL) { |
| 488 *size = len; | 469 *size = len; |
| 489 return; | 470 return; |
| 490 } | 471 } |
| 491 | 472 |
| 492 uint32_t real_size = len < *size ? len : *size; | 473 uint32_t real_size = len < *size ? len : *size; |
| 493 if (real_size > 0) { | 474 if (real_size > 0) { |
| 494 FXSYS_memcpy((void*)wsText, | 475 FXSYS_memcpy((void*)wsText, |
| 495 bsCpText.GetBuffer(real_size * sizeof(unsigned short)), | 476 bsCpText.GetBuffer(real_size * sizeof(unsigned short)), |
| 496 real_size * sizeof(unsigned short)); | 477 real_size * sizeof(unsigned short)); |
| 497 bsCpText.ReleaseBuffer(real_size * sizeof(unsigned short)); | 478 bsCpText.ReleaseBuffer(real_size * sizeof(unsigned short)); |
| 498 } | 479 } |
| 499 *size = real_size; | 480 *size = real_size; |
| 500 } | 481 } |
| 501 | 482 |
| 502 DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document, | 483 DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document, |
| 503 FPDF_WIDGET hWidget, | 484 FPDF_WIDGET hWidget, |
| 504 FPDF_WIDESTRING wsText, | 485 FPDF_WIDESTRING wsText, |
| 505 FPDF_DWORD* size) { | 486 FPDF_DWORD* size) { |
| 506 if (NULL == hWidget || NULL == document) | 487 if (NULL == hWidget || NULL == document) |
| 507 return; | 488 return; |
| 508 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; | 489 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; |
| 509 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && | 490 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && |
| 510 pDocument->GetDocType() != XFA_DOCTYPE_Static) | 491 pDocument->GetDocType() != XFA_DOCTYPE_Static) |
| 511 return; | 492 return; |
| 512 | 493 |
| 513 CXFA_FFMenuHandler* pXFAMenuHander = | |
| 514 CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler(); | |
| 515 if (pXFAMenuHander == NULL) | |
| 516 return; | |
| 517 | |
| 518 CFX_WideString wsCpText; | 494 CFX_WideString wsCpText; |
| 519 pXFAMenuHander->Cut((CXFA_FFWidget*)hWidget, wsCpText); | 495 static_cast<CXFA_FFWidget*>(hWidget)->Cut(wsCpText); |
| 520 | 496 |
| 521 CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode(); | 497 CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode(); |
| 522 uint32_t len = bsCpText.GetLength() / sizeof(unsigned short); | 498 uint32_t len = bsCpText.GetLength() / sizeof(unsigned short); |
| 523 if (wsText == NULL) { | 499 if (!wsText) { |
| 524 *size = len; | 500 *size = len; |
| 525 return; | 501 return; |
| 526 } | 502 } |
| 527 | 503 |
| 528 uint32_t real_size = len < *size ? len : *size; | 504 uint32_t real_size = len < *size ? len : *size; |
| 529 if (real_size > 0) { | 505 if (real_size > 0) { |
| 530 FXSYS_memcpy((void*)wsText, | 506 FXSYS_memcpy((void*)wsText, |
| 531 bsCpText.GetBuffer(real_size * sizeof(unsigned short)), | 507 bsCpText.GetBuffer(real_size * sizeof(unsigned short)), |
| 532 real_size * sizeof(unsigned short)); | 508 real_size * sizeof(unsigned short)); |
| 533 bsCpText.ReleaseBuffer(real_size * sizeof(unsigned short)); | 509 bsCpText.ReleaseBuffer(real_size * sizeof(unsigned short)); |
| 534 } | 510 } |
| 535 *size = real_size; | 511 *size = real_size; |
| 536 } | 512 } |
| 537 | 513 |
| 538 DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document, | 514 DLLEXPORT void STDCALL FPDF_Widget_Paste(FPDF_DOCUMENT document, |
| 539 FPDF_WIDGET hWidget, | 515 FPDF_WIDGET hWidget, |
| 540 FPDF_WIDESTRING wsText, | 516 FPDF_WIDESTRING wsText, |
| 541 FPDF_DWORD size) { | 517 FPDF_DWORD size) { |
| 542 if (NULL == hWidget || NULL == document) | 518 if (!hWidget || !document) |
| 543 return; | 519 return; |
| 544 | 520 |
| 545 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; | 521 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; |
| 546 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && | 522 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && |
| 547 pDocument->GetDocType() != XFA_DOCTYPE_Static) | 523 pDocument->GetDocType() != XFA_DOCTYPE_Static) |
| 548 return; | 524 return; |
| 549 | 525 |
| 550 CXFA_FFMenuHandler* pXFAMenuHander = | |
| 551 CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler(); | |
| 552 if (pXFAMenuHander == NULL) | |
| 553 return; | |
| 554 | |
| 555 CFX_WideString wstr = CFX_WideString::FromUTF16LE(wsText, size); | 526 CFX_WideString wstr = CFX_WideString::FromUTF16LE(wsText, size); |
| 556 pXFAMenuHander->Paste((CXFA_FFWidget*)hWidget, wstr); | 527 static_cast<CXFA_FFWidget*>(hWidget)->Paste(wstr); |
| 557 } | 528 } |
| 558 | 529 |
| 559 DLLEXPORT void STDCALL | 530 DLLEXPORT void STDCALL |
| 560 FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document, | 531 FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document, |
| 561 FPDF_WIDGET hWidget, | 532 FPDF_WIDGET hWidget, |
| 562 float x, | 533 float x, |
| 563 float y, | 534 float y, |
| 564 FPDF_BYTESTRING bsText) { | 535 FPDF_BYTESTRING bsText) { |
| 565 if (NULL == hWidget || NULL == document) | 536 if (!hWidget || !document) |
| 566 return; | 537 return; |
| 567 | 538 |
| 568 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; | 539 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; |
| 569 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && | 540 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && |
| 570 pDocument->GetDocType() != XFA_DOCTYPE_Static) | 541 pDocument->GetDocType() != XFA_DOCTYPE_Static) |
| 571 return; | 542 return; |
| 572 | 543 |
| 573 CXFA_FFMenuHandler* pXFAMenuHander = | |
| 574 CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler(); | |
| 575 if (pXFAMenuHander == NULL) | |
| 576 return; | |
| 577 | |
| 578 CFX_PointF ptPopup; | 544 CFX_PointF ptPopup; |
| 579 ptPopup.x = x; | 545 ptPopup.x = x; |
| 580 ptPopup.y = y; | 546 ptPopup.y = y; |
| 581 CFX_ByteStringC bs(bsText); | 547 CFX_ByteStringC bs(bsText); |
| 582 pXFAMenuHander->ReplaceSpellCheckWord( | 548 static_cast<CXFA_FFWidget*>(hWidget)->ReplaceSpellCheckWord(ptPopup, bs); |
| 583 reinterpret_cast<CXFA_FFWidget*>(hWidget), ptPopup, bs); | |
| 584 } | 549 } |
| 585 | 550 |
| 586 DLLEXPORT void STDCALL | 551 DLLEXPORT void STDCALL |
| 587 FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document, | 552 FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document, |
| 588 FPDF_WIDGET hWidget, | 553 FPDF_WIDGET hWidget, |
| 589 float x, | 554 float x, |
| 590 float y, | 555 float y, |
| 591 FPDF_STRINGHANDLE* stringHandle) { | 556 FPDF_STRINGHANDLE* stringHandle) { |
| 592 if (!hWidget || !document) | 557 if (!hWidget || !document) |
| 593 return; | 558 return; |
| 594 | 559 |
| 595 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; | 560 CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document; |
| 596 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && | 561 if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic && |
| 597 pDocument->GetDocType() != XFA_DOCTYPE_Static) | 562 pDocument->GetDocType() != XFA_DOCTYPE_Static) |
| 598 return; | 563 return; |
| 599 | 564 |
| 600 CXFA_FFMenuHandler* pXFAMenuHander = | |
| 601 CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler(); | |
| 602 if (!pXFAMenuHander) | |
| 603 return; | |
| 604 | |
| 605 std::vector<CFX_ByteString>* sSuggestWords = new std::vector<CFX_ByteString>; | 565 std::vector<CFX_ByteString>* sSuggestWords = new std::vector<CFX_ByteString>; |
| 606 CFX_PointF ptPopup; | 566 CFX_PointF ptPopup; |
| 607 ptPopup.x = x; | 567 ptPopup.x = x; |
| 608 ptPopup.y = y; | 568 ptPopup.y = y; |
| 609 pXFAMenuHander->GetSuggestWords(reinterpret_cast<CXFA_FFWidget*>(hWidget), | 569 static_cast<CXFA_FFWidget*>(hWidget) |
| 610 ptPopup, *sSuggestWords); | 570 ->GetSuggestWords(ptPopup, *sSuggestWords); |
| 611 *stringHandle = ToFPDFStringHandle(sSuggestWords); | 571 *stringHandle = ToFPDFStringHandle(sSuggestWords); |
| 612 } | 572 } |
| 613 | 573 |
| 614 DLLEXPORT int STDCALL FPDF_StringHandleCounts(FPDF_STRINGHANDLE sHandle) { | 574 DLLEXPORT int STDCALL FPDF_StringHandleCounts(FPDF_STRINGHANDLE sHandle) { |
| 615 std::vector<CFX_ByteString>* sSuggestWords = FromFPDFStringHandle(sHandle); | 575 std::vector<CFX_ByteString>* sSuggestWords = FromFPDFStringHandle(sHandle); |
| 616 return sSuggestWords ? pdfium::CollectionSize<int>(*sSuggestWords) : -1; | 576 return sSuggestWords ? pdfium::CollectionSize<int>(*sSuggestWords) : -1; |
| 617 } | 577 } |
| 618 | 578 |
| 619 DLLEXPORT FPDF_BOOL STDCALL | 579 DLLEXPORT FPDF_BOOL STDCALL |
| 620 FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE sHandle, | 580 FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE sHandle, |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); | 719 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); |
| 760 } | 720 } |
| 761 } else { | 721 } else { |
| 762 if (aa.ActionExist(CPDF_AAction::ClosePage)) { | 722 if (aa.ActionExist(CPDF_AAction::ClosePage)) { |
| 763 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 723 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
| 764 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 724 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
| 765 } | 725 } |
| 766 } | 726 } |
| 767 } | 727 } |
| 768 } | 728 } |
| OLD | NEW |