summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/formfiller')
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp5
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.h2
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp5
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.h2
4 files changed, 8 insertions, 6 deletions
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index a37a7501d0..e0af8955ac 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -245,7 +245,8 @@ CFX_WideString CFFL_FormFiller::GetSelectedText(CPDFSDK_Annot* pAnnot) {
return pWnd ? pWnd->GetSelectedText() : CFX_WideString();
}
-void CFFL_FormFiller::DeleteSelectedText(CPDFSDK_Annot* pAnnot) {
+void CFFL_FormFiller::ReplaceSelection(CPDFSDK_Annot* pAnnot,
+ const CFX_WideString& text) {
if (!IsValid())
return;
@@ -256,7 +257,7 @@ void CFFL_FormFiller::DeleteSelectedText(CPDFSDK_Annot* pAnnot) {
if (!pWnd)
return;
- pWnd->DeleteSelectedText();
+ pWnd->ReplaceSelection(text);
}
void CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag) {
diff --git a/fpdfsdk/formfiller/cffl_formfiller.h b/fpdfsdk/formfiller/cffl_formfiller.h
index 96b7a69b29..4769716be5 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.h
+++ b/fpdfsdk/formfiller/cffl_formfiller.h
@@ -75,7 +75,7 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler {
virtual bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags);
CFX_WideString GetSelectedText(CPDFSDK_Annot* pAnnot);
- void DeleteSelectedText(CPDFSDK_Annot* pAnnot);
+ void ReplaceSelection(CPDFSDK_Annot* pAnnot, const CFX_WideString& text);
void SetFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag);
void KillFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag);
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 24bfd3c3b2..6d250408f0 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -523,13 +523,14 @@ CFX_WideString CFFL_InteractiveFormFiller::GetSelectedText(
return pFormFiller ? pFormFiller->GetSelectedText(pAnnot) : CFX_WideString();
}
-void CFFL_InteractiveFormFiller::DeleteSelectedText(CPDFSDK_Annot* pAnnot) {
+void CFFL_InteractiveFormFiller::ReplaceSelection(CPDFSDK_Annot* pAnnot,
+ const CFX_WideString& text) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false);
if (!pFormFiller)
return;
- pFormFiller->DeleteSelectedText(pAnnot);
+ pFormFiller->ReplaceSelection(pAnnot, text);
}
void CFFL_InteractiveFormFiller::UnRegisterFormFiller(CPDFSDK_Annot* pAnnot) {
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.h b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
index 17e9407924..b71f3a6ef7 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.h
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
@@ -84,7 +84,7 @@ class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify {
void RemoveFormFiller(CPDFSDK_Annot* pAnnot);
CFX_WideString GetSelectedText(CPDFSDK_Annot* pAnnot);
- void DeleteSelectedText(CPDFSDK_Annot* pAnnot);
+ void ReplaceSelection(CPDFSDK_Annot* pAnnot, const CFX_WideString& text);
static bool IsVisible(CPDFSDK_Widget* pWidget);
static bool IsReadOnly(CPDFSDK_Widget* pWidget);