summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdf_formfill.cpp115
-rw-r--r--fpdfsdk/fpdf_view_c_api_test.c6
2 files changed, 0 insertions, 121 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,
diff --git a/fpdfsdk/fpdf_view_c_api_test.c b/fpdfsdk/fpdf_view_c_api_test.c
index c352e69e37..1942b73957 100644
--- a/fpdfsdk/fpdf_view_c_api_test.c
+++ b/fpdfsdk/fpdf_view_c_api_test.c
@@ -227,12 +227,6 @@ int CheckPDFiumCApi() {
CHK(FPDF_GetFormType);
#ifdef PDF_ENABLE_XFA
CHK(FPDF_LoadXFA);
- CHK(FPDF_Widget_Undo);
- CHK(FPDF_Widget_Redo);
- CHK(FPDF_Widget_SelectAll);
- CHK(FPDF_Widget_Copy);
- CHK(FPDF_Widget_Cut);
- CHK(FPDF_Widget_Paste);
#endif
// fpdf_ppo.h