summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfformfill.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfformfill.cpp')
-rw-r--r--fpdfsdk/fpdfformfill.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index e541b81cc3..7f4e3dfd69 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -383,12 +383,17 @@ DLLEXPORT unsigned long STDCALL FORM_GetSelectedText(FPDF_FORMHANDLE hHandle,
return form_text_len;
}
-DLLEXPORT void STDCALL FORM_DeleteSelectedText(FPDF_FORMHANDLE hHandle,
- FPDF_PAGE page) {
+DLLEXPORT void STDCALL FORM_ReplaceSelection(FPDF_FORMHANDLE hHandle,
+ FPDF_PAGE page,
+ FPDF_WIDESTRING wsText) {
CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, page);
if (!pPageView)
return;
- pPageView->DeleteSelectedText();
+
+ FX_STRSIZE len = CFX_WideString::WStringLength(wsText);
+ CFX_WideString wide_str_text = CFX_WideString::FromUTF16LE(wsText, len);
+
+ pPageView->ReplaceSelection(wide_str_text);
}
DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle) {