Exemplo n.º 1
0
DLLEXPORT void STDCALL
FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document,
                               FPDF_WIDGET hWidget,
                               float x,
                               float y,
                               FPDF_STRINGHANDLE* stringHandle) {
  if (!hWidget || !document)
    return;

  CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document;
  if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic &&
      pDocument->GetDocType() != XFA_DOCTYPE_Static)
    return;

  IXFA_MenuHandler* pXFAMenuHander =
      CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
  if (!pXFAMenuHander)
    return;

  std::vector<CFX_ByteString>* sSuggestWords = new std::vector<CFX_ByteString>;
  CFX_PointF ptPopup;
  ptPopup.x = x;
  ptPopup.y = y;
  pXFAMenuHander->GetSuggestWords(reinterpret_cast<IXFA_Widget*>(hWidget),
                                  ptPopup, *sSuggestWords);
  *stringHandle = ToFPDFStringHandle(sSuggestWords);
}
Exemplo n.º 2
0
DLLEXPORT void STDCALL
FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document,
                               FPDF_WIDGET hWidget,
                               float x,
                               float y,
                               FPDF_STRINGHANDLE* stringHandle) {
  if (NULL == hWidget || NULL == document)
    return;

  CPDFXFA_Document* pDocument = (CPDFXFA_Document*)document;
  if (pDocument->GetDocType() != XFA_DOCTYPE_Dynamic &&
      pDocument->GetDocType() != XFA_DOCTYPE_Static)
    return;

  IXFA_MenuHandler* pXFAMenuHander =
      CPDFXFA_App::GetInstance()->GetXFAApp()->GetMenuHandler();
  if (pXFAMenuHander == NULL)
    return;

  CFX_ByteStringArray* sSuggestWords = new CFX_ByteStringArray;
  CFX_PointF ptPopup;
  ptPopup.x = x;
  ptPopup.y = y;
  pXFAMenuHander->GetSuggestWords((IXFA_Widget*)hWidget, ptPopup,
                                  *sSuggestWords);
  *stringHandle = (FPDF_STRINGHANDLE)sSuggestWords;
}