diff options
Diffstat (limited to 'fpdfsdk/fpdf_formfill.cpp')
-rw-r--r-- | fpdfsdk/fpdf_formfill.cpp | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/fpdfsdk/fpdf_formfill.cpp b/fpdfsdk/fpdf_formfill.cpp index 7185044b72..7b47259a12 100644 --- a/fpdfsdk/fpdf_formfill.cpp +++ b/fpdfsdk/fpdf_formfill.cpp @@ -496,121 +496,6 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_FFLRecord(FPDF_FORMHANDLE hHandle, } #endif -#ifdef PDF_ENABLE_XFA -FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Undo(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget) { - if (!hWidget || !document) - return; - - CPDFXFA_Context* pContext = static_cast<CPDFXFA_Context*>(document); - if (!pContext->ContainsXFAForm()) - return; - - static_cast<CXFA_FFWidget*>(hWidget)->Undo(); -} - -FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Redo(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget) { - if (!hWidget || !document) - return; - - CPDFXFA_Context* pContext = static_cast<CPDFXFA_Context*>(document); - if (!pContext->ContainsXFAForm()) - return; - - static_cast<CXFA_FFWidget*>(hWidget)->Redo(); -} - -FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_SelectAll(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget) { - if (!hWidget || !document) - return; - - CPDFXFA_Context* pContext = static_cast<CPDFXFA_Context*>(document); - if (!pContext->ContainsXFAForm()) - return; - - static_cast<CXFA_FFWidget*>(hWidget)->SelectAll(); -} - -FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Copy(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget, - FPDF_WIDESTRING wsText, - FPDF_DWORD* size) { - if (!hWidget || !document) - return; - - CPDFXFA_Context* pContext = static_cast<CPDFXFA_Context*>(document); - if (!pContext->ContainsXFAForm()) - return; - - WideString wsCpText = - static_cast<CXFA_FFWidget*>(hWidget)->Copy().value_or(WideString()); - - ByteString bsCpText = wsCpText.UTF16LE_Encode(); - uint32_t len = bsCpText.GetLength() / sizeof(unsigned short); - if (!wsText) { - *size = len; - return; - } - - uint32_t real_size = len < *size ? len : *size; - if (real_size > 0) { - memcpy((void*)wsText, - bsCpText.GetBuffer(real_size * sizeof(unsigned short)), - real_size * sizeof(unsigned short)); - bsCpText.ReleaseBuffer(real_size * sizeof(unsigned short)); - } - *size = real_size; -} - -FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Cut(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget, - FPDF_WIDESTRING wsText, - FPDF_DWORD* size) { - if (!hWidget || !document) - return; - - CPDFXFA_Context* pContext = static_cast<CPDFXFA_Context*>(document); - if (!pContext->ContainsXFAForm()) - return; - - WideString wsCpText = - static_cast<CXFA_FFWidget*>(hWidget)->Cut().value_or(WideString()); - - ByteString bsCpText = wsCpText.UTF16LE_Encode(); - uint32_t len = bsCpText.GetLength() / sizeof(unsigned short); - if (!wsText) { - *size = len; - return; - } - - uint32_t real_size = len < *size ? len : *size; - if (real_size > 0) { - memcpy((void*)wsText, - bsCpText.GetBuffer(real_size * sizeof(unsigned short)), - real_size * sizeof(unsigned short)); - bsCpText.ReleaseBuffer(real_size * sizeof(unsigned short)); - } - *size = real_size; -} - -FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Paste(FPDF_DOCUMENT document, - FPDF_WIDGET hWidget, - FPDF_WIDESTRING wsText, - FPDF_DWORD size) { - if (!hWidget || !document) - return; - - CPDFXFA_Context* pContext = static_cast<CPDFXFA_Context*>(document); - if (!pContext->ContainsXFAForm()) - return; - - WideString wstr = WideString::FromUTF16LE(wsText, size); - static_cast<CXFA_FFWidget*>(hWidget)->Paste(wstr); -} -#endif // PDF_ENABLE_XFA - FPDF_EXPORT void FPDF_CALLCONV FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, int fieldType, |