summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-04-05 18:19:45 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-05 18:19:45 +0000
commitb948046fe797880295d0706f80831d279db75b5a (patch)
tree613b9bd21b68678f65f235ddff6945143aa58a67 /fpdfsdk
parent10f9fb3f10bc47b3317fe1c8b55711015fb7de87 (diff)
downloadpdfium-b948046fe797880295d0706f80831d279db75b5a.tar.xz
Remove unused XFA Widget API methods
Keeping the internal widget details, since they are likely needed for wiring up XFA with the other form APIs. BUG=pdfium:1056 Change-Id: I000468e27bbb59346c4288f1c4f0fe96ed5f3603 Reviewed-on: https://pdfium-review.googlesource.com/29870 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
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